diff --git a/build/docs.sh b/build/docs.sh index 8752f3d5bf..2877c613c5 100755 --- a/build/docs.sh +++ b/build/docs.sh @@ -1,7 +1,7 @@ #!/bin/sh rm ../doc/reference.html -CLASSES="Map Layer Layer.HTTPRequest Layer.Grid Layer.WMS Layer.KaMap Layer.EventPane Layer.Google Layer.VirtualEarth Layer.Markers Layer.Text Layer.GeoRSS Layer.Boxes Icon Marker Marker.Box Tile Tile.Image Tile.WFS Control Control.LayerSwitcher Control.MouseDefaults Control.MousePosition Control.MouseToolbar Control.PanZoom Control.PanZoomBar Control.Permalink Control.Scale LonLat Size Pixel Bounds Util" +CLASSES="Map Layer Layer.HTTPRequest Layer.Grid Layer.WMS Layer.KaMap Layer.EventPane Layer.Google Layer.VirtualEarth Layer.Markers Layer.Text Layer.GeoRSS Layer.Boxes Icon Marker Marker.Box Tile Tile.Image Tile.WFS Control Control.LayerSwitcher Control.MouseDefaults Control.MousePosition Control.MouseToolbar Control.OverviewMap Control.PanZoom Control.PanZoomBar Control.Permalink Control.Scale LonLat Size Pixel Bounds Util Ajax" echo " OpenLayers Class Reference Documentation diff --git a/build/library.cfg b/build/library.cfg index e37808a6f2..e1b7835328 100644 --- a/build/library.cfg +++ b/build/library.cfg @@ -2,6 +2,7 @@ OpenLayers/SingleFile.js OpenLayers.js OpenLayers/BaseTypes.js +OpenLayers/Util.js Rico/Corner.js [last] diff --git a/doc/Layer.HTTPRequest.txt b/doc/Layer.HTTPRequest.txt index ea683e6d77..39050d6265 100644 --- a/doc/Layer.HTTPRequest.txt +++ b/doc/Layer.HTTPRequest.txt @@ -6,6 +6,8 @@ Sublass of Layer used for services which require initiating multiple HTTPRequest OpenLayers.Layer.HTTPRequest(name, url, params, options) -- URL is the base URL to the layer. Params is a set of params to be included in the HTTP Request. Options is a set of options, extending the parameters of the layer. * Methods - initResolutions() -- none -- Based on the current minScale/maxScale/maxResolution/maxZoomLevels/scales/resolutions parameters, initializes an array of 'zoom levels' as this.resolutions, which are then used as an index into when zooming. + initResolutions() -- none -- Based on the current minScale/maxScale/maxResolution/numZoomLevel/scales/resolutions parameters, initializes an array of 'zoom levels' as this.resolutions, which are then used as an index into when zooming. getFullRequestString(newParams) -- {String} -- Returns the full request string for a combination of the defaults on this layer and the parameters passed via newParams. - + +* Options + reproject -- If reproject is true, then the layer will alter the bounding boxes of its tiles to be based on the geographic location of the pixel bounds in the base layer. This is important for reprojecting WMS tiles onto something like Google Maps. Tile locations are calculated, and then when creating the tile request, the bounding box is adjusted to match the bounding box of the base layer at that location. diff --git a/doc/Layer.txt b/doc/Layer.txt index cd0fac8743..0f69c191f2 100644 --- a/doc/Layer.txt +++ b/doc/Layer.txt @@ -20,6 +20,7 @@ of different layers. getZoomForExtent({OpenLayers.Bounds|bounds}) -- {Integer} -- return the integer zoom which most closely matches the passed bounds. getLonLatFromViewPortPx({OpenLayers.Pixel|pixel}) -- {OpenLayers.LonLat} -- Returns an OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by the laye getViewPortPxFromLonLat({OpenLayers.LonLat|lonlat}) -- {OpenLayers.Pixel} -- Returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, translated into view port pixels + addOptions({options})) -- none -- Change the options on the layer. This is the supported way to change properties of the layer. * Parameters displayOutsideMaxExtent -- Determine whether images or data are loaded outside the maxExtent. Default is false. @@ -31,6 +32,7 @@ of different layers. minScale -- The scale at zoom level 0. If this is set on the map before the Layer is added to the map, it will inherit from the map. maxScale -- The scale at the highest zoom level. If this is set on the map before the Layer is added to the map, it will inherit from the map. units -- The units the map is projected into. If this is set on the map before the Layer is added to the map, it will inherit from the map. + diff --git a/doc/authors.txt b/doc/authors.txt index fbcd848834..6d383b8b36 100644 --- a/doc/authors.txt +++ b/doc/authors.txt @@ -11,6 +11,7 @@ Patch contributors Corey Puffault Tim Schaub Jeff Dege +Sean Gilles OpenLayers is graciously supported by MetaCarta, Inc. . diff --git a/examples/baseLayers.html b/examples/baseLayers.html index 01c548bbdb..dd01dbf61d 100644 --- a/examples/baseLayers.html +++ b/examples/baseLayers.html @@ -13,7 +13,9 @@ + + - +
diff --git a/tests/test_Popup.html b/tests/test_Popup.html index 8551f4cd74..9185bdd270 100644 --- a/tests/test_Popup.html +++ b/tests/test_Popup.html @@ -78,7 +78,7 @@ t.eq(popup.div.style.top, y + "px", "top position of popup.div set correctly"); t.eq(popup.div.style.width, w + "px", "width position of popup.div set correctly"); t.eq(popup.div.style.height, h + "px", "heightposition of popup.div set correctly"); - t.eq(popup.div.innerHTML, content, "good default popup.contentHTML"); + t.eq(popup.div.innerHTML, '
charlie
', "good default popup.contentHTML"); t.eq(popup.div.style.backgroundColor, color, "good default popup.backgroundColor"); if (navigator.appName.indexOf("Microsoft") == -1) { diff --git a/tests/test_Tile_Image.html b/tests/test_Tile_Image.html index 979791ed7b..e6e033aae0 100644 --- a/tests/test_Tile_Image.html +++ b/tests/test_Tile_Image.html @@ -27,8 +27,10 @@ function test_02_Tile_Image_draw (t) { t.plan( 5 ); - var layer = {maxExtent:new OpenLayers.Bounds(-180,-90,180,90)}; //bogus layer - layer.div = document.createElement("div"); + var map = new OpenLayers.Map('map'); + + layer = new OpenLayers.Layer.WMS("Name", "http://labs.metacarta.com/TESTURL"); + map.addLayer(layer); var position = new OpenLayers.Pixel(20,30); var bounds = new OpenLayers.Bounds(1,2,3,4); var url = "http://www.openlayers.org/dev/tests/tileimage"; @@ -36,7 +38,6 @@ tile = new OpenLayers.Tile.Image(layer, position, bounds, url, size); tile.draw(); - var img = tile.imgDiv; if (!isMozilla) @@ -47,7 +48,7 @@ t.ok( true, "skipping element test outside of Mozilla"); else t.ok( img instanceof HTMLImageElement, "tile.draw creates an image"); - t.eq( img.src, "http://www.openlayers.org/dev/tests/tileimage", "tile.draw creates an image"); + t.eq( img.src, "http://labs.metacarta.com/TESTURL?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&BBOX=1,2,3,4&WIDTH=256&HEIGHT=256", "tile.draw creates an image"); t.eq( tile.imgDiv.style.width, "5px", "Image width is correct" ); t.eq( tile.imgDiv.style.height, "6px", "Image height is correct" ); } @@ -59,44 +60,69 @@ var size = new OpenLayers.Size(5,6); var map = new OpenLayers.Map('map'); var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", - "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}); + "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}, {reproject:false}); map.addLayer(layer); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-185,-90,-180,90), url, size); tile.draw() t.eq(tile.imgDiv.src, "", "Images against side of maxextent don't load"); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-181,-91,180,90), url, size); tile.draw() - t.eq(tile.imgDiv.src, "http://www.openlayers.org/dev/tests/tileimage", "Images over edges of maxextent do load"); + t.eq(tile.imgDiv.src, "http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&BBOX=-181,-91,180,90&WIDTH=256&HEIGHT=256", "Images over edges of maxextent do load"); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-181,-90,180,90), url, size); tile.draw() - t.eq(tile.imgDiv.src, "http://www.openlayers.org/dev/tests/tileimage", "Images over edges of maxextent do load"); + t.eq(tile.imgDiv.src, "http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&BBOX=-181,-90,180,90&WIDTH=256&HEIGHT=256", "Images over edges of maxextent do load"); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-180,-90,180,90), url, size); tile.draw() - t.eq(tile.imgDiv.src, "http://www.openlayers.org/dev/tests/tileimage", "Image covering all of extent loads"); + t.eq(tile.imgDiv.src, "http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&BBOX=-180,-90,180,90&WIDTH=256&HEIGHT=256", "Image covering all of extent loads"); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-80,-45,80,45), url, size); tile.draw() - t.eq(tile.imgDiv.src, "http://www.openlayers.org/dev/tests/tileimage", "Image covering small part of extent loads"); + t.eq(tile.imgDiv.src, "http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&BBOX=-80,-45,80,45&WIDTH=256&HEIGHT=256", "Image covering small part of extent loads"); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-185,-95,185,95), url, size); tile.draw() - t.eq(tile.imgDiv.src, "http://www.openlayers.org/dev/tests/tileimage", "Image covering more than all of extent loads"); + t.eq(tile.imgDiv.src, "http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&BBOX=-185,-95,185,95&WIDTH=256&HEIGHT=256", "Image covering more than all of extent loads"); layer.displayOutsideMaxExtent=1; tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-185,-90,-180,90), url, size); tile.draw() - t.eq(tile.imgDiv.src, "http://www.openlayers.org/dev/tests/tileimage", "Images against side of maxextent do load with displayOutsideMaxExtent"); + t.eq(tile.imgDiv.src, "http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&BBOX=-185,-90,-180,90&WIDTH=256&HEIGHT=256", "Images against side of maxextent do load with displayOutsideMaxExtent"); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-181,-90,180,90), url, size); tile.draw() - t.eq(tile.imgDiv.src, "http://www.openlayers.org/dev/tests/tileimage", "Images over edges of maxextent do load with displayOutsideMaxExtent set"); + t.eq(tile.imgDiv.src, "http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&BBOX=-181,-90,180,90&WIDTH=256&HEIGHT=256", "Images over edges of maxextent do load with displayOutsideMaxExtent set"); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-180,-90,180,90), url, size); tile.draw() - t.eq(tile.imgDiv.src, "http://www.openlayers.org/dev/tests/tileimage", "Image covering all of extent loads with display outside max extent"); + t.eq(tile.imgDiv.src, "http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&BBOX=-180,-90,180,90&WIDTH=256&HEIGHT=256", "Image covering all of extent loads with display outside max extent"); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-80,-45,80,45), url, size); tile.draw() - t.eq(tile.imgDiv.src, "http://www.openlayers.org/dev/tests/tileimage", "Image covering small part of extent loads with display outside max extent"); + t.eq(tile.imgDiv.src, "http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&BBOX=-80,-45,80,45&WIDTH=256&HEIGHT=256", "Image covering small part of extent loads with display outside max extent"); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-185,-95,185,95), url, size); tile.draw() - t.eq(tile.imgDiv.src, "http://www.openlayers.org/dev/tests/tileimage", "Image covering more than all of extent loads"); + t.eq(tile.imgDiv.src, "http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&BBOX=-185,-95,185,95&WIDTH=256&HEIGHT=256", "Image covering more than all of extent loads"); } + function test_04_Tile_Image_Display_After_Move(t) { + t.plan(3); + var position = new OpenLayers.Pixel(20,30); + var bounds = new OpenLayers.Bounds(1,2,3,4); + var url = "http://www.openlayers.org/dev/tests/tileimage"; + var size = new OpenLayers.Size(5,6); + var map = new OpenLayers.Map('map'); + var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", + "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}); + map.addLayer(layer); + map.zoomToMaxExtent(); + tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-90,-85,-90,85), url, size); + tile.draw(); + tile.moveTo(new OpenLayers.Bounds(-185,-90,-180,-80), new OpenLayers.Pixel(-180,-85), true); + t.delay_call( 1, function() { t.eq(tile.imgDiv.style.display, 'none', "Tile display is set to none.") } ); + var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", + "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}, {'alpha':true}); + map.addLayer(layer); + tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-90,-85,-90,85), url, size); + tile.draw(); + tile.moveTo(new OpenLayers.Bounds(-185,-90,-180,-80), new OpenLayers.Pixel(-180,-85), true) + t.ok(tile.imgDiv.firstChild.src != tile.url, "Check to make sure that the alpha image URL really is different"); + t.delay_call( 1, function() { t.eq(tile.imgDiv.style.display, 'none', "Alpha tile display is set to none.") } ); + + } // --> diff --git a/theme/default/style.css b/theme/default/style.css index 4daae6020e..89deaa2cde 100644 --- a/theme/default/style.css +++ b/theme/default/style.css @@ -1,3 +1,16 @@ +div.olMapViewport { + -moz-user-select: none +} + +.olLayerGoogleCopyright { + left: 2px; + bottom: 2px; +} +.olLayerGooglePoweredBy { + left: 2px; + bottom: 15px; +} + .olControlScale { right: 3px; bottom: 3em; @@ -10,14 +23,7 @@ display: block; position: absolute; } -.olLayerGoogleCopyright { - left: 2px; - bottom: 2px; -} -.olLayerGooglePoweredBy { - left: 2px; - bottom: 15px; -} + div.olControlMousePosition { bottom: 0em; right: 3px; @@ -26,3 +32,48 @@ div.olControlMousePosition { font-family: Arial; font-size: smaller; } + +.olControlOverviewMapContainer { + position: absolute; + bottom: 0px; + right: 0px; +} + +.olControlOverviewMapElement { + padding: 10px 18px 10px 10px; + background-color: #00008B; + -moz-border-radius: 1em 0 0 0; +} + +.olControlOverviewMapMinimizeButton { + right: 0px; + bottom: 80px; +} + +.olControlOverviewMapMaximizeButton { + right: 0px; + bottom: 80px; +} + +.olControlOverviewMapExtentRectangle { + border: 2px dotted red; +} +.olLayerGeoRSSDescription { + float:left; + width:100%; + overflow:auto; + font-size:1.0em; +} +.olLayerGeoRSSClose { + float:right; + color:gray; + font-size:1.2em; + font-family:sans-serif; +} +.olLayerGeoRSSTitle { + float:left;font-size:1.2em; +} + +.olPopupContent { + padding:5px; +}