[OpenLayers-Users] Associate Marker with its popup after drag

Bijoy K. Anupam bijoya at rediff.co.in
Fri Sep 26 09:17:24 EDT 2008


Hi All,

 

I hope someone can help me with this.

 

I am developing a map service where user can click on any point on the map,
and the marker shows with its popup. User can than fill up the form and
submit. This marker now contains the saved data.

Now, user can also drag this marker to new location if he wants to and
re-position the marker to new location. The already saved data should now
show on the popup with new lonlat position of the markers. The user can put
any number of markers, and drag any marker at any time.

 

The problem I am facing here is how I associate the popup with its marker. I
am using OpenLayer.Feature obj to createPopup and createMarker. And, to drag
the marker, I am using DragMarker control. On 'doneDragging' I trap the new
lonlat position. But, I can't associate the popup with this marker. If I
could set any ID for each marker and If I could get this ID after drag, I
could know that this marker is ID 1, and popup data should be Array 1
[Something like this.].

 

Or, If I could drag the popup along with marker. Right now, I destroy the
earlier popup using feature.destroyPopup(), and redraw it again with new
lotlan position which I am sure is not a good idea to do. There must be
something which can be used to move the popup along with marker.

 

I hope this explanation is good enough to know about the problem I face.

 

Thanks,

With Regards,

<BIJOY>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080926/bd19efe8/attachment.html


More information about the Users mailing list