I have a map center and a floating point number.
How can I get this as two separated variables, such as:
var lat = ... var lng = ...
I have a float:
var NewMapCenter = map.getCenter();
I tried passing float toWords(x) but it didn't work
I tried to subtract (,) and split it, but didn't work
var latlngStr = (StrNewMapCenter.substr(1, (StrNewMapCenter.length-1))).split(",",2); var NewMapCenter = parseFloat(latlngStr[0]);
I tried, but this event is like an event, but I need it without the need for a click.
google.maps.event.addListener(map, 'click', function(event) { var myLatLng = event.latlng; var Newlat = position.coords.latitude; var Newlng = position.coords.longitude; }
Thanks Sebastian
source share