I have the following code, that get's a user position on Android, and creates or (should) update a marker on the Map
var myPos = null;
function locSuccess(position) {
var newPoint = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
if(myPos == null) {
myPos = new google.maps.Marker({
'id':'myPos',
'position':newPoint,
'icon' : 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png'
});
$('#map_canvas').gmap('addMarker', myPos);
} else {
myPos.setPosition(newPoint);
}
$('#map_canvas').gmap('get', 'map').panTo(newPoint);
$('#map_canvas').gmap('refresh');
}
The creation of the new marker works fine, the Panning to the new point when the position is updated also works fine, just the marker doesn't change it's position
Any ideas ?
Thanks in advance