}, # end of feature
],
overlays => [
- { url => 'https://localhost/freeside/view/sector_overlay-png.html?102',
+ { url => 'https://localhost/freeside/view/sector_map-png.html?102',
west => -130.0,
east => -128.0,
south => 10.0,
};
var map;
-var overlays;
+var overlays = [];
function initMap() {
var canvas = $('#map_canvas');
map = new google.maps.Map(canvas[0], { zoom: 6 });
// construct bounds around all of the features
var bounds = new google.maps.LatLngBounds;
map.data.forEach(function(feature) {
- var g = feature.getGeometry();
- if (g.getType() == 'Point') {
- bounds.extend(g.get());
- } else if (g.getArray) {
- g.getArray().forEach(function(point) { bounds.extend(point); });
+ var b = feature.getProperty('bounds');
+ if (b) { // if it specifies an ROI, include all of it
+ bounds.union(b);
+ } else {
+ var g = feature.getGeometry();
+ if (g.getType() == 'Point') {
+ bounds.extend(g.get());
+ } else if (g.getArray) {
+ g.getArray().forEach(function(point) { bounds.extend(point); });
+ }
}
});
delete x.url;
var overlay = new google.maps.GroundOverlay( url, x );
overlay.setMap(map);
+ overlay.setOpacity(0.4);
overlays.push(overlay);
});
}