<%args>
@features
+@overlays
</%args>
<%doc>
Generic Google Maps front end.
}
}, # end of feature
],
+ overlays => [
+ { url => 'https://localhost/freeside/view/sector_map-png.html?102',
+ west => -130.0,
+ east => -128.0,
+ south => 10.0,
+ north => 12.0,
+ }, # make a ground overlay
+ ],
&>
</%doc>
<script type="text/javascript">
var data_geojson = <% encode_json($tree) %>;
+var data_overlays = <% encode_json(\@overlays) %>;
var baseStyle = {
clickable: true,
};
var map;
+var overlays = [];
function initMap() {
var canvas = $('#map_canvas');
map = new google.maps.Map(canvas[0], { zoom: 6 });
}
}); // addListener()
+
+ data_overlays.forEach(function(x) {
+ var url = x.url;
+ delete x.url;
+ var overlay = new google.maps.GroundOverlay( url, x );
+ overlay.setMap(map);
+ overlay.setOpacity(0.4);
+ overlays.push(overlay);
+ });
}
$().ready( initMap );