Replace 'Google Maps' with 'Open Street Maps' for Travel-Mate Android App
Repository
The app provides users with various features from choosing the correct destination to making all the bookings and to easily organizing the trip. The app provides solutions for every possible problem a traveller might face during the course of his or her entire journey.
Bug Fixes
What was the issue(s)?
In many places of the application Google map was used using map API key. OSM describes itself as an open data source, meaning that any person or company is able to use the map information contained in OpenStreetMap.
What was the solution?
-Referance open street map https://wiki.openstreetmap.org/wiki/Android.
- -
Replaced
- Removed meta other api_key from source code. - Replaced Google mapview layout withcom.google.android.gms:play-services-maps
withorg.osmdroid:osmdroid-android
- In the respective activity below code to initialise and render the map<org.osmdroid.views.MapView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.4"/>
- Used the below logic to add Marker Item overlay on OSM./**
* On open street map initialize
*/
private void initMap() {
mMap.setBuiltInZoomControls(false);
mMap.setMultiTouchControls(true);
mMap.setTilesScaledToDpi(true);
mController = mMap.getController();
MyLocationNewOverlay mLocationoverlay = new MyLocationNewOverlay(mMap);
mLocationoverlay.enableFollowLocation();
mLocationoverlay.enableMyLocation();
mMap.getOverlays().add(mLocationoverlay);
mController.setZoom(14);
}
marker.setPosition(coord);
marker.setIcon(this.getResources().getDrawable(locationIcon));
marker.setTitle(locationName);
marker.setOnMarkerClickListener(this);
Hi, @hiremani. Your account has been excluded from Utopian rewards and therefore this contribution post will not be reviewed. You can contact us at https://support.utopian.io/ if you have any further questions.