Back to project page SmartMap.
The source code is released under:
Apache License
If you think the Android project SmartMap listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.dennytech.smartmap; //from w w w . j av a2 s . c o m import android.location.Location; import com.dennytech.smartmap.impl.autonavi.ANMyLocationOverlay; import com.dennytech.smartmap.impl.google.GoogleMyLocationOverlay; /** * My location map lay, and show 'My location' on the map. * * @see #MyLocationOverlay * * @author Jun.Deng * */ public class SMMyLocationOverlay implements IMyLocationOverlay { private IMyLocationOverlay mWrapper; public SMMyLocationOverlay(SMMapFragment mapFragment) { if (mapFragment.getActivity() instanceof com.amap.mapapi.map.MapActivity) { mWrapper = new ANMyLocationOverlay(mapFragment.getActivity(), (com.amap.mapapi.map.MapView) mapFragment.mapView().real()); } else { mWrapper = new GoogleMyLocationOverlay(mapFragment.getActivity(), (com.google.android.maps.MapView) mapFragment.mapView() .real()); } } @Override public void enableMyLocation() { mWrapper.enableMyLocation(); } @Override public void enableCompass() { mWrapper.enableCompass(); } @Override public Object real() { return mWrapper.real(); } @Override public IGeoPoint getMyLocation() { return mWrapper.getMyLocation(); } @Override public void onLocationChanged(Location location) { mWrapper.onLocationChanged(location); } }