Hi, i am trying to create markers after and alert window button is clicked. is there anyway to create markers in javascript and have them update on the map?
I tried to use openlayers to create the markers, here is the code im trying to implement,
Any suggestions would be greatly appreciated
callback: function () {var x = { x: d.worldXY.lon };var y = { y: d.worldXY.lat };var myxString = JSON.stringify(x);var myyString = JSON.stringify(y);var size = new OpenLayers.Size(10, 17);var offset = new OpenLayers.Pixel(-(size.w / 2), -size.h);var icon = new OpenLayers.Icon(’<a href=“boston.openguides.org/markers/AQUA.png”>boston.openguides.org/markers/AQUA.png</a>’, size, offset);markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(x,y), icon));document.getElementById(‘txtDrLong’).value = myxString;document.getElementById(‘txtDrLat’).value = myyString;}