PDA

View Full Version : Drag and Drop Map



H0BJ0B
08-05-2009, 07:37 PM
Hey guys,

I want to make a map with movable counters - that is, an image of a map in the background, and if you are logged in, you can move the counters (other images) to any place on the image. Then, anyone (logged in or not) should be able to see where each counter is.

Does anyone know how I can do this?

Thanks,
H0BJ0B

MrPinkPanther
08-05-2009, 08:04 PM
I could maybe do it in Flash :)

Iszak
09-05-2009, 02:17 AM
Forget flash, you can easily do it (and should do it with JavaScript) with one of the many JavaScript frameworks. Flash has it's uses such as videos but when you can do it in JavaScript you should because it's more accessible.

jQuery UI http://docs.jquery.com/UI/Draggables
Scriptaculous http://wiki.github.com/madrobby/scriptaculous/draggable

Mentor
09-05-2009, 10:31 AM
Maybe Bias as i've been pokeing it for the last few days, but i've got to recommend the google maps api.
Its incredibly powerful yet painfully simple to anyone with any javascript experince. It also has a huge amount of documention, examples and pretty much anything else you could want.

(code play ground means you can play around with the examples and easly see the results)
Dragable markers too: http://code.google.com/apis/ajax/playground/?exp=maps#map_marker_drag

Although you'll still have to do a little ajax/php yourself to save the marker positions / reload them.

Iszak
09-05-2009, 11:34 AM
Thanks for the link Mentor, I think I may play around with this - I also recommend using it for what you want.

+rep for the link.

Want to hide these adverts? Register an account for free!