| 1 |
<html> |
| 2 |
<head> |
| 3 |
|
| 4 |
<link rel="stylesheet" type="text/css" |
| 5 |
href="../../../../dojo/resources/dojo.css" /> |
| 6 |
<link rel="stylesheet" type="text/css" |
| 7 |
href="../../../../dijit/themes/claro/claro.css" /> |
| 8 |
|
| 9 |
<script type="text/javascript"> |
| 10 |
var djConfig = { |
| 11 |
parseOnLoad : true |
| 12 |
}; |
| 13 |
</script> |
| 14 |
|
| 15 |
|
| 16 |
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script> |
| 17 |
|
| 18 |
|
| 19 |
<script |
| 20 |
src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3'></script> |
| 21 |
|
| 22 |
|
| 23 |
<script |
| 24 |
src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script> |
| 25 |
|
| 26 |
|
| 27 |
<script type="text/javascript" |
| 28 |
src="http://openlayers.org/api/2.10/OpenLayers.js"></script> |
| 29 |
<script type="text/javascript" src="../../../../dojo/dojo.js"></script> |
| 30 |
<script> |
| 31 |
require([ "dojo/ready", |
| 32 |
"dojo/_base/array", |
| 33 |
"dojo/_base/connect", |
| 34 |
"dojo/aspect", |
| 35 |
"dijit/registry", |
| 36 |
"dojo/_base/lang", |
| 37 |
"dojox/geo/openlayers/widget/Map", |
| 38 |
"dijit/layout/ContentPane", |
| 39 |
"dijit/layout/BorderContainer", |
| 40 |
"dojo/parser" ], |
| 41 |
function(ready, arr, connect, aspect, WidgetRegistry, lang, Map) { |
| 42 |
|
| 43 |
var maps = [ "osm", "google", "yahoo", "arcGis", "virtualEarth" ]; |
| 44 |
|
| 45 |
ready(function() { |
| 46 |
arr.forEach(maps, function(map) { |
| 47 |
var m = WidgetRegistry.byId(map); |
| 48 |
connect.connect(m.map.olMap, "setCenter", m, update); |
| 49 |
}); |
| 50 |
}); |
| 51 |
|
| 52 |
var _updating = false; |
| 53 |
|
| 54 |
function update(center, zoom, dragging, forceZoomChange) { |
| 55 |
if (dragging) |
| 56 |
return; |
| 57 |
if (_updating) |
| 58 |
return; |
| 59 |
|
| 60 |
var from = this.map.olMap.getProjectionObject(); |
| 61 |
var to = dojox.geo.openlayers.EPSG4326; |
| 62 |
var p = { |
| 63 |
x : center.lon, |
| 64 |
y : center.lat |
| 65 |
}; |
| 66 |
OpenLayers.Projection.transform(p, from, to); |
| 67 |
_updating = true; |
| 68 |
arr.forEach(maps, function(map) { |
| 69 |
var m = WidgetRegistry.byId(map); |
| 70 |
if (m != this) { |
| 71 |
from = dojox.geo.openlayers.EPSG4326; |
| 72 |
to = m.map.olMap.getProjectionObject(); |
| 73 |
var c = lang.mixin({}, p); |
| 74 |
OpenLayers.Projection.transform(c, from, to); |
| 75 |
m.map.olMap.setCenter(new OpenLayers.LonLat(c.x, c.y)); |
| 76 |
} |
| 77 |
}); |
| 78 |
_updating = false; |
| 79 |
} |
| 80 |
}); |
| 81 |
</script> |
| 82 |
|
| 83 |
<style type="text/css"> |
| 84 |
.olLayerGoogleCopyright { |
| 85 |
visibility: hidden; |
| 86 |
} |
| 87 |
</style> |
| 88 |
|
| 89 |
</head> |
| 90 |
<body class="claro"> |
| 91 |
<div data-dojo-type="dijit.layout.BorderContainer" design="headline" |
| 92 |
style="height: 100%; width: 100%;"> |
| 93 |
|
| 94 |
<div data-dojo-type="dijit.layout.ContentPane" region="top" |
| 95 |
style="height: 200px;" splitter="true"> |
| 96 |
<div data-dojo-type="dojox.geo.openlayers.widget.Map" baseLayerType="OSM" |
| 97 |
initialLocation="{ |
| 98 |
position : [7.154126, 43.651748], |
| 99 |
extent : 0.2 }" |
| 100 |
id="osm"></div> |
| 101 |
|
| 102 |
</div> |
| 103 |
|
| 104 |
<div data-dojo-type="dijit.layout.ContentPane" region="center"> |
| 105 |
<div data-dojo-type="dojox.geo.openlayers.widget.Map" |
| 106 |
baseLayerType="Google" |
| 107 |
initialLocation="{ |
| 108 |
position : [7.154126, 43.651748], |
| 109 |
extent : 0.2 }" |
| 110 |
id="google"></div> |
| 111 |
</div> |
| 112 |
|
| 113 |
<div data-dojo-type="dijit.layout.ContentPane" region="bottom" |
| 114 |
style="height: 200px;" splitter="true"> |
| 115 |
<div data-dojo-type="dojox.geo.openlayers.widget.Map" baseLayerType="Yahoo" |
| 116 |
initialLocation="{ |
| 117 |
position : [7.154126, 43.651748], |
| 118 |
extent : 0.2 }" |
| 119 |
id="yahoo"></div> |
| 120 |
</div> |
| 121 |
|
| 122 |
<div data-dojo-type="dijit.layout.ContentPane" region="left" |
| 123 |
style="width: 200px;" splitter="true"> |
| 124 |
<div data-dojo-type="dojox.geo.openlayers.widget.Map" |
| 125 |
baseLayerType="ArcGIS" |
| 126 |
initialLocation="{ |
| 127 |
position : [7.154126, 43.651748], |
| 128 |
extent : 0.2 }" |
| 129 |
id="arcGis"></div> |
| 130 |
</div> |
| 131 |
|
| 132 |
<div data-dojo-type="dijit.layout.ContentPane" region="right" |
| 133 |
style="width: 200px;" splitter="true"> |
| 134 |
<div data-dojo-type="dojox.geo.openlayers.widget.Map" |
| 135 |
baseLayerType="VirtualEarth" |
| 136 |
initialLocation="{ |
| 137 |
position : [7.154126, 43.651748], |
| 138 |
extent : 0.2 }" |
| 139 |
id="virtualEarth"></div> |
| 140 |
</div> |
| 141 |
|
| 142 |
</div> |
| 143 |
</body> |
| 144 |
</html> |
| 145 |
|