Pointfield With Geodjango, Javascript And Google Maps
I'm trying to display and plot a line from lattitude and longitude points stored in my database. Heres my code (I've removed some nonessential variables for brevity) Here is my mod
Solution 1:
You defined path
as an object:
var path = {};
It should be defined as an array:
var path = [];
Update: It seems that LatLng()
is called with one parameter only. It expects two numbers. )
is at wrong place.
path.push((new google.maps.LatLng({{ position.coordinates.x }}), {{ position.coordinates.y }}));
should be changed to
path.push(new google.maps.LatLng({{ position.coordinates.x }}, {{ position.coordinates.y }}));
See also example at jsbin.
Post a Comment for "Pointfield With Geodjango, Javascript And Google Maps"