The Golden Spot

I hope this helps someone who is learning about Linux and web application programming with Python, Django, and Javascript.

Tuesday, August 18, 2009

The GPolyline.fromEncoded documentation has been misleading for a while. Read this:

When using GPolyline.fromEncoded, I must name the encoded string "points:" even though the documentation says "latlngs:". following example code may help someone:

function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.42025942555, -122.0841121673), 17);

var plines = new GPolyline.fromEncoded({color:"3366FF", weight: 2, opacity: .5, points: "_|kcFbpchVfE`HQoElOT?gEyNCGuDwDzG", zoomFactor:2, levels:"pppppppp", numLevels:18});

Google Maps GPolyline.fromEncoded documentationLink