Morescratch
30 Jan 2012, 5:16 PM
Hi all,
I am loading JSON data from a remote service and stuffing it into a store based on a really simple model. I am doing this after maprender is fired. In the load event of the store I am doing the following:
var paths = [];
for (var i = 0; i < h.data.geometry.coordinates.length; i++){
var path = [];
for (var j = 0; j < h.data.geometry.coordinates[i].length; j++){
var ll = new google.maps.LatLng(
h.data.geometry.coordinates[i][j][1], h.data.geometry.coordinates[i][j][0]);
path.push(ll)
}
paths.push(path);
}
polygon = new google.maps.Polygon({
path: paths,
title : h.data.title,
map: map
});
var infowindow = new google.maps.InfoWindow({
content: "Insert content here..."
});
google.maps.event.addListener(polygon, 'mousedown', function() {
infowindow.open(map, polygon);
});
The infowindow does not show when I click on the polygon. I tried the 'click' event too. Any ideas?
Thanks!
I am loading JSON data from a remote service and stuffing it into a store based on a really simple model. I am doing this after maprender is fired. In the load event of the store I am doing the following:
var paths = [];
for (var i = 0; i < h.data.geometry.coordinates.length; i++){
var path = [];
for (var j = 0; j < h.data.geometry.coordinates[i].length; j++){
var ll = new google.maps.LatLng(
h.data.geometry.coordinates[i][j][1], h.data.geometry.coordinates[i][j][0]);
path.push(ll)
}
paths.push(path);
}
polygon = new google.maps.Polygon({
path: paths,
title : h.data.title,
map: map
});
var infowindow = new google.maps.InfoWindow({
content: "Insert content here..."
});
google.maps.event.addListener(polygon, 'mousedown', function() {
infowindow.open(map, polygon);
});
The infowindow does not show when I click on the polygon. I tried the 'click' event too. Any ideas?
Thanks!