I got my latlng from my draggable marker.. How can I separate the getLatLng value into lat and longitude? Remember, not String to LatLng. Thanks
To clarify you've got a LatLng value and you want the separate values for each?
var myLatLng = myMarker.getPosition();
var lat = myLatLng.lat();
var lng = myLatLng.lng();
You should look at the docs for LatLng in the reference
Instead, you can try to use geocoder to separate your latlng
geocoder.getLatLng(yourlatlng, function(point){
if(!point){
alert(address + " not found");
}else{
lat = point.y;
longi = point.x;
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With