I have the following code which through Google Maps API gets the latitude and longitude of the position clicked on the map
var latitude_longitude = evt.latLng;
When I alert the variable using the code below the following is displayed: (53.4128,-1.51165)
alert(latitude_longitude);////Gets latitude and Longitude - Latitude first - Longitude second
However I now need to split (53.4128,-1.51165) into 2 variables Latitude and Longitude and have tried using the code below:
var myarr = latitude_longitude.split(","); var latitude = myarr; alert(latitude);
However the alert doesn't show and I am unsure why?