I want to place the pins on my Google Maps map with a variable containing the location, when I make one like this, my pin works.
var imageDriver = 'marker.png';
var DriverLatLng = new google.maps.LatLng(62.446026, 17.331340);
var driverMarker = new google.maps.Marker({
position: DriverLatLng,
map: map,
icon: imageDriver,
But I want to use this method, to store the latitude and longitude inside a variable:
var location = "62.446026, 17.331340";
var imageDriver = 'marker.png';
var DriverLatLng = new google.maps.LatLng(location);
var driverMarker = new google.maps.Marker({
position: DriverLatLng,
map: map,
icon: imageDriver,
When I do as the second snippet, the pin just disappear. What is causing this?
Thanks