mapstraction-rails 2.0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +4 -0
- data/Gemfile.lock +14 -0
- data/LICENSE +22 -0
- data/README.md +32 -0
- data/Rakefile +2 -0
- data/lib/mapstraction/engine.rb +4 -0
- data/lib/mapstraction/version.rb +3 -0
- data/lib/mapstraction.rb +5 -0
- data/mapstraction/.gitignore +17 -0
- data/mapstraction.gemspec +17 -0
- data/vendor/.DS_Store +0 -0
- data/vendor/assets/.DS_Store +0 -0
- data/vendor/assets/javascripts/mxn-min.js +15 -0
- data/vendor/assets/javascripts/mxn.cartociudad.geocoder-min.js +15 -0
- data/vendor/assets/javascripts/mxn.cartociudad.geocoder.js +46 -0
- data/vendor/assets/javascripts/mxn.cloudmade.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.cloudmade.core.js +383 -0
- data/vendor/assets/javascripts/mxn.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.core.js +1892 -0
- data/vendor/assets/javascripts/mxn.geocoder-min.js +15 -0
- data/vendor/assets/javascripts/mxn.geocoder.js +74 -0
- data/vendor/assets/javascripts/mxn.geocommons.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.geocommons.core.js +343 -0
- data/vendor/assets/javascripts/mxn.google.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.google.core.js +536 -0
- data/vendor/assets/javascripts/mxn.google.geocoder-min.js +15 -0
- data/vendor/assets/javascripts/mxn.google.geocoder.js +87 -0
- data/vendor/assets/javascripts/mxn.googleearth.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.googleearth.core.js +350 -0
- data/vendor/assets/javascripts/mxn.googlev3.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.googlev3.core.js +630 -0
- data/vendor/assets/javascripts/mxn.googlev3.geocoder-min.js +15 -0
- data/vendor/assets/javascripts/mxn.googlev3.geocoder.js +101 -0
- data/vendor/assets/javascripts/mxn.js +581 -0
- data/vendor/assets/javascripts/mxn.leaflet.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.leaflet.core.js +398 -0
- data/vendor/assets/javascripts/mxn.mapquest.geocoder-min.js +15 -0
- data/vendor/assets/javascripts/mxn.mapquest.geocoder.js +63 -0
- data/vendor/assets/javascripts/mxn.microsoft.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.microsoft.core.js +429 -0
- data/vendor/assets/javascripts/mxn.microsoft7.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.microsoft7.core.js +458 -0
- data/vendor/assets/javascripts/mxn.microsoft7.geocoder-min.js +15 -0
- data/vendor/assets/javascripts/mxn.microsoft7.geocoder.js +66 -0
- data/vendor/assets/javascripts/mxn.multimap.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.multimap.core.js +473 -0
- data/vendor/assets/javascripts/mxn.openlayers.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.openlayers.core.js +630 -0
- data/vendor/assets/javascripts/mxn.openlayers.geocoder-min.js +15 -0
- data/vendor/assets/javascripts/mxn.openlayers.geocoder.js +106 -0
- data/vendor/assets/javascripts/mxn.openmq.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.openmq.core.js +364 -0
- data/vendor/assets/javascripts/mxn.openspace.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.openspace.core.js +460 -0
- data/vendor/assets/javascripts/mxn.ovi.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.ovi.core.js +508 -0
- data/vendor/assets/javascripts/mxn.ovi.geocoder-min.js +15 -0
- data/vendor/assets/javascripts/mxn.ovi.geocoder.js +129 -0
- data/vendor/assets/javascripts/mxn.yahoo.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.yahoo.core.js +406 -0
- data/vendor/assets/javascripts/mxn.yandex.core-min.js +15 -0
- data/vendor/assets/javascripts/mxn.yandex.core.js +527 -0
- data/vendor/assets/javascripts/mxn.yandex.geocoder-min.js +15 -0
- data/vendor/assets/javascripts/mxn.yandex.geocoder.js +66 -0
- metadata +110 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
MAPSTRACTION v2.0.18 http://www.mapstraction.com
|
3
|
+
|
4
|
+
Copyright (c) 2012 Tom Carden, Steve Coast, Mikel Maron, Andrew Turner, Henri Bergius, Rob Moran, Derek Fowler, Gary Gale
|
5
|
+
All rights reserved.
|
6
|
+
|
7
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
11
|
+
* Neither the name of the Mapstraction nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
12
|
+
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
14
|
+
*/
|
15
|
+
mxn.register("leaflet",{Mapstraction:{init:function(a,b){if(typeof(L)!="undefined"){var c=this;var d=new L.Map(a.id,{zoomControl:false});d.addEventListener("moveend",function(){c.endPan.fire()});d.on("click",function(f){c.click.fire({location:new mxn.LatLonPoint(f.latlng.lat,f.latlng.lng)})});d.on("popupopen",function(f){if(f.popup._source.mxnMarker){f.popup._source.mxnMarker.openInfoBubble.fire({bubbleContainer:f.popup._container})}});d.on("popupclose",function(f){if(f.popup._source.mxnMarker){f.popup._source.mxnMarker.closeInfoBubble.fire({bubbleContainer:f.popup._container})}});this.layers={};this.features=[];this.maps[b]=d;this.setMapType();this.currentMapType=mxn.Mapstraction.ROAD;this.loaded[b]=true}else{alert(b+" map script not imported")}},applyOptions:function(){if(this.options.enableScrollWheelZoom){this.maps[this.api].scrollWheelZoom.enable()}else{this.maps[this.api].scrollWheelZoom.disable()}return},resizeTo:function(b,a){this.currentElement.style.width=b;this.currentElement.style.height=a},addControls:function(b){var d=this.maps[this.api];if(b.zoom){var c=new L.Control.Zoom();d.addControl(c)}if(b.map_type){var a=new L.Control.Layers(this.layers,this.features);d.addControl(a)}},addSmallControls:function(){this.addControls({zoom:true,map_type:true})},addLargeControls:function(){throw"Not implemented"},addMapTypeControls:function(){throw"Not implemented"},setCenterAndZoom:function(a,b){var d=this.maps[this.api];var c=a.toProprietary(this.api);d.setView(c,b)},addMarker:function(b,a){var d=this.maps[this.api];var c=b.toProprietary(this.api);d.addLayer(c);this.features.push(c);return c},removeMarker:function(a){var b=this.maps[this.api];b.removeLayer(a.proprietary_marker)},declutterMarkers:function(a){throw"Not implemented"},addPolyline:function(b,a){var c=this.maps[this.api];b=b.toProprietary(this.api);c.addLayer(b);this.features.push(b);return b},removePolyline:function(a){var b=this.maps[this.api];b.removeLayer(a.proprietary_polyline)},getCenter:function(){var b=this.maps[this.api];var a=b.getCenter();return new mxn.LatLonPoint(a.lat,a.lng)},setCenter:function(a,b){var d=this.maps[this.api];var c=a.toProprietary(this.api);if(b&&b.pan){d.panTo(c)}else{d.setView(c,d.getZoom(),true)}},setZoom:function(a){var b=this.maps[this.api];b.setZoom(a)},getZoom:function(){var a=this.maps[this.api];return a.getZoom()},getZoomLevelForBoundingBox:function(c){var b=this.maps[this.api];var a=new L.LatLngBounds(c.getSouthWest().toProprietary(this.api),c.getNorthEast().toProprietary(this.api));return b.getBoundsZoom(a)},setMapType:function(a){switch(a){case mxn.Mapstraction.ROAD:this.addTileLayer("http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png",{name:"Roads",attribution:'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',subdomains:[1,2,3,4]});this.currentMapType=mxn.Mapstraction.ROAD;break;case mxn.Mapstraction.SATELLITE:this.addTileLayer("http://oatile{s}.mqcdn.com/naip/{z}/{x}/{y}.jpg",{name:"Satellite",attribution:'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',subdomains:[1,2,3,4]});this.currentMapType=mxn.Mapstraction.SATELLITE;break;case mxn.Mapstraction.HYBRID:throw"Not implemented";default:this.addTileLayer("http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png",{name:"Roads",attribution:'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',subdomains:[1,2,3,4]});this.currentMapType=mxn.Mapstraction.ROAD}},getMapType:function(){return this.currentMapType},getBounds:function(){var d=this.maps[this.api];var b=d.getBounds();var a=b.getSouthWest();var c=b.getNorthEast();return new mxn.BoundingBox(a.lat,a.lng,c.lat,c.lng)},setBounds:function(b){var e=this.maps[this.api];var a=b.getSouthWest().toProprietary(this.api);var d=b.getNorthEast().toProprietary(this.api);var c=new L.LatLngBounds(a,d);e.fitBounds(c)},addImageOverlay:function(g,f,b,a,d,c,e){throw"Not implemented"},setImagePosition:function(b,a){throw"Not implemented"},addOverlay:function(a,b){throw"Not implemented"},addTileLayer:function(d,b){var a;if(b&&b.name){a=b.name;delete b.name}else{a="Tiles"}this.layers[a]=new L.TileLayer(d,b||{});var c=this.maps[this.api];c.addLayer(this.layers[a])},toggleTileLayer:function(a){throw"Not implemented"},getPixelRatio:function(){throw"Not implemented"},mousePosition:function(a){throw"Not implemented"},openBubble:function(a,d){var e=this.maps[this.api];var c=a.toProprietary(this.api);var b=new L.Marker(c);b.bindPopup(d);e.addLayer(b);b.openPopup()},closeBubble:function(){var a=this.maps[this.api];a.closePopup()}},LatLonPoint:{toProprietary:function(){return new L.LatLng(this.lat,this.lon)},fromProprietary:function(a){this.lat=a.lat();this.lon=a.lng()}},Marker:{toProprietary:function(){var d=this;var c=L.Icon;if(d.iconUrl){c=c.extend({iconUrl:d.iconUrl})}if(d.iconSize){c=c.extend({iconSize:new L.Point(d.iconSize[0],d.iconSize[1])})}if(d.iconAnchor){c=c.extend({iconAnchor:new L.Point(d.iconAnchor[0],d.iconAnchor[1])})}if(d.iconShadowUrl){c=c.extend({shadowUrl:d.iconShadowUrl})}if(d.iconShadowSize){c=c.extend({shadowSize:new L.Point(d.iconShadowSize[0],d.iconShadowSize[1])})}var a=new c();var b=new L.Marker(this.location.toProprietary("leaflet"),{icon:a});(function(f,e){e.on("click",function(g){f.click.fire()})})(d,b);return b},openBubble:function(){var a=this.proprietary_marker;if(this.infoBubble){a.mxnMarker=this;a.bindPopup(this.infoBubble);a.openPopup()}},closeBubble:function(){var a=this.proprietary_marker;a.closePopup()},hide:function(){var a=this.mapstraction.maps[this.api];a.removeLayer(this.proprietary_marker)},show:function(){var a=this.mapstraction.maps[this.api];a.addLayer(this.proprietary_marker)},isHidden:function(){var a=this.mapstraction.maps[this.api];if(a.hasLayer(this.proprietary_marker)){return false}else{return true}},update:function(){throw"Not implemented"}},Polyline:{toProprietary:function(){var c=[];for(var b=0,d=this.points.length;b<d;b++){c.push(this.points[b].toProprietary("leaflet"))}var a={color:this.color||"#000000",opacity:this.opacity||1,weight:this.width||3,fillColor:this.fillColor||"#000000"};if(this.closed){return new L.Polygon(c,a)}else{return new L.Polyline(c,a)}},show:function(){this.map.addLayer(this.proprietary_polyline)},hide:function(){this.map.removeLayer(this.proprietary_polyline)},isHidden:function(){if(this.map.hasLayer(this.proprietary_polyline)){return false}else{return true}}}});
|
@@ -0,0 +1,398 @@
|
|
1
|
+
/*
|
2
|
+
MAPSTRACTION v2.0.18 http://www.mapstraction.com
|
3
|
+
|
4
|
+
Copyright (c) 2012 Tom Carden, Steve Coast, Mikel Maron, Andrew Turner, Henri Bergius, Rob Moran, Derek Fowler, Gary Gale
|
5
|
+
All rights reserved.
|
6
|
+
|
7
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
11
|
+
* Neither the name of the Mapstraction nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
12
|
+
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
14
|
+
*/
|
15
|
+
mxn.register('leaflet', {
|
16
|
+
|
17
|
+
Mapstraction: {
|
18
|
+
|
19
|
+
init: function(element, api) {
|
20
|
+
if (typeof(L) != 'undefined') {
|
21
|
+
var me = this;
|
22
|
+
var map = new L.Map(element.id, {
|
23
|
+
zoomControl: false
|
24
|
+
});
|
25
|
+
map.addEventListener('moveend', function(){
|
26
|
+
me.endPan.fire();
|
27
|
+
});
|
28
|
+
map.on("click", function(e) {
|
29
|
+
me.click.fire({'location': new mxn.LatLonPoint(e.latlng.lat, e.latlng.lng)});
|
30
|
+
});
|
31
|
+
map.on("popupopen", function(e) {
|
32
|
+
if (e.popup._source.mxnMarker) {
|
33
|
+
e.popup._source.mxnMarker.openInfoBubble.fire({'bubbleContainer': e.popup._container});
|
34
|
+
}
|
35
|
+
});
|
36
|
+
map.on("popupclose", function(e) {
|
37
|
+
if (e.popup._source.mxnMarker) {
|
38
|
+
e.popup._source.mxnMarker.closeInfoBubble.fire({'bubbleContainer': e.popup._container});
|
39
|
+
}
|
40
|
+
});
|
41
|
+
this.layers = {};
|
42
|
+
this.features = [];
|
43
|
+
this.maps[api] = map;
|
44
|
+
this.setMapType();
|
45
|
+
this.currentMapType = mxn.Mapstraction.ROAD;
|
46
|
+
this.loaded[api] = true;
|
47
|
+
} else {
|
48
|
+
alert(api + ' map script not imported');
|
49
|
+
}
|
50
|
+
},
|
51
|
+
|
52
|
+
applyOptions: function(){
|
53
|
+
if (this.options.enableScrollWheelZoom) {
|
54
|
+
this.maps[this.api].scrollWheelZoom.enable();
|
55
|
+
} else {
|
56
|
+
this.maps[this.api].scrollWheelZoom.disable();
|
57
|
+
}
|
58
|
+
return;
|
59
|
+
},
|
60
|
+
|
61
|
+
resizeTo: function(width, height){
|
62
|
+
this.currentElement.style.width = width;
|
63
|
+
this.currentElement.style.height = height;
|
64
|
+
},
|
65
|
+
|
66
|
+
addControls: function(args) {
|
67
|
+
var map = this.maps[this.api];
|
68
|
+
if (args.zoom) {
|
69
|
+
var zoom = new L.Control.Zoom();
|
70
|
+
map.addControl(zoom);
|
71
|
+
}
|
72
|
+
if (args.map_type) {
|
73
|
+
var layersControl = new L.Control.Layers(this.layers, this.features);
|
74
|
+
map.addControl(layersControl);
|
75
|
+
}
|
76
|
+
},
|
77
|
+
|
78
|
+
addSmallControls: function() {
|
79
|
+
this.addControls({zoom: true, map_type: true});
|
80
|
+
},
|
81
|
+
|
82
|
+
addLargeControls: function() {
|
83
|
+
throw 'Not implemented';
|
84
|
+
},
|
85
|
+
|
86
|
+
addMapTypeControls: function() {
|
87
|
+
throw 'Not implemented';
|
88
|
+
},
|
89
|
+
|
90
|
+
setCenterAndZoom: function(point, zoom) {
|
91
|
+
var map = this.maps[this.api];
|
92
|
+
var pt = point.toProprietary(this.api);
|
93
|
+
map.setView(pt, zoom);
|
94
|
+
},
|
95
|
+
|
96
|
+
addMarker: function(marker, old) {
|
97
|
+
var map = this.maps[this.api];
|
98
|
+
var pin = marker.toProprietary(this.api);
|
99
|
+
map.addLayer(pin);
|
100
|
+
this.features.push(pin);
|
101
|
+
return pin;
|
102
|
+
},
|
103
|
+
|
104
|
+
removeMarker: function(marker) {
|
105
|
+
var map = this.maps[this.api];
|
106
|
+
map.removeLayer(marker.proprietary_marker);
|
107
|
+
},
|
108
|
+
|
109
|
+
declutterMarkers: function(opts) {
|
110
|
+
throw 'Not implemented';
|
111
|
+
},
|
112
|
+
|
113
|
+
addPolyline: function(polyline, old) {
|
114
|
+
var map = this.maps[this.api];
|
115
|
+
polyline = polyline.toProprietary(this.api);
|
116
|
+
map.addLayer(polyline);
|
117
|
+
this.features.push(polyline);
|
118
|
+
return polyline;
|
119
|
+
},
|
120
|
+
|
121
|
+
removePolyline: function(polyline) {
|
122
|
+
var map = this.maps[this.api];
|
123
|
+
map.removeLayer(polyline.proprietary_polyline);
|
124
|
+
},
|
125
|
+
|
126
|
+
getCenter: function() {
|
127
|
+
var map = this.maps[this.api];
|
128
|
+
var pt = map.getCenter();
|
129
|
+
return new mxn.LatLonPoint(pt.lat, pt.lng);
|
130
|
+
},
|
131
|
+
|
132
|
+
setCenter: function(point, options) {
|
133
|
+
var map = this.maps[this.api];
|
134
|
+
var pt = point.toProprietary(this.api);
|
135
|
+
if (options && options.pan) {
|
136
|
+
map.panTo(pt);
|
137
|
+
}
|
138
|
+
else {
|
139
|
+
map.setView(pt, map.getZoom(), true);
|
140
|
+
}
|
141
|
+
},
|
142
|
+
|
143
|
+
setZoom: function(zoom) {
|
144
|
+
var map = this.maps[this.api];
|
145
|
+
map.setZoom(zoom);
|
146
|
+
},
|
147
|
+
|
148
|
+
getZoom: function() {
|
149
|
+
var map = this.maps[this.api];
|
150
|
+
return map.getZoom();
|
151
|
+
},
|
152
|
+
|
153
|
+
getZoomLevelForBoundingBox: function(bbox) {
|
154
|
+
var map = this.maps[this.api];
|
155
|
+
var bounds = new L.LatLngBounds(
|
156
|
+
bbox.getSouthWest().toProprietary(this.api),
|
157
|
+
bbox.getNorthEast().toProprietary(this.api));
|
158
|
+
return map.getBoundsZoom(bounds);
|
159
|
+
},
|
160
|
+
|
161
|
+
setMapType: function(type) {
|
162
|
+
switch(type) {
|
163
|
+
case mxn.Mapstraction.ROAD:
|
164
|
+
this.addTileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png', {
|
165
|
+
name: "Roads",
|
166
|
+
attribution: 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',
|
167
|
+
subdomains: [1,2,3,4]
|
168
|
+
});
|
169
|
+
this.currentMapType = mxn.Mapstraction.ROAD;
|
170
|
+
break;
|
171
|
+
case mxn.Mapstraction.SATELLITE:
|
172
|
+
this.addTileLayer('http://oatile{s}.mqcdn.com/naip/{z}/{x}/{y}.jpg', {
|
173
|
+
name: "Satellite",
|
174
|
+
attribution: 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',
|
175
|
+
subdomains: [1,2,3,4]
|
176
|
+
});
|
177
|
+
this.currentMapType = mxn.Mapstraction.SATELLITE;
|
178
|
+
break;
|
179
|
+
case mxn.Mapstraction.HYBRID:
|
180
|
+
throw 'Not implemented';
|
181
|
+
default:
|
182
|
+
this.addTileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png', {
|
183
|
+
name: "Roads",
|
184
|
+
attribution: 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',
|
185
|
+
subdomains: [1,2,3,4]
|
186
|
+
});
|
187
|
+
this.currentMapType = mxn.Mapstraction.ROAD;
|
188
|
+
}
|
189
|
+
},
|
190
|
+
|
191
|
+
getMapType: function() {
|
192
|
+
return this.currentMapType;
|
193
|
+
},
|
194
|
+
|
195
|
+
getBounds: function () {
|
196
|
+
var map = this.maps[this.api];
|
197
|
+
var box = map.getBounds();
|
198
|
+
var sw = box.getSouthWest();
|
199
|
+
var ne = box.getNorthEast();
|
200
|
+
return new mxn.BoundingBox(sw.lat, sw.lng, ne.lat, ne.lng);
|
201
|
+
},
|
202
|
+
|
203
|
+
setBounds: function(bounds){
|
204
|
+
var map = this.maps[this.api];
|
205
|
+
var sw = bounds.getSouthWest().toProprietary(this.api);
|
206
|
+
var ne = bounds.getNorthEast().toProprietary(this.api);
|
207
|
+
var newBounds = new L.LatLngBounds(sw, ne);
|
208
|
+
map.fitBounds(newBounds);
|
209
|
+
},
|
210
|
+
|
211
|
+
addImageOverlay: function(id, src, opacity, west, south, east, north) {
|
212
|
+
throw 'Not implemented';
|
213
|
+
},
|
214
|
+
|
215
|
+
setImagePosition: function(id, oContext) {
|
216
|
+
throw 'Not implemented';
|
217
|
+
},
|
218
|
+
|
219
|
+
addOverlay: function(url, autoCenterAndZoom) {
|
220
|
+
throw 'Not implemented';
|
221
|
+
},
|
222
|
+
|
223
|
+
addTileLayer: function(tile_url, options) {
|
224
|
+
var layerName;
|
225
|
+
if (options && options.name) {
|
226
|
+
layerName = options.name;
|
227
|
+
delete options.name;
|
228
|
+
} else {
|
229
|
+
layerName = 'Tiles';
|
230
|
+
}
|
231
|
+
this.layers[layerName] = new L.TileLayer(tile_url, options || {});
|
232
|
+
var map = this.maps[this.api];
|
233
|
+
map.addLayer(this.layers[layerName]);
|
234
|
+
},
|
235
|
+
|
236
|
+
toggleTileLayer: function(tile_url) {
|
237
|
+
throw 'Not implemented';
|
238
|
+
},
|
239
|
+
|
240
|
+
getPixelRatio: function() {
|
241
|
+
throw 'Not implemented';
|
242
|
+
},
|
243
|
+
|
244
|
+
mousePosition: function(element) {
|
245
|
+
throw 'Not implemented';
|
246
|
+
},
|
247
|
+
|
248
|
+
openBubble: function(point, content) {
|
249
|
+
var map = this.maps[this.api];
|
250
|
+
var newPoint = point.toProprietary(this.api);
|
251
|
+
var marker = new L.Marker(newPoint);
|
252
|
+
marker.bindPopup(content);
|
253
|
+
map.addLayer(marker);
|
254
|
+
marker.openPopup();
|
255
|
+
},
|
256
|
+
|
257
|
+
closeBubble: function() {
|
258
|
+
var map = this.maps[this.api];
|
259
|
+
map.closePopup();
|
260
|
+
}
|
261
|
+
},
|
262
|
+
|
263
|
+
LatLonPoint: {
|
264
|
+
|
265
|
+
toProprietary: function() {
|
266
|
+
return new L.LatLng(this.lat,this.lon);
|
267
|
+
},
|
268
|
+
|
269
|
+
fromProprietary: function(point) {
|
270
|
+
this.lat = point.lat();
|
271
|
+
this.lon = point.lng();
|
272
|
+
}
|
273
|
+
|
274
|
+
},
|
275
|
+
|
276
|
+
Marker: {
|
277
|
+
|
278
|
+
toProprietary: function() {
|
279
|
+
var me = this;
|
280
|
+
var thisIcon = L.Icon;
|
281
|
+
if (me.iconUrl) {
|
282
|
+
thisIcon = thisIcon.extend({
|
283
|
+
iconUrl: me.iconUrl
|
284
|
+
});
|
285
|
+
}
|
286
|
+
if (me.iconSize) {
|
287
|
+
thisIcon = thisIcon.extend({
|
288
|
+
iconSize: new L.Point(me.iconSize[0], me.iconSize[1])
|
289
|
+
});
|
290
|
+
}
|
291
|
+
if (me.iconAnchor) {
|
292
|
+
thisIcon = thisIcon.extend({
|
293
|
+
iconAnchor: new L.Point(me.iconAnchor[0], me.iconAnchor[1])
|
294
|
+
});
|
295
|
+
}
|
296
|
+
if (me.iconShadowUrl) {
|
297
|
+
thisIcon = thisIcon.extend({
|
298
|
+
shadowUrl: me.iconShadowUrl
|
299
|
+
});
|
300
|
+
}
|
301
|
+
if (me.iconShadowSize) {
|
302
|
+
thisIcon = thisIcon.extend({
|
303
|
+
shadowSize: new L.Point(me.iconShadowSize[0], me.iconShadowSize[1])
|
304
|
+
});
|
305
|
+
}
|
306
|
+
var iconObj = new thisIcon();
|
307
|
+
var marker = new L.Marker(
|
308
|
+
this.location.toProprietary('leaflet'),
|
309
|
+
{ icon: iconObj }
|
310
|
+
);
|
311
|
+
(function(me, marker) {
|
312
|
+
marker.on("click", function (e) {
|
313
|
+
me.click.fire();
|
314
|
+
});
|
315
|
+
})(me, marker);
|
316
|
+
return marker;
|
317
|
+
},
|
318
|
+
|
319
|
+
openBubble: function() {
|
320
|
+
var pin = this.proprietary_marker;
|
321
|
+
if (this.infoBubble) {
|
322
|
+
pin.mxnMarker = this;
|
323
|
+
pin.bindPopup(this.infoBubble);
|
324
|
+
pin.openPopup();
|
325
|
+
}
|
326
|
+
},
|
327
|
+
|
328
|
+
closeBubble: function() {
|
329
|
+
var pin = this.proprietary_marker;
|
330
|
+
pin.closePopup();
|
331
|
+
},
|
332
|
+
|
333
|
+
hide: function() {
|
334
|
+
var map = this.mapstraction.maps[this.api];
|
335
|
+
map.removeLayer(this.proprietary_marker);
|
336
|
+
},
|
337
|
+
|
338
|
+
show: function() {
|
339
|
+
var map = this.mapstraction.maps[this.api];
|
340
|
+
map.addLayer(this.proprietary_marker);
|
341
|
+
},
|
342
|
+
|
343
|
+
isHidden: function() {
|
344
|
+
var map = this.mapstraction.maps[this.api];
|
345
|
+
if (map.hasLayer(this.proprietary_marker)) {
|
346
|
+
return false;
|
347
|
+
} else {
|
348
|
+
return true;
|
349
|
+
}
|
350
|
+
},
|
351
|
+
|
352
|
+
update: function() {
|
353
|
+
throw 'Not implemented';
|
354
|
+
}
|
355
|
+
|
356
|
+
},
|
357
|
+
|
358
|
+
Polyline: {
|
359
|
+
|
360
|
+
toProprietary: function() {
|
361
|
+
var points = [];
|
362
|
+
for (var i = 0, length = this.points.length ; i< length; i++){
|
363
|
+
points.push(this.points[i].toProprietary('leaflet'));
|
364
|
+
}
|
365
|
+
|
366
|
+
var polyOptions = {
|
367
|
+
color: this.color || '#000000',
|
368
|
+
opacity: this.opacity || 1.0,
|
369
|
+
weight: this.width || 3,
|
370
|
+
fillColor: this.fillColor || '#000000'
|
371
|
+
};
|
372
|
+
|
373
|
+
if (this.closed) {
|
374
|
+
return new L.Polygon(points, polyOptions);
|
375
|
+
} else {
|
376
|
+
return new L.Polyline(points, polyOptions);
|
377
|
+
}
|
378
|
+
},
|
379
|
+
|
380
|
+
show: function() {
|
381
|
+
this.map.addLayer(this.proprietary_polyline);
|
382
|
+
},
|
383
|
+
|
384
|
+
hide: function() {
|
385
|
+
this.map.removeLayer(this.proprietary_polyline);
|
386
|
+
},
|
387
|
+
|
388
|
+
isHidden: function() {
|
389
|
+
if (this.map.hasLayer(this.proprietary_polyline)) {
|
390
|
+
return false;
|
391
|
+
} else {
|
392
|
+
return true;
|
393
|
+
}
|
394
|
+
}
|
395
|
+
}
|
396
|
+
|
397
|
+
});
|
398
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
MAPSTRACTION v2.0.18 http://www.mapstraction.com
|
3
|
+
|
4
|
+
Copyright (c) 2012 Tom Carden, Steve Coast, Mikel Maron, Andrew Turner, Henri Bergius, Rob Moran, Derek Fowler, Gary Gale
|
5
|
+
All rights reserved.
|
6
|
+
|
7
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
11
|
+
* Neither the name of the Mapstraction nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
12
|
+
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
14
|
+
*/
|
15
|
+
mxn.register("mapquest",{Geocoder:{init:function(){var c="";var a="";var e="mapquest_proxy/JSReqHandler.php";var f="geocode.access.mapquest.com";var d="80";var b="mq";this.geocoders[this.api]=new MQExec(f,b,d,c,e,a)},geocode:function(b){var a={};var d=this;var e=new MQAddress();var c=new MQLocationCollection("MQGeoAddress");e.setStreet(b.street);e.setCity(b.locality);e.setState(b.region);e.setPostalCode(b.postalcode);e.setCountry(b.country);this.geocoders[this.api].geocode(e,c);var f=c.get(0);var g=f.getMQLatLng();a.street=f.getStreet();a.locality=f.getCity();a.region=f.getState();a.country=f.getCountry();a.point=new LatLonPoint(g.getLatitude(),g.getLongitude());this.callback(a)},geocode_callback:function(a){throw"Not used"}}});
|
@@ -0,0 +1,63 @@
|
|
1
|
+
/*
|
2
|
+
MAPSTRACTION v2.0.18 http://www.mapstraction.com
|
3
|
+
|
4
|
+
Copyright (c) 2012 Tom Carden, Steve Coast, Mikel Maron, Andrew Turner, Henri Bergius, Rob Moran, Derek Fowler, Gary Gale
|
5
|
+
All rights reserved.
|
6
|
+
|
7
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
11
|
+
* Neither the name of the Mapstraction nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
12
|
+
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
14
|
+
*/
|
15
|
+
mxn.register('mapquest', {
|
16
|
+
|
17
|
+
Geocoder: {
|
18
|
+
|
19
|
+
init: function() {
|
20
|
+
//set up the connection to the geocode server
|
21
|
+
var proxyServerName = "";
|
22
|
+
var proxyServerPort = "";
|
23
|
+
var proxyServerPath = "mapquest_proxy/JSReqHandler.php";
|
24
|
+
var serverName = "geocode.access.mapquest.com";
|
25
|
+
var serverPort = "80";
|
26
|
+
var serverPath = "mq";
|
27
|
+
|
28
|
+
this.geocoders[this.api] = new MQExec(serverName, serverPath, serverPort, proxyServerName,
|
29
|
+
proxyServerPath, proxyServerPort );
|
30
|
+
},
|
31
|
+
|
32
|
+
geocode: function(address){
|
33
|
+
var return_location = {};
|
34
|
+
var mapstraction_geodocer = this;
|
35
|
+
|
36
|
+
var mqaddress = new MQAddress();
|
37
|
+
var gaCollection = new MQLocationCollection("MQGeoAddress");
|
38
|
+
|
39
|
+
//populate the address object with the information from the form
|
40
|
+
mqaddress.setStreet(address.street);
|
41
|
+
mqaddress.setCity(address.locality);
|
42
|
+
mqaddress.setState(address.region);
|
43
|
+
mqaddress.setPostalCode(address.postalcode);
|
44
|
+
mqaddress.setCountry(address.country);
|
45
|
+
|
46
|
+
this.geocoders[this.api].geocode(mqaddress, gaCollection);
|
47
|
+
var geoAddr = gaCollection.get(0);
|
48
|
+
var mqpoint = geoAddr.getMQLatLng();
|
49
|
+
|
50
|
+
return_location.street = geoAddr.getStreet();
|
51
|
+
return_location.locality = geoAddr.getCity();
|
52
|
+
return_location.region = geoAddr.getState();
|
53
|
+
return_location.country = geoAddr.getCountry();
|
54
|
+
return_location.point = new LatLonPoint(mqpoint.getLatitude(), mqpoint.getLongitude());
|
55
|
+
|
56
|
+
this.callback(return_location);
|
57
|
+
},
|
58
|
+
|
59
|
+
geocode_callback: function(response){
|
60
|
+
throw 'Not used';
|
61
|
+
}
|
62
|
+
}
|
63
|
+
});
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
MAPSTRACTION v2.0.18 http://www.mapstraction.com
|
3
|
+
|
4
|
+
Copyright (c) 2012 Tom Carden, Steve Coast, Mikel Maron, Andrew Turner, Henri Bergius, Rob Moran, Derek Fowler, Gary Gale
|
5
|
+
All rights reserved.
|
6
|
+
|
7
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
11
|
+
* Neither the name of the Mapstraction nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
12
|
+
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
14
|
+
*/
|
15
|
+
mxn.register("microsoft",{Mapstraction:{init:function(a,b){var c=this;if(!VEMap){throw b+" map script not imported"}this.maps[b]=new VEMap(a.id);this.maps[b].AttachEvent("onclick",function(g){c.clickHandler();var i=c.maps[c.api];var e=i.GetShapeByID(g.elementID);if(e&&e.mapstraction_marker){e.mapstraction_marker.click.fire()}else{var d=g.mapX;var k=g.mapY;var f=new VEPixel(d,k);var h=i.PixelToLatLong(f);var j={location:new mxn.LatLonPoint(h.Latitude,h.Longitude),position:{x:g.mapX,y:g.mapY},button:g.rightMouseButton?"right":"left"};c.click.fire(j)}});this.maps[b].AttachEvent("onendzoom",function(d){c.moveendHandler(c);c.changeZoom.fire()});this.maps[b].AttachEvent("onendpan",function(d){c.moveendHandler(c);c.endPan.fire()});this.maps[b].AttachEvent("onchangeview",function(d){c.endPan.fire()});this.maps[b].LoadMap();document.getElementById("MSVE_obliqueNotification").style.visibility="hidden";this.loaded[b]=true;c.load.fire()},applyOptions:function(){var a=this.maps[this.api];if(this.options.enableScrollWheelZoom){a.enableContinuousZoom();a.enableScrollWheelZoom()}},resizeTo:function(b,a){this.maps[this.api].Resize(b,a)},addControls:function(a){var b=this.maps[this.api];if(a.pan){b.SetDashboardSize(VEDashboardSize.Normal)}else{b.SetDashboardSize(VEDashboardSize.Tiny)}if(a.zoom=="large"){b.SetDashboardSize(VEDashboardSize.Small)}else{if(a.zoom=="small"){b.SetDashboardSize(VEDashboardSize.Tiny)}else{b.HideDashboard();b.HideScalebar()}}},addSmallControls:function(){var a=this.maps[this.api];a.SetDashboardSize(VEDashboardSize.Tiny)},addLargeControls:function(){var a=this.maps[this.api];a.SetDashboardSize(VEDashboardSize.Normal);this.addControlsArgs.pan=true;this.addControlsArgs.zoom="large"},addMapTypeControls:function(){var a=this.maps[this.api];a.addTypeControl()},dragging:function(a){var b=this.maps[this.api];if(a){b.enableDragMap()}else{b.disableDragMap()}},setCenterAndZoom:function(a,b){var d=this.maps[this.api];var c=a.toProprietary(this.api);var e=b;d.SetCenterAndZoom(new VELatLong(a.lat,a.lon),e)},addMarker:function(b,a){var d=this.maps[this.api];b.pinID="mspin-"+new Date().getTime()+"-"+(Math.floor(Math.random()*Math.pow(2,16)));var c=b.toProprietary(this.api);d.AddShape(c);return c},removeMarker:function(b){var c=this.maps[this.api];var d=b.proprietary_marker.GetID();var a=c.GetShapeByID(d);c.DeleteShape(a)},declutterMarkers:function(a){var b=this.maps[this.api]},addPolyline:function(b,a){var d=this.maps[this.api];var c=b.toProprietary(this.api);c.HideIcon();d.AddShape(c);return c},removePolyline:function(b){var c=this.maps[this.api];var d=b.proprietary_polyline.GetID();var a=c.GetShapeByID(d);c.DeleteShape(a)},getCenter:function(){var b=this.maps[this.api];var c=b.GetCenter();var a=new mxn.LatLonPoint(c.Latitude,c.Longitude);return a},setCenter:function(a,b){var d=this.maps[this.api];var c=a.toProprietary(this.api);d.SetCenter(new VELatLong(a.lat,a.lon))},setZoom:function(a){var b=this.maps[this.api];b.SetZoomLevel(a)},getZoom:function(){var b=this.maps[this.api];var a=b.GetZoomLevel();return a},getZoomLevelForBoundingBox:function(e){var d=this.maps[this.api];var c=e.getNorthEast();var a=e.getSouthWest();var b;return b},setMapType:function(a){var b=this.maps[this.api];switch(a){case mxn.Mapstraction.ROAD:b.SetMapStyle(VEMapStyle.Road);break;case mxn.Mapstraction.SATELLITE:b.SetMapStyle(VEMapStyle.Aerial);break;case mxn.Mapstraction.HYBRID:b.SetMapStyle(VEMapStyle.Hybrid);break;default:b.SetMapStyle(VEMapStyle.Road)}},getMapType:function(){var a=this.maps[this.api];var b=a.GetMapStyle();switch(b){case VEMapStyle.Aerial:return mxn.Mapstraction.SATELLITE;case VEMapStyle.Road:return mxn.Mapstraction.ROAD;case VEMapStyle.Hybrid:return mxn.Mapstraction.HYBRID;default:return null}},getBounds:function(){var b=this.maps[this.api];view=b.GetMapView();var a=view.TopLeftLatLong;var c=view.BottomRightLatLong;return new mxn.BoundingBox(c.Latitude,a.Longitude,a.Latitude,c.Longitude)},setBounds:function(b){var d=this.maps[this.api];var a=b.getSouthWest();var c=b.getNorthEast();var e=new VELatLongRectangle(new VELatLong(c.lat,c.lon),new VELatLong(a.lat,a.lon));d.SetMapView(e)},addImageOverlay:function(c,a,e,i,f,g,d,h){var b=this.maps[this.api]},setImagePosition:function(e,b){var d=this.maps[this.api];var c;var a},addOverlay:function(a,c){var e=this.maps[this.api];var b=new VEShapeLayer();var d=new VEShapeSourceSpecification(VEDataType.GeoRSS,a,b);e.ImportShapeLayerData(d)},addTileLayer:function(e,a,b,c,d){throw"Not implemented"},toggleTileLayer:function(a){throw"Not implemented"},getPixelRatio:function(){throw"Not implemented"},mousePosition:function(a){var c=document.getElementById(a);if(c!==null){var b=this.maps[this.api];b.AttachEvent("onmousemove",function(e){var d=b.PixelToLatLong(new VEPixel(e.mapX,e.mapY));var f=d.Latitude.toFixed(4)+" / "+d.Longitude.toFixed(4);c.innerHTML=f});c.innerHTML="0.0000 / 0.0000"}}},LatLonPoint:{toProprietary:function(){return new VELatLong(this.lat,this.lon)},fromProprietary:function(a){this.lat=a.Latitude;this.lon=a.Longitude}},Marker:{toProprietary:function(){var a=new VEShape(VEShapeType.Pushpin,this.location.toProprietary("microsoft"));a.SetTitle(this.labelText);a.SetDescription(this.infoBubble);if(this.iconUrl){var b=new VECustomIconSpecification();b.Image=this.iconUrl;if(this.iconAnchor){b.ImageOffset=new VEPixel(-this.iconAnchor[0],-this.iconAnchor[1])}else{if(this.iconSize){b.ImageOffset=new VEPixel(-this.iconSize[0]/2,-this.iconSize[1]/2)}}a.SetCustomIcon(b)}if(this.draggable){a.Draggable=true}return a},openBubble:function(){if(!this.map){throw"Marker must be added to map in order to display infobox"}this.map.ShowInfoBox(this.proprietary_marker)},closeBubble:function(){if(!this.map){throw"Marker must be added to map in order to display infobox"}this.map.HideInfoBox()},hide:function(){this.proprietary_marker.Hide()},show:function(){this.proprietary_marker.Show()},update:function(){var a=new mxn.LatLonPoint(this.proprietary_marker.Latitude,this.proprietary_marker.Longitude);this.location=a}},Polyline:{toProprietary:function(){var c=[],f;var e=function(i,j){var g=new mxn.util.Color(i);var h=(typeof(j)=="undefined"||j===null)?1:j;var k=new VEColor(g.red,g.green,g.blue,h);return k};for(var b=0,d=this.points.length;b<d;b++){c.push(this.points[b].toProprietary("microsoft"))}if(this.closed){f=VEShapeType.Polygon}else{f=VEShapeType.Polyline}var a=new VEShape(f,c);if(this.width){a.SetLineWidth(this.width)}if(this.color){a.SetLineColor(e(this.color,this.opacity))}if(this.fillColor){a.SetFillColor(e(this.fillColor,this.fillOpacity))}return a},show:function(){this.proprietary_polyline.Show()},hide:function(){this.proprietary_polyline.Hide()}}});
|