New answers tagged

0

You need to create marker object before or on click on the list item. Currently, what is happening is that marker object is not initialized properly and also the map object is not accessible in terminiFunction(). Here are the updated functions: var map; function initMap() { // Create a map object and specify the DOM element for display. ...


2

I was able to solve this issue by just deleting/not specifying the iconAnchor property of the custom icon. Then the 'icon's center' will always remain at the correct position by default.


0

One thing you need to do is move the creation of the "Myposition" layer out of the callback and into an initialization function (possibly as part of startWatch() as long as you remove the layer in stopWatch()). OpenLayers might be smart enough not to recreate the layer if you use the same name (I am not sure which it does), but you might also be creating ...


2

You can use setStyle within the mousemove function: layer.on({ 'mousemove': function (e) { //I want to make the point a red style ? this.setStyle({fillColor:"#ff0000"}); ... } )}


0

You need to stop thinking in feets. Your image is maybe using feets in first but you are using pixels with images. So you need to convert feets to pixels using the "rule of three" (You have the image width and height in feets and you have the same image with pixel units) Then you can use the below sample to put a point on the top of the static image. The ...



Top 50 recent answers are included