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

Bijoy bijoya at rediff.co.in
Mon Sep 29 09:07:20 EDT 2008


Hi All,

First let me congratulate each one of you for the release of 2.7 version of
OpenLayers.

I have been trying to figure out the solution for one of the problem. Not
sure if this is a easy fix. Can anyone advice me on how can I do this?

I am using OpenLayers 2.6 version, with DragMarker class
(http://trac.openlayers.org/attachment/ticket/639/DragMarker.txt) which is
to be included with 2.8 release.

Description:
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.

Problem:
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.
-- 
View this message in context: http://www.nabble.com/Associate-Marker-with-its-popup-after-drag-tp19723532p19723532.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.




More information about the Dev mailing list