replace VirtualEarth layers with Bing in examples. No functional change.
This commit is contained in:
@@ -7,35 +7,37 @@
|
|||||||
<title>OpenLayers Bing Example</title>
|
<title>OpenLayers Bing Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<script src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us"></script>
|
|
||||||
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
// API key for http://openlayers.org. Please get your own at
|
||||||
|
// http://bingmapsportal.com/ and use that instead.
|
||||||
|
var apiKey = "AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf";
|
||||||
var map;
|
var map;
|
||||||
|
|
||||||
function init(){
|
function init() {
|
||||||
// setting restrictedExtent so that we can use the
|
|
||||||
// VirtualEarth-layers, see e.g.
|
|
||||||
// http://dev.openlayers.org/apidocs/files/OpenLayers/Layer/VirtualEarth-js.html
|
|
||||||
var restrictedExtent = new OpenLayers.Bounds(-180, -90,
|
|
||||||
180, 90);
|
|
||||||
|
|
||||||
map = new OpenLayers.Map("map");
|
map = new OpenLayers.Map("map");
|
||||||
|
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
|
|
||||||
var shaded = new OpenLayers.Layer.VirtualEarth("Shaded", {
|
var road = new OpenLayers.Layer.Bing({
|
||||||
type: VEMapStyle.Shaded
|
name: "Road",
|
||||||
|
key: apiKey,
|
||||||
|
type: "Road"
|
||||||
});
|
});
|
||||||
var hybrid = new OpenLayers.Layer.VirtualEarth("Hybrid", {
|
var hybrid = new OpenLayers.Layer.Bing({
|
||||||
type: VEMapStyle.Hybrid
|
name: "Hybrid",
|
||||||
|
key: apiKey,
|
||||||
|
type: "AerialWithLabels"
|
||||||
});
|
});
|
||||||
var aerial = new OpenLayers.Layer.VirtualEarth("Aerial", {
|
var aerial = new OpenLayers.Layer.Bing({
|
||||||
type: VEMapStyle.Aerial
|
name: "Aerial",
|
||||||
|
key: apiKey,
|
||||||
|
type: "Aerial"
|
||||||
});
|
});
|
||||||
|
|
||||||
map.addLayers([shaded, hybrid, aerial]);
|
map.addLayers([road, hybrid, aerial]);
|
||||||
|
|
||||||
map.setCenter(new OpenLayers.LonLat(-110, 45), 3);
|
map.setCenter(new OpenLayers.LonLat(-110, 45), 3);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,13 +22,16 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>
|
|
||||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
||||||
<script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
|
<script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
|
||||||
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
// API key for http://openlayers.org. Please get your own at
|
||||||
|
// http://bingmapsportal.com/ and use that instead.
|
||||||
|
var apiKey = "AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf";
|
||||||
|
|
||||||
// make map available for easy debugging
|
// make map available for easy debugging
|
||||||
var map;
|
var map;
|
||||||
|
|
||||||
@@ -65,19 +68,19 @@ function init(){
|
|||||||
{type: G_HYBRID_MAP, sphericalMercator: true}
|
{type: G_HYBRID_MAP, sphericalMercator: true}
|
||||||
);
|
);
|
||||||
|
|
||||||
// create Virtual Earth layers
|
// create Bing layers
|
||||||
var veroad = new OpenLayers.Layer.VirtualEarth(
|
var veroad = new OpenLayers.Layer.Bing({
|
||||||
"Virtual Earth Roads",
|
key: apiKey,
|
||||||
{'type': VEMapStyle.Road, sphericalMercator: true}
|
type: "Road"
|
||||||
);
|
});
|
||||||
var veaer = new OpenLayers.Layer.VirtualEarth(
|
var veaer = new OpenLayers.Layer.Bing({
|
||||||
"Virtual Earth Aerial",
|
key: apiKey,
|
||||||
{'type': VEMapStyle.Aerial, sphericalMercator: true}
|
type: "Aerial"
|
||||||
);
|
});
|
||||||
var vehyb = new OpenLayers.Layer.VirtualEarth(
|
var vehyb = new OpenLayers.Layer.Bing({
|
||||||
"Virtual Earth Hybrid",
|
key: apiKey,
|
||||||
{'type': VEMapStyle.Hybrid, sphericalMercator: true}
|
type: "AerialWithLabels"
|
||||||
);
|
});
|
||||||
|
|
||||||
// create Yahoo layer
|
// create Yahoo layer
|
||||||
var yahoo = new OpenLayers.Layer.Yahoo(
|
var yahoo = new OpenLayers.Layer.Yahoo(
|
||||||
|
|||||||
Reference in New Issue
Block a user