source: ether_iasi/trunk/web/resources/js/OpenLayers-2.12/examples/bing-tiles.js @ 738

Last change on this file since 738 was 738, checked in by vmipsl, 11 years ago

OpenLayers?

File size: 906 bytes
Line 
1// API key for http://openlayers.org. Please get your own at
2// http://bingmapsportal.com/ and use that instead.
3var apiKey = "AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf";
4
5var map = new OpenLayers.Map( 'map');
6
7var road = new OpenLayers.Layer.Bing({
8    key: apiKey,
9    type: "Road",
10    // custom metadata parameter to request the new map style - only useful
11    // before May 1st, 2011
12    metadataParams: {mapVersion: "v1"}
13});
14var aerial = new OpenLayers.Layer.Bing({
15    key: apiKey,
16    type: "Aerial"
17});
18var hybrid = new OpenLayers.Layer.Bing({
19    key: apiKey,
20    type: "AerialWithLabels",
21    name: "Bing Aerial With Labels"
22});
23
24map.addLayers([road, aerial, hybrid]);
25map.addControl(new OpenLayers.Control.LayerSwitcher());
26map.setCenter(new OpenLayers.LonLat(-71.147, 42.472).transform(
27    new OpenLayers.Projection("EPSG:4326"),
28    map.getProjectionObject()
29), 11);
Note: See TracBrowser for help on using the repository browser.