This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an EntityCollection object for collecting pushpins and make them visible on the map | |
var pushpinsLayer = new Microsoft.Maps.EntityCollection({ | |
visible: true, | |
zIndex: 2 | |
}); | |
// add some pushpins to the collection | |
pushpinsLayer.push(pushpin1); | |
pushpinsLayer.push(pushpin2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The range of values for opacity is 0-1.0 | |
var mouseoverPolyOptions = { | |
fillColor: '#00f', | |
fillOpacity: 0.4, | |
color: '#00f', | |
opacity: 0.4, | |
weight: 2 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The range of values for alpha, red, green and blue is 0-255. | |
var mouseoverPolyOptions = { | |
fillColor: new Microsoft.Maps.Color(100, 0, 0, 255), | |
strokeColor: new Microsoft.Maps.Color(100, 0, 0, 255), | |
strokeThickness: 2 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the locations | |
var location1 = L.latLng(20,-20); | |
var location2 = L.latLng(20,20); | |
var location3 = L.latLng(-20,20); | |
var location4 = L.latLng(-20,-20); | |
// Create an array of locations. Notice the last one in the locations array is NOT the same as the first one, as this is not required in Mapbox API | |
var vertices = new Array(location1, location2, location3, location4); | |
// Create a PolylineOptions object that has some color value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the locations | |
var location1 = new Microsoft.Maps.Location(20,-20); | |
var location2 = new Microsoft.Maps.Location(20,20); | |
var location3 = new Microsoft.Maps.Location(-20,20); | |
var location4 = new Microsoft.Maps.Location(-20,-20); | |
// Create an array of locations. Notice the last one in the locations array is the same as the first one | |
var vertices = new Array(location1, location2, location3, location4, location1); | |
// Create a Color object for use in PolygonOptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var popup = L.popup() | |
.setLatLng(latlng) | |
.setContent('<p>Hello world!<br />This is a nice popup.</p>') | |
.openOn(map); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pinInfobox = new Microsoft.Maps.Infobox(pinLocation, { | |
title: 'My Pushpin', | |
visible: true | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pushpin = L.marker(location, { | |
icon: L.icon({ | |
iconUrl: pushpinIcon, | |
iconSize: [20, 34], | |
popupAnchor: [0, -30] | |
}), | |
zIndexOffset: 1 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pushpin = new Microsoft.Maps.Pushpin(location, { | |
icon: pushpinIcon, | |
height: 34, | |
width: 20, | |
anchor: new Microsoft.Maps.Point(10, 34), | |
zIndex: 1 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var point = L.point(x, y); |