I'm using web2py on the server side to get google map position values:
window.setInterval(function() {
{{dic = get_position(1)}}
var newPos = new google.maps.LatLng({{=dic['ID1']['lat']}}, {{=dic['ID1']['lon']}});
markers[0].setPosition(newPos);
testcounter++;}, 4000);
I want to change the position of a marker (markers[0]
). The new position for marker is collected, but doesn't update its position on the map.
The data is collected from get_position()
into a python dictionary of dicts and the data is ok.The parameter is a record id for testing purposes.
The html generated code, is ok too:
window.setInterval(function() {
var newPos = new google.maps.LatLng(-20.21353, -70.14904);
markers[0].setPosition(newPos);
testcounter++;}, 4000);
With testcounter I'm only checking the 4 secs loop.