Merge branch 'master' into clientzoom
This commit is contained in:
@@ -7,35 +7,37 @@
|
||||
<title>OpenLayers Bing Example</title>
|
||||
<link rel="stylesheet" href="../theme/default/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>
|
||||
|
||||
// API key for http://openlayers.org. Please get your own at
|
||||
// http://bingmapsportal.com/ and use that instead.
|
||||
var apiKey = "AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf";
|
||||
var map;
|
||||
|
||||
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);
|
||||
|
||||
|
||||
function init() {
|
||||
map = new OpenLayers.Map("map");
|
||||
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
|
||||
var shaded = new OpenLayers.Layer.VirtualEarth("Shaded", {
|
||||
type: VEMapStyle.Shaded
|
||||
var road = new OpenLayers.Layer.Bing({
|
||||
name: "Road",
|
||||
key: apiKey,
|
||||
type: "Road"
|
||||
});
|
||||
var hybrid = new OpenLayers.Layer.VirtualEarth("Hybrid", {
|
||||
type: VEMapStyle.Hybrid
|
||||
var hybrid = new OpenLayers.Layer.Bing({
|
||||
name: "Hybrid",
|
||||
key: apiKey,
|
||||
type: "AerialWithLabels"
|
||||
});
|
||||
var aerial = new OpenLayers.Layer.VirtualEarth("Aerial", {
|
||||
type: VEMapStyle.Aerial
|
||||
var aerial = new OpenLayers.Layer.Bing({
|
||||
name: "Aerial",
|
||||
key: apiKey,
|
||||
type: "Aerial"
|
||||
});
|
||||
|
||||
map.addLayers([shaded, hybrid, aerial]);
|
||||
map.addLayers([road, hybrid, aerial]);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(-110, 45), 3);
|
||||
}
|
||||
|
||||
@@ -22,13 +22,16 @@
|
||||
}
|
||||
</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://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
|
||||
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<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
|
||||
var map;
|
||||
|
||||
@@ -65,19 +68,19 @@ function init(){
|
||||
{type: G_HYBRID_MAP, sphericalMercator: true}
|
||||
);
|
||||
|
||||
// create Virtual Earth layers
|
||||
var veroad = new OpenLayers.Layer.VirtualEarth(
|
||||
"Virtual Earth Roads",
|
||||
{'type': VEMapStyle.Road, sphericalMercator: true}
|
||||
);
|
||||
var veaer = new OpenLayers.Layer.VirtualEarth(
|
||||
"Virtual Earth Aerial",
|
||||
{'type': VEMapStyle.Aerial, sphericalMercator: true}
|
||||
);
|
||||
var vehyb = new OpenLayers.Layer.VirtualEarth(
|
||||
"Virtual Earth Hybrid",
|
||||
{'type': VEMapStyle.Hybrid, sphericalMercator: true}
|
||||
);
|
||||
// create Bing layers
|
||||
var veroad = new OpenLayers.Layer.Bing({
|
||||
key: apiKey,
|
||||
type: "Road"
|
||||
});
|
||||
var veaer = new OpenLayers.Layer.Bing({
|
||||
key: apiKey,
|
||||
type: "Aerial"
|
||||
});
|
||||
var vehyb = new OpenLayers.Layer.Bing({
|
||||
key: apiKey,
|
||||
type: "AerialWithLabels"
|
||||
});
|
||||
|
||||
// create Yahoo layer
|
||||
var yahoo = new OpenLayers.Layer.Yahoo(
|
||||
|
||||
@@ -32,17 +32,6 @@
|
||||
map.addLayer(layer);
|
||||
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||
}
|
||||
|
||||
OpenLayers.Util.onImageLoadError = function() {
|
||||
/**
|
||||
* For images that don't exist in the cache, you can display
|
||||
* a default image - one that looks like water for example.
|
||||
* To show nothing at all, leave the following lines commented out.
|
||||
*/
|
||||
|
||||
//this.src = "../img/blank.gif";
|
||||
//this.style.display = "";
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
|
||||
Reference in New Issue
Block a user