0

I am building a googlemaps web application that has a series of static markers as well as a series of markers representing staff who are "out on the field" I am able to retrieve a staff members lat, long position via ajax.

But using jquery ui map v3 I cannot update the poistion of the marker with a matching staff ID.

How can i change a markers position and then update the map view?

Thank you

jaget
  • 2,149
  • 6
  • 21
  • 29

1 Answers1

0

Use the setPosition() method of Marker to change the position of a marker !

Very simple example here

Manse
  • 37,765
  • 10
  • 83
  • 108
  • so how could I use this to move a marker and then draw it in the new position? – jaget Mar 30 '12 at 16:46
  • @jaget the setPosition method does exactly that see the example – Manse Mar 30 '12 at 19:00
  • I am so stupid, turns out I was doing the same as you however, the JSON object I was retrieving uses lat long and I was trying to use it's postcode, which doesn't exist. – jaget Mar 30 '12 at 19:15
  • I have another issue I am trying to use, getMarkers() to get an array of markers so I can loop through and check/ update all positions, however I am being told by console log that there is an error with 'apply'. Does this mean anything to you? – jaget Mar 30 '12 at 21:03