Polygon Script
Code: Select all
<script type="text/javascript">
if(VRS && VRS.globalDispatch && VRS.serverConfig) {
VRS.globalDispatch.hook(VRS.globalEvent.bootstrapCreated, function(bootStrap) {
// Hook the event that is raised after the page has finished initialising.
bootStrap.hookInitialised(function(pageSettings) {
// Check that there's a map on the page
if(pageSettings.mapPlugin) {
// Declare each point in the line that we're going to draw. Note that the
// last entry must not have a comma after it.
var outlineCoordinates = [
{lat: 47.9109, lng: 10.3095 },
{lat: 47.8363, lng: 10.4003 },
{lat: 47.9266, lng: 11.2339 },
{lat: 48.2382, lng: 11.1892 },
{lat: 48.3635, lng: 11.0000 },
{lat: 47.9109, lng: 10.3095 }
];
// Add the line to the map
pageSettings.mapPlugin.addPolygon('App', {
FillColor: '#808080'
path: outlineCoordinates
});
}
}, this);
});
}
</script>