Dynamically add markers
-
Is there any way to dynamically add markers?
I am testing a page template with the map on it, and I want to be able to add markers based, for example, on the location of the person browsing it.
I’ve tried creating a page template with some javascript to capture location data and generate a marker. I can display the content of the location (lat/long) but I can’t get it to create the marker on the map.
My script is
var marker1=new google.maps.Marker({
map: wgmpmap,
draggable:false,
position: new google.maps.LatLng(mylat,mylong),
title: “my marker”,
clickable: true,
icon: “”
});
wgmpmap.setCenter(mylat,mylong);
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Dynamically add markers’ is closed to new replies.