Move markers on map
Hello again,
I was just wondering if someone might have successfully implemented a function to move markers after they have been put onto the map in AS2?
I'm kinda loosing my mind with this...
Thanks a lot.
I was just wondering if someone might have successfully implemented a function to move markers after they have been put onto the map in AS2?
I'm kinda loosing my mind with this...
Thanks a lot.
2
people have this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?You need to add listeners to the map, for start-pan, panned and end-pan.
If all your markers are in one container, initally positioned using map.locationPoint, then the way to do it is this:
On start pan, remember the position of your marker layer.
On pan, set the marker layer position to the start position plus the delta from the event.
On end pan, set the marker layer back to where it was, and reposition all your markers using map.locationPoint
I hope that helps.
1 person says
this answers the question
-
Inappropriate?Thanks a lot!—I think you might have gotten me wrong, though.
I meant to move only one marker according to it's new position.
Let's say, you'd update the position of your home, because you just moved.
You'd somehow pass on the new lat/long-values and the marker would get updated.
Any idea how that could be achieved?
Thanks again. -
Inappropriate?Oh I see. This is possible, but the API isn't very well constructed for it yet (some of these functions should be on Map).
You need to add listeners to your marker: MouseEvent.MOUSE_DOWN and MouseEvent.MOUSE_UP and call startDrag and stopDrag appropriately. On mouse up, you can change the x/y of the marker into a lat/lon with map.pointLocation(marker, map.markerClip) and then call map.markerClip.setMarkerLocation(marker, location) and map.markerClip.updateClips() ... I think that should work.
This code is pretty new though, so feel free to post back here if you don't get it working: http://modestmaps.mapstraction.com/tr...
I’m confident
The company says
this answers the question
Loading Profile...



EMPLOYEE