Back to project page kluster-android.
The source code is released under:
Apache License
If you think the Android project kluster-android 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.cs446.kluster.map; //from w w w . j a v a2 s .c o m import android.location.Location; import com.google.android.gms.maps.model.LatLng; public class MapUtils { public MapUtils() { } public static LatLng stringToLatLng(String str) { double lat = Double.parseDouble(str.substring(0, str.indexOf(','))); double lng = Double.parseDouble(str.substring(str.indexOf(',')+1)); return new LatLng(lat, lng); } public static String latLngToString(LatLng latlng) { return Double.toString(latlng.latitude) + "," + Double.toString(latlng.longitude); } public static LatLng locationToLatLng(Location loc) { return new LatLng(loc.getLatitude(), loc.getLongitude()); } public static String locationToString(Location loc) { return latLngToString(locationToLatLng(loc)); } }