Merge branch '2.12'
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ OpenLayers/Layer/WMS.js
|
|||||||
OpenLayers/Layer/Google/v3.js
|
OpenLayers/Layer/Google/v3.js
|
||||||
OpenLayers/Popup/FramedCloud.js
|
OpenLayers/Popup/FramedCloud.js
|
||||||
OpenLayers/Control/Navigation.js
|
OpenLayers/Control/Navigation.js
|
||||||
OpenLayers/Control/ZoomPanel.js
|
OpenLayers/Control/Zoom.js
|
||||||
OpenLayers/Control/Attribution.js
|
OpenLayers/Control/Attribution.js
|
||||||
OpenLayers/Control/SelectFeature.js
|
OpenLayers/Control/SelectFeature.js
|
||||||
OpenLayers/Control/Panel.js
|
OpenLayers/Control/Panel.js
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ OpenLayers/Layer/Bing.js
|
|||||||
OpenLayers/Layer/WMS.js
|
OpenLayers/Layer/WMS.js
|
||||||
OpenLayers/Control/TouchNavigation.js
|
OpenLayers/Control/TouchNavigation.js
|
||||||
OpenLayers/Control/Geolocate.js
|
OpenLayers/Control/Geolocate.js
|
||||||
OpenLayers/Control/ZoomPanel.js
|
OpenLayers/Control/Zoom.js
|
||||||
OpenLayers/Control/Attribution.js
|
OpenLayers/Control/Attribution.js
|
||||||
OpenLayers/Control/SelectFeature.js
|
OpenLayers/Control/SelectFeature.js
|
||||||
OpenLayers/Control/DrawFeature.js
|
OpenLayers/Control/DrawFeature.js
|
||||||
|
|||||||
@@ -35,36 +35,6 @@
|
|||||||
padding : 2px 4px;
|
padding : 2px 4px;
|
||||||
border-radius : 5px 0 0 0;
|
border-radius : 5px 0 0 0;
|
||||||
}
|
}
|
||||||
div.olControlZoomPanel .olControlZoomInItemInactive,
|
|
||||||
div.olControlZoomPanel .olControlZoomOutItemInactive {
|
|
||||||
background: rgba(0,0,0,0.2);
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel .olControlZoomInItemInactive {
|
|
||||||
border-radius: 5px 5px 0 0;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel .olControlZoomOutItemInactive {
|
|
||||||
border-radius: 0 0 5px 5px ;
|
|
||||||
top: 37px;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel .olControlZoomOutItemInactive:after ,
|
|
||||||
div.olControlZoomPanel .olControlZoomInItemInactive:after{
|
|
||||||
font-weight: bold;
|
|
||||||
content : '+';
|
|
||||||
font-size : 36px;
|
|
||||||
padding: 7px;
|
|
||||||
z-index: 2000;
|
|
||||||
color : #fff;
|
|
||||||
line-height: 1em;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel .olControlZoomOutItemInactive:after{
|
|
||||||
content: '–';
|
|
||||||
line-height: 0.9em;
|
|
||||||
padding: 0 8px;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel .olControlZoomToMaxExtentItemInactive {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#title, #tags, #shortdesc {
|
#title, #tags, #shortdesc {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ var init = function () {
|
|||||||
enableKinetic: true
|
enableKinetic: true
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
new OpenLayers.Control.ZoomPanel()
|
new OpenLayers.Control.Zoom()
|
||||||
],
|
],
|
||||||
layers: [
|
layers: [
|
||||||
new OpenLayers.Layer.OSM("OpenStreetMap", null, {
|
new OpenLayers.Layer.OSM("OpenStreetMap", null, {
|
||||||
|
|||||||
+35
-24
@@ -1,31 +1,42 @@
|
|||||||
div.olControlZoomPanel {
|
div.olControlZoom {
|
||||||
height: 108px;
|
|
||||||
width: 36px;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 20px;
|
top: 8px;
|
||||||
left: 20px;
|
left: 8px;
|
||||||
}
|
}
|
||||||
div.olControlZoomPanel div {
|
* {
|
||||||
width: 36px;
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||||
height: 36px;
|
|
||||||
background-image: url(img/mobile-zoombar.png);
|
|
||||||
left: 0;
|
|
||||||
}
|
}
|
||||||
div.olControlZoomPanel .olControlZoomInItemInactive {
|
div.olControlZoom a {
|
||||||
top: 0;
|
display: block;
|
||||||
background-position: 0 0;
|
margin: 1px;
|
||||||
|
padding: 0;
|
||||||
|
color: white;
|
||||||
|
font-size: 28px;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
text-align: center;
|
||||||
|
height: 32px;
|
||||||
|
width: 32px;
|
||||||
|
line-height: 28px;
|
||||||
|
text-shadow: 0 0 3px rgba(0,0,0,0.8);
|
||||||
|
background: #666666; /* fallback for IE - IE6 requires background shorthand*/
|
||||||
|
background: rgba(0, 0, 0, 0.3);
|
||||||
|
filter: alpha(opacity=60);
|
||||||
}
|
}
|
||||||
div.olControlZoomPanel .olControlZoomToMaxExtentItemInactive {
|
a.olControlZoomIn {
|
||||||
top: 36px;
|
border-radius: 4px 4px 0 0;
|
||||||
background-position: 0 -36px;
|
|
||||||
}
|
}
|
||||||
div.olControlZoomPanel .olControlZoomOutItemInactive {
|
a.olControlZoomOut {
|
||||||
top: 72px;
|
border-radius: 0 0 4px 4px;
|
||||||
background-position: 0 -72px;
|
|
||||||
}
|
}
|
||||||
.olTileImage {
|
div.olControlZoom a:hover {
|
||||||
-webkit-transition: opacity 0.2s linear;
|
background: #444444; /* fallback for IE */
|
||||||
-moz-transition: opacity 0.2s linear;
|
background: rgba(0, 0, 0, 0.5);
|
||||||
-o-transition: opacity 0.2s linear;
|
filter: alpha(opacity=80);
|
||||||
transition: opacity 0.2s linear;
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
div.olControlZoom a:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ OpenLayers.Map = OpenLayers.Class({
|
|||||||
* If not provided in the map options at construction, the map will
|
* If not provided in the map options at construction, the map will
|
||||||
* by default be given the following controls if present in the build:
|
* by default be given the following controls if present in the build:
|
||||||
* - <OpenLayers.Control.Navigation> or <OpenLayers.Control.TouchNavigation>
|
* - <OpenLayers.Control.Navigation> or <OpenLayers.Control.TouchNavigation>
|
||||||
* - <OpenLayers.Control.PanZoom>
|
* - <OpenLayers.Control.Zoom> or <OpenLayers.Control.PanZoom>
|
||||||
* - <OpenLayers.Control.ArgParser>
|
* - <OpenLayers.Control.ArgParser>
|
||||||
* - <OpenLayers.Control.Attribution>
|
* - <OpenLayers.Control.Attribution>
|
||||||
*/
|
*/
|
||||||
@@ -622,9 +622,12 @@ OpenLayers.Map = OpenLayers.Class({
|
|||||||
} else if (OpenLayers.Control.TouchNavigation) {
|
} else if (OpenLayers.Control.TouchNavigation) {
|
||||||
this.controls.push(new OpenLayers.Control.TouchNavigation());
|
this.controls.push(new OpenLayers.Control.TouchNavigation());
|
||||||
}
|
}
|
||||||
if (OpenLayers.Control.PanZoom) {
|
if (OpenLayers.Control.Zoom) {
|
||||||
|
this.controls.push(new OpenLayers.Control.Zoom());
|
||||||
|
} else if (OpenLayers.Control.PanZoom) {
|
||||||
this.controls.push(new OpenLayers.Control.PanZoom());
|
this.controls.push(new OpenLayers.Control.PanZoom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OpenLayers.Control.ArgParser) {
|
if (OpenLayers.Control.ArgParser) {
|
||||||
this.controls.push(new OpenLayers.Control.ArgParser());
|
this.controls.push(new OpenLayers.Control.ArgParser());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2930,282 +2930,6 @@ OpenLayers.Layer.WFS = OpenLayers.Class(
|
|||||||
CLASS_NAME: "OpenLayers.Layer.WFS"
|
CLASS_NAME: "OpenLayers.Layer.WFS"
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* Class: OpenLayers.Layer.MultiMap
|
|
||||||
* Note that MultiMap does not fully support the sphericalMercator
|
|
||||||
* option. See Ticket #953 for more details.
|
|
||||||
* *Deprecated*. Use OpenLayers.Layer.Bing instead. See #3063
|
|
||||||
*
|
|
||||||
* Inherits from:
|
|
||||||
* - <OpenLayers.Layer.EventPane>
|
|
||||||
* - <OpenLayers.Layer.FixedZoomLevels>
|
|
||||||
*/
|
|
||||||
OpenLayers.Layer.MultiMap = OpenLayers.Class(
|
|
||||||
OpenLayers.Layer.EventPane, OpenLayers.Layer.FixedZoomLevels, {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constant: MIN_ZOOM_LEVEL
|
|
||||||
* {Integer} 1
|
|
||||||
*/
|
|
||||||
MIN_ZOOM_LEVEL: 1,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constant: MAX_ZOOM_LEVEL
|
|
||||||
* {Integer} 17
|
|
||||||
*/
|
|
||||||
MAX_ZOOM_LEVEL: 17,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constant: RESOLUTIONS
|
|
||||||
* {Array(Float)} Hardcode these resolutions so that they are more closely
|
|
||||||
* tied with the standard wms projection
|
|
||||||
*/
|
|
||||||
RESOLUTIONS: [
|
|
||||||
9,
|
|
||||||
1.40625,
|
|
||||||
0.703125,
|
|
||||||
0.3515625,
|
|
||||||
0.17578125,
|
|
||||||
0.087890625,
|
|
||||||
0.0439453125,
|
|
||||||
0.02197265625,
|
|
||||||
0.010986328125,
|
|
||||||
0.0054931640625,
|
|
||||||
0.00274658203125,
|
|
||||||
0.001373291015625,
|
|
||||||
0.0006866455078125,
|
|
||||||
0.00034332275390625,
|
|
||||||
0.000171661376953125,
|
|
||||||
0.0000858306884765625,
|
|
||||||
0.00004291534423828125
|
|
||||||
],
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIProperty: type
|
|
||||||
* {?}
|
|
||||||
*/
|
|
||||||
type: null,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor: OpenLayers.Layer.MultiMap
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* name - {String}
|
|
||||||
* options - {Object}
|
|
||||||
*/
|
|
||||||
initialize: function(name, options) {
|
|
||||||
OpenLayers.Layer.EventPane.prototype.initialize.apply(this, arguments);
|
|
||||||
OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,
|
|
||||||
arguments);
|
|
||||||
if (this.sphericalMercator) {
|
|
||||||
OpenLayers.Util.extend(this, OpenLayers.Layer.SphericalMercator);
|
|
||||||
this.initMercatorParameters();
|
|
||||||
this.RESOLUTIONS.unshift(10);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method: loadMapObject
|
|
||||||
*/
|
|
||||||
loadMapObject:function() {
|
|
||||||
try { //crash proofing
|
|
||||||
this.mapObject = new MultimapViewer(this.div);
|
|
||||||
} catch (e) { }
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: getWarningHTML
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {String} String with information on why layer is broken, how to get
|
|
||||||
* it working.
|
|
||||||
*/
|
|
||||||
getWarningHTML:function() {
|
|
||||||
return OpenLayers.i18n(
|
|
||||||
"getLayerWarning", {'layerType':"MM", 'layerLib':"MultiMap"}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************************************
|
|
||||||
* *
|
|
||||||
* MapObject Interface Controls *
|
|
||||||
* *
|
|
||||||
************************************/
|
|
||||||
|
|
||||||
|
|
||||||
// Get&Set Center, Zoom
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: setMapObjectCenter
|
|
||||||
* Set the mapObject to the specified center and zoom
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* center - {Object} MapObject LonLat format
|
|
||||||
* zoom - {int} MapObject zoom format
|
|
||||||
*/
|
|
||||||
setMapObjectCenter: function(center, zoom) {
|
|
||||||
this.mapObject.goToPosition(center, zoom);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: getMapObjectCenter
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Object} The mapObject's current center in Map Object format
|
|
||||||
*/
|
|
||||||
getMapObjectCenter: function() {
|
|
||||||
return this.mapObject.getCurrentPosition();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: getMapObjectZoom
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Integer} The mapObject's current zoom, in Map Object format
|
|
||||||
*/
|
|
||||||
getMapObjectZoom: function() {
|
|
||||||
return this.mapObject.getZoomFactor();
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
// LonLat - Pixel Translation
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: getMapObjectLonLatFromMapObjectPixel
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* moPixel - {Object} MapObject Pixel format
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Object} MapObject LonLat translated from MapObject Pixel
|
|
||||||
*/
|
|
||||||
getMapObjectLonLatFromMapObjectPixel: function(moPixel) {
|
|
||||||
moPixel.x = moPixel.x - (this.map.getSize().w/2);
|
|
||||||
moPixel.y = moPixel.y - (this.map.getSize().h/2);
|
|
||||||
return this.mapObject.getMapPositionAt(moPixel);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: getMapObjectPixelFromMapObjectLonLat
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* moLonLat - {Object} MapObject LonLat format
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Object} MapObject Pixel transtlated from MapObject LonLat
|
|
||||||
*/
|
|
||||||
getMapObjectPixelFromMapObjectLonLat: function(moLonLat) {
|
|
||||||
return this.mapObject.geoPosToContainerPixels(moLonLat);
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/************************************
|
|
||||||
* *
|
|
||||||
* MapObject Primitives *
|
|
||||||
* *
|
|
||||||
************************************/
|
|
||||||
|
|
||||||
|
|
||||||
// LonLat
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: getLongitudeFromMapObjectLonLat
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* moLonLat - {Object} MapObject LonLat format
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Float} Longitude of the given MapObject LonLat
|
|
||||||
*/
|
|
||||||
getLongitudeFromMapObjectLonLat: function(moLonLat) {
|
|
||||||
return this.sphericalMercator ?
|
|
||||||
this.forwardMercator(moLonLat.lon, moLonLat.lat).lon :
|
|
||||||
moLonLat.lon;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: getLatitudeFromMapObjectLonLat
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* moLonLat - {Object} MapObject LonLat format
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Float} Latitude of the given MapObject LonLat
|
|
||||||
*/
|
|
||||||
getLatitudeFromMapObjectLonLat: function(moLonLat) {
|
|
||||||
return this.sphericalMercator ?
|
|
||||||
this.forwardMercator(moLonLat.lon, moLonLat.lat).lat :
|
|
||||||
moLonLat.lat;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: getMapObjectLonLatFromLonLat
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* lon - {Float}
|
|
||||||
* lat - {Float}
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Object} MapObject LonLat built from lon and lat params
|
|
||||||
*/
|
|
||||||
getMapObjectLonLatFromLonLat: function(lon, lat) {
|
|
||||||
var mmLatLon;
|
|
||||||
if(this.sphericalMercator) {
|
|
||||||
var lonlat = this.inverseMercator(lon, lat);
|
|
||||||
mmLatLon = new MMLatLon(lonlat.lat, lonlat.lon);
|
|
||||||
} else {
|
|
||||||
mmLatLon = new MMLatLon(lat, lon);
|
|
||||||
}
|
|
||||||
return mmLatLon;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Pixel
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: getXFromMapObjectPixel
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* moPixel - {Object} MapObject Pixel format
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Integer} X value of the MapObject Pixel
|
|
||||||
*/
|
|
||||||
getXFromMapObjectPixel: function(moPixel) {
|
|
||||||
return moPixel.x;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: getYFromMapObjectPixel
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* moPixel - {Object} MapObject Pixel format
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Integer} Y value of the MapObject Pixel
|
|
||||||
*/
|
|
||||||
getYFromMapObjectPixel: function(moPixel) {
|
|
||||||
return moPixel.y;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: getMapObjectPixelFromXY
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* x - {Integer}
|
|
||||||
* y - {Integer}
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Object} MapObject Pixel from x and y parameters
|
|
||||||
*/
|
|
||||||
getMapObjectPixelFromXY: function(x, y) {
|
|
||||||
return new MMPoint(x, y);
|
|
||||||
},
|
|
||||||
|
|
||||||
CLASS_NAME: "OpenLayers.Layer.MultiMap"
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: OpenLayers.Layer.VirtualEarth
|
* Class: OpenLayers.Layer.VirtualEarth
|
||||||
* *Deprecated*. Use <OpenLayers.Layer.Bing> instead.
|
* *Deprecated*. Use <OpenLayers.Layer.Bing> instead.
|
||||||
|
|||||||
+8
-1
@@ -138,6 +138,14 @@ Corresponding issues/pull requests:
|
|||||||
|
|
||||||
# Behavior Changes from Past Releases
|
# Behavior Changes from Past Releases
|
||||||
|
|
||||||
|
## MultiMap Layer Removal
|
||||||
|
|
||||||
|
The `OpenLayers.Layer.MultiMap` class has been removed entirely, as the MultiMap service was discontinued.
|
||||||
|
|
||||||
|
Corresponding issues/pull requests:
|
||||||
|
|
||||||
|
* https://github.com/openlayers/openlayers/pull/328
|
||||||
|
|
||||||
## GPX API change
|
## GPX API change
|
||||||
|
|
||||||
The `gpxns` API property has been removed. The GPX namespace is now defined in the `namespaces` property but is not intended to be overriden.
|
The `gpxns` API property has been removed. The GPX namespace is now defined in the `namespaces` property but is not intended to be overriden.
|
||||||
@@ -321,7 +329,6 @@ A number of properties, methods, and constructors have been marked as deprecated
|
|||||||
* OpenLayers.Tile.WFS
|
* OpenLayers.Tile.WFS
|
||||||
* OpenLayers.Feature.WFS
|
* OpenLayers.Feature.WFS
|
||||||
* OpenLayers.Layer.WFS
|
* OpenLayers.Layer.WFS
|
||||||
* OpenLayers.Layer.MultiMap
|
|
||||||
* OpenLayers.Layer.VirtualEarth
|
* OpenLayers.Layer.VirtualEarth
|
||||||
* OpenLayers.Protocol.SQL
|
* OpenLayers.Protocol.SQL
|
||||||
* OpenLayers.Protocol.SQL.Gears
|
* OpenLayers.Protocol.SQL.Gears
|
||||||
|
|||||||
@@ -1,122 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<!-- multimap api key for http://(www.)openlayers.org -->
|
|
||||||
<script type="text/javascript" src="http://developer.multimap.com/API/maps/1.2/OA10072915821139765"></script>
|
|
||||||
<script src="../../OLLoader.js"></script>
|
|
||||||
<script src="../../../lib/deprecated.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var doTest = true;
|
|
||||||
function test_Layer_MultiMap_constructor (t) {
|
|
||||||
// WebKit browsers fail when the API key is for a different url, so we
|
|
||||||
// do not test in this case.
|
|
||||||
try {
|
|
||||||
var map = new OpenLayers.Map("map");
|
|
||||||
var layer = new OpenLayers.Layer.MultiMap('MultiMap Layer');
|
|
||||||
map.addLayer(layer);
|
|
||||||
}
|
|
||||||
catch(e) {
|
|
||||||
doTest = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!doTest) { t.plan(0); return; }
|
|
||||||
t.plan( 4 );
|
|
||||||
|
|
||||||
var map = new OpenLayers.Map('map');
|
|
||||||
var layer = new OpenLayers.Layer.MultiMap('MultiMap Layer');
|
|
||||||
map.addLayer(layer);
|
|
||||||
|
|
||||||
|
|
||||||
t.ok( layer instanceof OpenLayers.Layer.MultiMap, "new OpenLayers.Layer.MultiMap returns object" );
|
|
||||||
t.eq( layer.CLASS_NAME, "OpenLayers.Layer.MultiMap", "CLASS_NAME variable set correctly");
|
|
||||||
|
|
||||||
t.eq( layer.name, "MultiMap Layer", "layer.name is correct" );
|
|
||||||
|
|
||||||
t.ok ( layer.mapObject != null, "MultiMap Object correctly loaded");
|
|
||||||
}
|
|
||||||
|
|
||||||
function test_Layer_MultiMap_isBaseLayer (t) {
|
|
||||||
if (!doTest) { t.plan(0); return; }
|
|
||||||
t.plan(1);
|
|
||||||
|
|
||||||
var layer = new OpenLayers.Layer.MultiMap('MultiMap Layer');
|
|
||||||
|
|
||||||
t.ok(layer.isBaseLayer, "a default load of multimap layer responds as a base layer");
|
|
||||||
}
|
|
||||||
|
|
||||||
function test_Layer_MultiMap_Translation_lonlat (t) {
|
|
||||||
if (!doTest) { t.plan(0); return; }
|
|
||||||
|
|
||||||
t.plan( 4 );
|
|
||||||
|
|
||||||
var map = new OpenLayers.Map('map');
|
|
||||||
var layer = new OpenLayers.Layer.MultiMap('MultiMap Layer');
|
|
||||||
map.addLayer(layer);
|
|
||||||
|
|
||||||
// these two lines specify an appropriate translation.
|
|
||||||
// the code afterwards works by itself to test that translation
|
|
||||||
// works correctly both ways.
|
|
||||||
var gLatLng = new MMLatLon(50,100);
|
|
||||||
var correspondingOLLonLat = new OpenLayers.LonLat(100,50);
|
|
||||||
|
|
||||||
|
|
||||||
olLonLat = layer.getOLLonLatFromMapObjectLonLat(gLatLng);
|
|
||||||
t.ok(olLonLat.equals(correspondingOLLonLat), "Translation from GLatLng to OpenLayers.LonLat works");
|
|
||||||
|
|
||||||
var transGLatLng = layer.getMapObjectLonLatFromOLLonLat(olLonLat);
|
|
||||||
t.ok( (transGLatLng.lat == gLatLng.lat) && (transGLatLng.lon == transGLatLng.lon), "Translation from OpenLayers.LonLat to GLatLng works");
|
|
||||||
|
|
||||||
t.ok( layer.getMapObjectLonLatFromOLLonLat(null) == null, "getGLatLngFromOLLonLat(null) returns null");
|
|
||||||
t.ok( layer.getOLLonLatFromMapObjectLonLat(null) == null, "getOLLonLatFromGLatLng(null) returns null");
|
|
||||||
}
|
|
||||||
|
|
||||||
function test_Layer_MultiMap_Translation_pixel (t) {
|
|
||||||
if (!doTest) { t.plan(0); return; }
|
|
||||||
|
|
||||||
t.plan( 4 );
|
|
||||||
|
|
||||||
var map = new OpenLayers.Map('map');
|
|
||||||
var layer = new OpenLayers.Layer.MultiMap('MultiMap Layer');
|
|
||||||
map.addLayer(layer);
|
|
||||||
|
|
||||||
// these two lines specify an appropriate translation.
|
|
||||||
// the code afterwards works by itself to test that translation
|
|
||||||
// works correctly both ways.
|
|
||||||
var gPoint = new MMPoint(50,100);
|
|
||||||
var correspondingOLPixel = new OpenLayers.Pixel(50, 100);
|
|
||||||
|
|
||||||
|
|
||||||
olPixel = layer.getOLPixelFromMapObjectPixel(gPoint);
|
|
||||||
t.ok( olPixel.equals(correspondingOLPixel), "Translation from GPoint to OpenLayers.Pixel works");
|
|
||||||
|
|
||||||
var transGPoint = layer.getMapObjectPixelFromOLPixel(olPixel);
|
|
||||||
t.ok( ((transGPoint.x == transGPoint.x) && (transGPoint.y == transGPoint.y)), "Translation from OpenLayers.Pixel to GPoint works");
|
|
||||||
|
|
||||||
t.ok( layer.getMapObjectPixelFromOLPixel(null) == null, "getGPointFromOLPixel(null) returns null");
|
|
||||||
t.ok( layer.getOLPixelFromMapObjectPixel(null) == null, "getOLPixelFromGPoint(null) returns null");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function test_Layer_destroy (t) {
|
|
||||||
if (!doTest) { t.plan(0); return; }
|
|
||||||
t.plan( 5 );
|
|
||||||
|
|
||||||
var map = new OpenLayers.Map('map');
|
|
||||||
|
|
||||||
layer = new OpenLayers.Layer.MultiMap('Test Layer');
|
|
||||||
map.addLayer(layer);
|
|
||||||
|
|
||||||
layer.destroy();
|
|
||||||
|
|
||||||
t.eq( layer.name, null, "layer.name is null after destroy" );
|
|
||||||
t.eq( layer.div, null, "layer.div is null after destroy" );
|
|
||||||
t.eq( layer.map, null, "layer.map is null after destroy" );
|
|
||||||
t.eq( layer.options, null, "layer.options is null after destroy" );
|
|
||||||
t.eq( layer.multimap, null, "layer.gmap is null after destroy" );
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="map"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -238,7 +238,6 @@
|
|||||||
<li>deprecated/Layer/GML.html</li>
|
<li>deprecated/Layer/GML.html</li>
|
||||||
<li>deprecated/Layer/MapServer.html</li>
|
<li>deprecated/Layer/MapServer.html</li>
|
||||||
<li>deprecated/Layer/MapServer/Untiled.html</li>
|
<li>deprecated/Layer/MapServer/Untiled.html</li>
|
||||||
<li>deprecated/Layer/MultiMap.html</li>
|
|
||||||
<li>deprecated/Layer/WFS.html</li>
|
<li>deprecated/Layer/WFS.html</li>
|
||||||
<li>deprecated/Layer/WMS.html</li>
|
<li>deprecated/Layer/WMS.html</li>
|
||||||
<li>deprecated/Layer/WMS/Post.html</li>
|
<li>deprecated/Layer/WMS/Post.html</li>
|
||||||
|
|||||||
@@ -447,6 +447,7 @@ div.olControlZoom a {
|
|||||||
height: 22px;
|
height: 22px;
|
||||||
width:22px;
|
width:22px;
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
|
text-shadow: 0 0 3px rgba(0,0,0,0.8);
|
||||||
background: #666666; /* fallback for IE - IE6 requires background shorthand*/
|
background: #666666; /* fallback for IE - IE6 requires background shorthand*/
|
||||||
background: rgba(0, 0, 0, 0.3);
|
background: rgba(0, 0, 0, 0.3);
|
||||||
filter: alpha(opacity=60);
|
filter: alpha(opacity=60);
|
||||||
@@ -456,6 +457,11 @@ div.olControlZoom a:hover {
|
|||||||
background: rgba(0, 0, 0, 0.5);
|
background: rgba(0, 0, 0, 0.5);
|
||||||
filter: alpha(opacity=80);
|
filter: alpha(opacity=80);
|
||||||
}
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
div.olControlZoom a:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
a.olControlZoomIn {
|
a.olControlZoomIn {
|
||||||
border-radius: 4px 4px 0 0;
|
border-radius: 4px 4px 0 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user