Compare commits

..

2 Commits

Author SHA1 Message Date
crschmidt
35c469e84c Tagging the 2.8 rc1 Release
git-svn-id: http://svn.openlayers.org/tags/openlayers/release-2.8-rc1@9311 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-04-20 15:27:28 +00:00
crschmidt
7884e9527f Branching for the 2.8 Release
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.8@9310 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-04-20 15:27:13 +00:00
327 changed files with 8126 additions and 33177 deletions

View File

@@ -74,7 +74,6 @@ Group: OpenLayers {
File: DrawFeature (no auto-title, OpenLayers/Control/DrawFeature.js)
File: EditingToolbar (no auto-title, OpenLayers/Control/EditingToolbar.js)
File: GetFeature (no auto-title, OpenLayers/Control/GetFeature.js)
File: Graticule (OpenLayers/Control/Graticule.js)
File: KeyboardDefaults (no auto-title, OpenLayers/Control/KeyboardDefaults.js)
File: LayerSwitcher (no auto-title, OpenLayers/Control/LayerSwitcher.js)
File: Measure (no auto-title, OpenLayers/Control/Measure.js)
@@ -97,7 +96,6 @@ Group: OpenLayers {
File: SelectFeature (no auto-title, OpenLayers/Control/SelectFeature.js)
File: Snapping (no auto-title, OpenLayers/Control/Snapping.js)
File: Split (no auto-title, OpenLayers/Control/Split.js)
File: WMSGetFeatureInfo (OpenLayers/Control/WMSGetFeatureInfo.js)
File: ZoomBox (no auto-title, OpenLayers/Control/ZoomBox.js)
File: ZoomIn (no auto-title, OpenLayers/Control/ZoomIn.js)
File: ZoomOut (no auto-title, OpenLayers/Control/ZoomOut.js)
@@ -126,13 +124,6 @@ Group: OpenLayers {
Group: Format {
File: Format (no auto-title, OpenLayers/Format.js)
File: ArcXML (no auto-title, OpenLayers/Format/ArcXML.js)
File: ArcXML.Features (no auto-title, OpenLayers/Format/ArcXML/Features.js)
File: Atom (no auto-title, OpenLayers/Format/Atom.js)
File: CSWGetDomain.DEFAULTS (no auto-title, OpenLayers/Format/CSWGetDomain.js)
File: CSWGetDomain.v2_0_2 (no auto-title, OpenLayers/Format/CSWGetDomain/v2_0_2.js)
File: CSWGetRecords.DEFAULTS (no auto-title, OpenLayers/Format/CSWGetRecords.js)
File: CSWGetRecords.v2_0_2 (no auto-title, OpenLayers/Format/CSWGetRecords/v2_0_2.js)
Group: Filter {
@@ -142,9 +133,6 @@ Group: OpenLayers {
File: v1_1_0 (OpenLayers/Format/Filter/v1_1_0.js)
} # Group: Filter
File: GeoJSON (no auto-title, OpenLayers/Format/GeoJSON.js)
File: GeoRSS (no auto-title, OpenLayers/Format/GeoRSS.js)
Group: GML {
File: GML (no auto-title, OpenLayers/Format/GML.js)
@@ -153,12 +141,6 @@ Group: OpenLayers {
File: v3 (no auto-title, OpenLayers/Format/GML/v3.js)
} # Group: GML
File: GPX (no auto-title, OpenLayers/Format/GPX.js)
File: JSON (no auto-title, OpenLayers/Format/JSON.js)
File: KML (no auto-title, OpenLayers/Format/KML.js)
File: OSM (no auto-title, OpenLayers/Format/OSM.js)
File: OWSCommon.v1_1_0 (OpenLayers/Format/OWSCommon/v1_1_0.js)
Group: SLD {
File: SLD (no auto-title, OpenLayers/Format/SLD.js)
@@ -166,32 +148,6 @@ Group: OpenLayers {
File: v1_0_0 (no auto-title, OpenLayers/Format/SLD/v1_0_0.js)
} # Group: SLD
File: SOSCapabilities (OpenLayers/Format/SOSCapabilities.js)
File: SOSCapabilities.v1_0_0 (OpenLayers/Format/SOSCapabilities/v1_0_0.js)
File: SOSGetObservation (OpenLayers/Format/SOSGetObservation.js)
File: Text (no auto-title, OpenLayers/Format/Text.js)
File: WFS (no auto-title, OpenLayers/Format/WFS.js)
Group: WFSCapabilities {
File: WFSCapabilities (no auto-title, OpenLayers/Format/WFSCapabilities.js)
File: v1 (no auto-title, OpenLayers/Format/WFSCapabilities/v1.js)
File: v1_0_0 (no auto-title, OpenLayers/Format/WFSCapabilities/v1_0_0.js)
File: v1_1_0 (no auto-title, OpenLayers/Format/WFSCapabilities/v1_1_0.js)
} # Group: WFSCapabilities
File: WFSDescribeFeatureType (no auto-title, OpenLayers/Format/WFSDescribeFeatureType.js)
Group: WFST {
File: WFST (no auto-title, OpenLayers/Format/WFST.js)
File: v1 (OpenLayers/Format/WFST/v1.js)
File: v1_0_0 (OpenLayers/Format/WFST/v1_0_0.js)
File: v1_1_0 (OpenLayers/Format/WFST/v1_1_0.js)
} # Group: WFST
File: WKT (no auto-title, OpenLayers/Format/WKT.js)
Group: WMC {
File: WMC (no auto-title, OpenLayers/Format/WMC.js)
@@ -200,25 +156,33 @@ Group: OpenLayers {
File: v1_1_0 (no auto-title, OpenLayers/Format/WMC/v1_1_0.js)
} # Group: WMC
Group: WMSCapabilities {
Group: Format {
File: WMSCapabilities (no auto-title, OpenLayers/Format/WMSCapabilities.js)
File: v1 (no auto-title, OpenLayers/Format/WMSCapabilities/v1.js)
File: v1_1 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_1.js)
File: v1_1_0 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_1_0.js)
File: v1_1_1 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_1_1.js)
File: v1_3 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_3.js)
File: v1_3_0 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_3_0.js)
} # Group: WMSCapabilities
File: GeoJSON (no auto-title, OpenLayers/Format/GeoJSON.js)
File: GeoRSS (no auto-title, OpenLayers/Format/GeoRSS.js)
File: GPX (no auto-title, OpenLayers/Format/GPX.js)
File: JSON (no auto-title, OpenLayers/Format/JSON.js)
File: KML (no auto-title, OpenLayers/Format/KML.js)
File: OSM (no auto-title, OpenLayers/Format/OSM.js)
File: Text (no auto-title, OpenLayers/Format/Text.js)
File: WFS (no auto-title, OpenLayers/Format/WFS.js)
File: WFSDescribeFeatureType (OpenLayers/Format/WFSDescribeFeatureType.js)
Group: WMSDescribeLayer {
Group: WFST {
File: WMSDescribeLayer (no auto-title, OpenLayers/Format/WMSDescribeLayer.js)
File: v1_1 (no auto-title, OpenLayers/Format/WMSDescribeLayer/v1_1.js)
} # Group: WMSDescribeLayer
File: WFST (no auto-title, OpenLayers/Format/WFST.js)
File: v1 (OpenLayers/Format/WFST/v1.js)
File: v1_0_0 (OpenLayers/Format/WFST/v1_0_0.js)
File: v1_1_0 (OpenLayers/Format/WFST/v1_1_0.js)
} # Group: WFST
File: WKT (no auto-title, OpenLayers/Format/WKT.js)
File: WMSDescribeLayer (OpenLayers/Format/WMSDescribeLayer.js)
File: WMSDescribeLayer.v1_1 (OpenLayers/Format/WMSDescribeLayer/v1_1.js)
File: WMSGetFeatureInfo (OpenLayers/Format/WMSGetFeatureInfo.js)
File: XML (no auto-title, OpenLayers/Format/XML.js)
} # Group: Format
File: WMSGetFeatureInfo (no auto-title, OpenLayers/Format/WMSGetFeatureInfo.js)
File: XML (no auto-title, OpenLayers/Format/XML.js)
} # Group: Format
Group: Geometry {
@@ -257,10 +221,6 @@ Group: OpenLayers {
Group: Lang {
File: Lang (no auto-title, OpenLayers/Lang.js)
File: ar (no auto-title, OpenLayers/Lang/ar.js)
File: be-tarask (no auto-title, OpenLayers/Lang/be-tarask.js)
File: bg (no auto-title, OpenLayers/Lang/bg.js)
File: br (no auto-title, OpenLayers/Lang/br.js)
File: ca (no auto-title, OpenLayers/Lang/ca.js)
File: cs-CZ (no auto-title, OpenLayers/Lang/cs-CZ.js)
File: da-DK (no auto-title, OpenLayers/Lang/da-DK.js)
@@ -268,35 +228,12 @@ Group: OpenLayers {
File: en (no auto-title, OpenLayers/Lang/en.js)
File: en-CA (no auto-title, OpenLayers/Lang/en-CA.js)
File: es (no auto-title, OpenLayers/Lang/es.js)
File: el (no auto-title, OpenLayers/Lang/el.js)
File: fi (no auto-title, OpenLayers/Lang/fi.js)
File: fr (no auto-title, OpenLayers/Lang/fr.js)
File: fur (no auto-title, OpenLayers/Lang/fur.js)
File: gl (no auto-title, OpenLayers/Lang/gl.js)
File: gsw (no auto-title, OpenLayers/Lang/gsw.js)
File: hr (no auto-title, OpenLayers/Lang/hr.js)
File: hsb (no auto-title, OpenLayers/Lang/hsb.js)
File: hu (no auto-title, OpenLayers/Lang/hu.js)
File: ia (no auto-title, OpenLayers/Lang/ia.js)
File: id (no auto-title, OpenLayers/Lang/id.js)
File: io (no auto-title, OpenLayers/Lang/io.js)
File: is (no auto-title, OpenLayers/Lang/is.js)
File: it (no auto-title, OpenLayers/Lang/it.js)
File: ja (no auto-title, OpenLayers/Lang/ja.js)
File: km (no auto-title, OpenLayers/Lang/km.js)
File: ksh (no auto-title, OpenLayers/Lang/ksh.js)
File: nds (no auto-title, OpenLayers/Lang/nds.js)
File: nb (no auto-title, OpenLayers/Lang/nb.js)
File: nl (no auto-title, OpenLayers/Lang/nl.js)
File: nn (no auto-title, OpenLayers/Lang/nn.js)
File: oc (no auto-title, OpenLayers/Lang/oc.js)
File: pt (no auto-title, OpenLayers/Lang/pt.js)
File: pt-BR (no auto-title, OpenLayers/Lang/pt-BR.js)
File: ru (no auto-title, OpenLayers/Lang/ru.js)
File: sk (no auto-title, OpenLayers/Lang/sk.js)
File: sv-SE (no auto-title, OpenLayers/Lang/sv-SE.js)
File: te (no auto-title, OpenLayers/Lang/te.js)
File: vi (no auto-title, OpenLayers/Lang/vi.js)
File: zh-CN (no auto-title, OpenLayers/Lang/zh-CN.js)
File: zh-TW (no auto-title, OpenLayers/Lang/zh-TW.js)
} # Group: Lang
@@ -305,7 +242,6 @@ Group: OpenLayers {
File: Layer (no auto-title, OpenLayers/Layer.js)
File: ArcGIS93Rest (no auto-title, OpenLayers/Layer/ArcGIS93Rest.js)
File: ArcIMS (no auto-title, OpenLayers/Layer/ArcIMS.js)
File: Boxes (no auto-title, OpenLayers/Layer/Boxes.js)
File: EventPane (no auto-title, OpenLayers/Layer/EventPane.js)
File: FixedZoomLevels (no auto-title, OpenLayers/Layer/FixedZoomLevels.js)
@@ -328,15 +264,13 @@ Group: OpenLayers {
File: TileCache (no auto-title, OpenLayers/Layer/TileCache.js)
File: TMS (no auto-title, OpenLayers/Layer/TMS.js)
File: Vector (no auto-title, OpenLayers/Layer/Vector.js)
File: Vector.RootContainer (no auto-title, OpenLayers/Layer/Vector/RootContainer.js)
File: RootContainer (OpenLayers/Layer/Vector/RootContainer.js)
File: VirtualEarth (no auto-title, OpenLayers/Layer/VirtualEarth.js)
File: WFS (no auto-title, OpenLayers/Layer/WFS.js)
File: WMS (no auto-title, OpenLayers/Layer/WMS.js)
File: WMS.Untiled (no auto-title, OpenLayers/Layer/WMS/Untiled.js)
File: WMS.Post (no auto-title, OpenLayers/Layer/WMS/Post.js)
File: WorldWind (no auto-title, OpenLayers/Layer/WorldWind.js)
File: Yahoo (no auto-title, OpenLayers/Layer/Yahoo.js)
File: XYZ (no auto-title, OpenLayers/Layer/XYZ.js)
} # Group: Layer
File: Map (no auto-title, OpenLayers/Map.js)
@@ -372,9 +306,9 @@ Group: OpenLayers {
Group: WFS {
File: WFS (no auto-title, OpenLayers/Protocol/WFS.js)
File: v1 (no auto-title, OpenLayers/Protocol/WFS/v1.js)
File: v1_0_0 (no auto-title, OpenLayers/Protocol/WFS/v1_0_0.js)
File: v1_1_0 (no auto-title, OpenLayers/Protocol/WFS/v1_1_0.js)
File: v1 (OpenLayers/Protocol/WFS/v1.js)
File: v1_0_0 (OpenLayers/Protocol/WFS/v1_0_0.js)
File: v1_1_0 (OpenLayers/Protocol/WFS/v1_1_0.js)
} # Group: WFS
} # Group: Protocol
@@ -403,7 +337,6 @@ Group: OpenLayers {
File: Cluster (no auto-title, OpenLayers/Strategy/Cluster.js)
File: Fixed (no auto-title, OpenLayers/Strategy/Fixed.js)
File: Paging (no auto-title, OpenLayers/Strategy/Paging.js)
File: Refresh (OpenLayers/Strategy/Refresh.js)
File: Save (OpenLayers/Strategy/Save.js)
} # Group: Strategy
@@ -415,7 +348,6 @@ Group: OpenLayers {
File: Tile (no auto-title, OpenLayers/Tile.js)
File: Image (no auto-title, OpenLayers/Tile/Image.js)
File: WFS (no auto-title, OpenLayers/Tile/WFS.js)
File: IFrame (OpenLayers/Tile/Image/IFrame.js)
} # Group: Tile
File: Tween (no auto-title, OpenLayers/Tween.js)

View File

@@ -74,7 +74,6 @@ Group: OpenLayers {
File: DrawFeature (no auto-title, OpenLayers/Control/DrawFeature.js)
File: EditingToolbar (no auto-title, OpenLayers/Control/EditingToolbar.js)
File: GetFeature (no auto-title, OpenLayers/Control/GetFeature.js)
File: Graticule (OpenLayers/Control/Graticule.js)
File: KeyboardDefaults (no auto-title, OpenLayers/Control/KeyboardDefaults.js)
File: LayerSwitcher (no auto-title, OpenLayers/Control/LayerSwitcher.js)
File: Measure (no auto-title, OpenLayers/Control/Measure.js)
@@ -97,7 +96,6 @@ Group: OpenLayers {
File: SelectFeature (no auto-title, OpenLayers/Control/SelectFeature.js)
File: Snapping (no auto-title, OpenLayers/Control/Snapping.js)
File: Split (no auto-title, OpenLayers/Control/Split.js)
File: WMSGetFeatureInfo (OpenLayers/Control/WMSGetFeatureInfo.js)
File: ZoomBox (no auto-title, OpenLayers/Control/ZoomBox.js)
File: ZoomIn (no auto-title, OpenLayers/Control/ZoomIn.js)
File: ZoomOut (no auto-title, OpenLayers/Control/ZoomOut.js)
@@ -126,13 +124,6 @@ Group: OpenLayers {
Group: Format {
File: Format (no auto-title, OpenLayers/Format.js)
File: ArcXML (no auto-title, OpenLayers/Format/ArcXML.js)
File: ArcXML.Features (no auto-title, OpenLayers/Format/ArcXML/Features.js)
File: Atom (no auto-title, OpenLayers/Format/Atom.js)
File: CSWGetDomain.DEFAULTS (no auto-title, OpenLayers/Format/CSWGetDomain.js)
File: CSWGetDomain.v2_0_2 (no auto-title, OpenLayers/Format/CSWGetDomain/v2_0_2.js)
File: CSWGetRecords.DEFAULTS (no auto-title, OpenLayers/Format/CSWGetRecords.js)
File: CSWGetRecords.v2_0_2 (no auto-title, OpenLayers/Format/CSWGetRecords/v2_0_2.js)
Group: Filter {
@@ -142,9 +133,6 @@ Group: OpenLayers {
File: v1_1_0 (OpenLayers/Format/Filter/v1_1_0.js)
} # Group: Filter
File: GeoJSON (no auto-title, OpenLayers/Format/GeoJSON.js)
File: GeoRSS (no auto-title, OpenLayers/Format/GeoRSS.js)
Group: GML {
File: GML (no auto-title, OpenLayers/Format/GML.js)
@@ -153,12 +141,6 @@ Group: OpenLayers {
File: v3 (no auto-title, OpenLayers/Format/GML/v3.js)
} # Group: GML
File: GPX (no auto-title, OpenLayers/Format/GPX.js)
File: JSON (no auto-title, OpenLayers/Format/JSON.js)
File: KML (no auto-title, OpenLayers/Format/KML.js)
File: OSM (no auto-title, OpenLayers/Format/OSM.js)
File: OWSCommon.v1_1_0 (OpenLayers/Format/OWSCommon/v1_1_0.js)
Group: SLD {
File: SLD (no auto-title, OpenLayers/Format/SLD.js)
@@ -166,32 +148,6 @@ Group: OpenLayers {
File: v1_0_0 (no auto-title, OpenLayers/Format/SLD/v1_0_0.js)
} # Group: SLD
File: SOSCapabilities (OpenLayers/Format/SOSCapabilities.js)
File: SOSCapabilities.v1_0_0 (OpenLayers/Format/SOSCapabilities/v1_0_0.js)
File: SOSGetObservation (OpenLayers/Format/SOSGetObservation.js)
File: Text (no auto-title, OpenLayers/Format/Text.js)
File: WFS (no auto-title, OpenLayers/Format/WFS.js)
Group: WFSCapabilities {
File: WFSCapabilities (no auto-title, OpenLayers/Format/WFSCapabilities.js)
File: v1 (no auto-title, OpenLayers/Format/WFSCapabilities/v1.js)
File: v1_0_0 (no auto-title, OpenLayers/Format/WFSCapabilities/v1_0_0.js)
File: v1_1_0 (no auto-title, OpenLayers/Format/WFSCapabilities/v1_1_0.js)
} # Group: WFSCapabilities
File: WFSDescribeFeatureType (no auto-title, OpenLayers/Format/WFSDescribeFeatureType.js)
Group: WFST {
File: WFST (no auto-title, OpenLayers/Format/WFST.js)
File: v1 (OpenLayers/Format/WFST/v1.js)
File: v1_0_0 (OpenLayers/Format/WFST/v1_0_0.js)
File: v1_1_0 (OpenLayers/Format/WFST/v1_1_0.js)
} # Group: WFST
File: WKT (no auto-title, OpenLayers/Format/WKT.js)
Group: WMC {
File: WMC (no auto-title, OpenLayers/Format/WMC.js)
@@ -200,25 +156,33 @@ Group: OpenLayers {
File: v1_1_0 (no auto-title, OpenLayers/Format/WMC/v1_1_0.js)
} # Group: WMC
Group: WMSCapabilities {
Group: Format {
File: WMSCapabilities (no auto-title, OpenLayers/Format/WMSCapabilities.js)
File: v1 (no auto-title, OpenLayers/Format/WMSCapabilities/v1.js)
File: v1_1 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_1.js)
File: v1_1_0 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_1_0.js)
File: v1_1_1 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_1_1.js)
File: v1_3 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_3.js)
File: v1_3_0 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_3_0.js)
} # Group: WMSCapabilities
File: GeoJSON (no auto-title, OpenLayers/Format/GeoJSON.js)
File: GeoRSS (no auto-title, OpenLayers/Format/GeoRSS.js)
File: GPX (no auto-title, OpenLayers/Format/GPX.js)
File: JSON (no auto-title, OpenLayers/Format/JSON.js)
File: KML (no auto-title, OpenLayers/Format/KML.js)
File: OSM (no auto-title, OpenLayers/Format/OSM.js)
File: Text (no auto-title, OpenLayers/Format/Text.js)
File: WFS (no auto-title, OpenLayers/Format/WFS.js)
File: WFSDescribeFeatureType.js (OpenLayers/Format/WFSDescribeFeatureType.js)
Group: WMSDescribeLayer {
Group: WFST {
File: WMSDescribeLayer (no auto-title, OpenLayers/Format/WMSDescribeLayer.js)
File: v1_1 (no auto-title, OpenLayers/Format/WMSDescribeLayer/v1_1.js)
} # Group: WMSDescribeLayer
File: WFST (no auto-title, OpenLayers/Format/WFST.js)
File: v1 (OpenLayers/Format/WFST/v1.js)
File: v1_0_0 (OpenLayers/Format/WFST/v1_0_0.js)
File: v1_1_0 (OpenLayers/Format/WFST/v1_1_0.js)
} # Group: WFST
File: WKT (no auto-title, OpenLayers/Format/WKT.js)
File: WMSDescribeLayer (OpenLayers/Format/WMSDescribeLayer.js)
File: WMSDescribeLayer.v1_1 (OpenLayers/Format/WMSDescribeLayer/v1_1.js)
File: WMSGetFeatureInfo (OpenLayers/Format/WMSGetFeatureInfo.js)
File: XML (no auto-title, OpenLayers/Format/XML.js)
} # Group: Format
File: WMSGetFeatureInfo (no auto-title, OpenLayers/Format/WMSGetFeatureInfo.js)
File: XML (no auto-title, OpenLayers/Format/XML.js)
} # Group: Format
Group: Geometry {
@@ -257,10 +221,6 @@ Group: OpenLayers {
Group: Lang {
File: Lang (no auto-title, OpenLayers/Lang.js)
File: ar (no auto-title, OpenLayers/Lang/ar.js)
File: be-tarask (no auto-title, OpenLayers/Lang/be-tarask.js)
File: bg (no auto-title, OpenLayers/Lang/bg.js)
File: br (no auto-title, OpenLayers/Lang/br.js)
File: ca (no auto-title, OpenLayers/Lang/ca.js)
File: cs-CZ (no auto-title, OpenLayers/Lang/cs-CZ.js)
File: da-DK (no auto-title, OpenLayers/Lang/da-DK.js)
@@ -268,35 +228,12 @@ Group: OpenLayers {
File: en (no auto-title, OpenLayers/Lang/en.js)
File: en-CA (no auto-title, OpenLayers/Lang/en-CA.js)
File: es (no auto-title, OpenLayers/Lang/es.js)
File: el (no auto-title, OpenLayers/Lang/el.js)
File: fi (no auto-title, OpenLayers/Lang/fi.js)
File: fr (no auto-title, OpenLayers/Lang/fr.js)
File: fur (no auto-title, OpenLayers/Lang/fur.js)
File: gl (no auto-title, OpenLayers/Lang/gl.js)
File: gsw (no auto-title, OpenLayers/Lang/gsw.js)
File: hr (no auto-title, OpenLayers/Lang/hr.js)
File: hsb (no auto-title, OpenLayers/Lang/hsb.js)
File: hu (no auto-title, OpenLayers/Lang/hu.js)
File: ia (no auto-title, OpenLayers/Lang/ia.js)
File: id (no auto-title, OpenLayers/Lang/id.js)
File: io (no auto-title, OpenLayers/Lang/io.js)
File: is (no auto-title, OpenLayers/Lang/is.js)
File: it (no auto-title, OpenLayers/Lang/it.js)
File: ja (no auto-title, OpenLayers/Lang/ja.js)
File: km (no auto-title, OpenLayers/Lang/km.js)
File: ksh (no auto-title, OpenLayers/Lang/ksh.js)
File: nds (no auto-title, OpenLayers/Lang/nds.js)
File: nb (no auto-title, OpenLayers/Lang/nb.js)
File: nl (no auto-title, OpenLayers/Lang/nl.js)
File: nn (no auto-title, OpenLayers/Lang/nn.js)
File: oc (no auto-title, OpenLayers/Lang/oc.js)
File: pt (no auto-title, OpenLayers/Lang/pt.js)
File: pt-BR (no auto-title, OpenLayers/Lang/pt-BR.js)
File: ru (no auto-title, OpenLayers/Lang/ru.js)
File: sk (no auto-title, OpenLayers/Lang/sk.js)
File: sv-SE (no auto-title, OpenLayers/Lang/sv-SE.js)
File: te (no auto-title, OpenLayers/Lang/te.js)
File: vi (no auto-title, OpenLayers/Lang/vi.js)
File: zh-CN (no auto-title, OpenLayers/Lang/zh-CN.js)
File: zh-TW (no auto-title, OpenLayers/Lang/zh-TW.js)
} # Group: Lang
@@ -305,7 +242,6 @@ Group: OpenLayers {
File: Layer (no auto-title, OpenLayers/Layer.js)
File: ArcGIS93Rest (no auto-title, OpenLayers/Layer/ArcGIS93Rest.js)
File: ArcIMS (no auto-title, OpenLayers/Layer/ArcIMS.js)
File: Boxes (no auto-title, OpenLayers/Layer/Boxes.js)
File: EventPane (no auto-title, OpenLayers/Layer/EventPane.js)
File: FixedZoomLevels (no auto-title, OpenLayers/Layer/FixedZoomLevels.js)
@@ -328,15 +264,13 @@ Group: OpenLayers {
File: TileCache (no auto-title, OpenLayers/Layer/TileCache.js)
File: TMS (no auto-title, OpenLayers/Layer/TMS.js)
File: Vector (no auto-title, OpenLayers/Layer/Vector.js)
File: Vector.RootContainer (no auto-title, OpenLayers/Layer/Vector/RootContainer.js)
File: RootContainer (OpenLayers/Layer/Vector/RootContainer.js)
File: VirtualEarth (no auto-title, OpenLayers/Layer/VirtualEarth.js)
File: WFS (no auto-title, OpenLayers/Layer/WFS.js)
File: WMS (no auto-title, OpenLayers/Layer/WMS.js)
File: WMS.Untiled (no auto-title, OpenLayers/Layer/WMS/Untiled.js)
File: WMS.Post (no auto-title, OpenLayers/Layer/WMS/Post.js)
File: WorldWind (no auto-title, OpenLayers/Layer/WorldWind.js)
File: Yahoo (no auto-title, OpenLayers/Layer/Yahoo.js)
File: XYZ (no auto-title, OpenLayers/Layer/XYZ.js)
} # Group: Layer
File: Map (no auto-title, OpenLayers/Map.js)
@@ -372,9 +306,9 @@ Group: OpenLayers {
Group: WFS {
File: WFS (no auto-title, OpenLayers/Protocol/WFS.js)
File: v1 (no auto-title, OpenLayers/Protocol/WFS/v1.js)
File: v1_0_0 (no auto-title, OpenLayers/Protocol/WFS/v1_0_0.js)
File: v1_1_0 (no auto-title, OpenLayers/Protocol/WFS/v1_1_0.js)
File: v1 (OpenLayers/Protocol/WFS/v1.js)
File: v1_0_0 (OpenLayers/Protocol/WFS/v1_0_0.js)
File: v1_1_0 (OpenLayers/Protocol/WFS/v1_1_0.js)
} # Group: WFS
} # Group: Protocol
@@ -403,7 +337,6 @@ Group: OpenLayers {
File: Cluster (no auto-title, OpenLayers/Strategy/Cluster.js)
File: Fixed (no auto-title, OpenLayers/Strategy/Fixed.js)
File: Paging (no auto-title, OpenLayers/Strategy/Paging.js)
File: Refresh (OpenLayers/Strategy/Refresh.js)
File: Save (OpenLayers/Strategy/Save.js)
} # Group: Strategy
@@ -415,7 +348,6 @@ Group: OpenLayers {
File: Tile (no auto-title, OpenLayers/Tile.js)
File: Image (no auto-title, OpenLayers/Tile/Image.js)
File: WFS (no auto-title, OpenLayers/Tile/WFS.js)
File: IFrame (OpenLayers/Tile/Image/IFrame.js)
} # Group: Tile
File: Tween (no auto-title, OpenLayers/Tween.js)

View File

@@ -1,175 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Basic WMS Example via HTTP-POST protocol</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init(){
var sld = '<StyledLayerDescriptor version="1.0.0">';
sld+= '<NamedLayer>';
sld+= '<Name>topp:tasmania_roads</Name>';
sld+= '<UserStyle>';
sld+= '<IsDefault>1</IsDefault>';
sld+= '<FeatureTypeStyle>';
sld+= '<Rule>';
sld+= '<LineSymbolizer>';
sld+= '<Stroke>';
sld+= '<CssParameter name="stroke">';
sld+= '<Literal>#787878</Literal>';
sld+= '</CssParameter>';
sld+= '<CssParameter name="stroke-width">';
sld+= '<Literal>2</Literal>';
sld+= '</CssParameter>';
sld+= '</Stroke>';
sld+= '</LineSymbolizer>';
sld+= '</Rule>';
sld+= '</FeatureTypeStyle>';
sld+= '</UserStyle>';
sld+= '</NamedLayer>';
sld+= '<NamedLayer>';
sld+= '<Name>topp:tasmania_water_bodies</Name>';
sld+= '<UserStyle>';
sld+= '<IsDefault>1</IsDefault>';
sld+= '<FeatureTypeStyle>';
sld+= '<Rule>';
sld+= '<LineSymbolizer>';
sld+= '<Stroke>';
sld+= '<CssParameter name="stroke">';
sld+= '<Literal>#4F94CD</Literal>';
sld+= '</CssParameter>';
sld+= '<CssParameter name="stroke-width">';
sld+= '<Literal>3</Literal>';
sld+= '</CssParameter>';
sld+= '</Stroke>';
sld+= '</LineSymbolizer>';
sld+= '<PolygonSymbolizer>';
sld+= '<Fill>';
sld+= '<CssParameter name="fill">';
sld+= '<Literal>#63B8FF</Literal>';
sld+= '</CssParameter>';
sld+= '</Fill>';
sld+= '</PolygonSymbolizer>';
sld+= '</Rule>';
sld+= '</FeatureTypeStyle>';
sld+= '</UserStyle>';
sld+= '</NamedLayer>';
sld+= '<NamedLayer>';
sld+= '<Name>topp:tasmania_cities</Name>';
sld+= '<UserStyle>';
sld+= '<IsDefault>1</IsDefault>';
sld+= '<FeatureTypeStyle>';
sld+= '<Rule>';
sld+= '<PointSymbolizer>';
sld+= '<Graphic>';
sld+= '<Mark>';
sld+= '<WellKnownName>cross</WellKnownName>';
sld+= '<Fill>';
sld+= '<CssParameter name="fill">';
sld+= '<Literal>#00FF00</Literal>';
sld+= '</CssParameter>';
sld+= '</Fill>';
sld+= '</Mark>';
sld+= '<Size>15</Size>';
sld+= '</Graphic>';
sld+= '</PointSymbolizer>';
sld+= '<TextSymbolizer>';
sld+= '<Label><PropertyName>CITY_NAME</PropertyName></Label>';
sld+= '<Font>';
sld+= '<SvgParameter name="font-size">15</SvgParameter>';
sld+= '</Font>';
sld+= '</TextSymbolizer>';
sld+= '</Rule>';
sld+= '</FeatureTypeStyle>';
sld+= '</UserStyle>';
sld+= '</NamedLayer>';
sld+= '<NamedLayer>';
sld+= '<Name>topp:tasmania_state_boundaries</Name>';
sld+= '<UserStyle>';
sld+= '<IsDefault>1</IsDefault>';
sld+= '<FeatureTypeStyle>';
sld+= '<Rule>';
sld+= '<PolygonSymbolizer>';
sld+= '<Fill>';
sld+= '<CssParameter name="fill">';
sld+= '<Literal>#8B8989</Literal>';
sld+= '</CssParameter>';
sld+= '<CssParameter name="fill-opacity">';
sld+= '<Literal>0.2</Literal>';
sld+= '</CssParameter>';
sld+= '</Fill>';
sld+= '<Stroke>';
sld+= '<CssParameter name="stroke">';
sld+= '<Literal>#FF4040</Literal>';
sld+= '</CssParameter>';
sld+= '<CssParameter name="stroke-width">';
sld+= '<Literal>2</Literal>';
sld+= '</CssParameter>';
sld+= '</Stroke>';
sld+= '</PolygonSymbolizer>';
sld+= '</Rule>';
sld+= '</FeatureTypeStyle>';
sld+= '</UserStyle>';
sld+= '</NamedLayer>';
sld+= '</StyledLayerDescriptor>';
map = new OpenLayers.Map('map');
map.addControl(new OpenLayers.Control.LayerSwitcher());
var layer = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{
layers: 'basic'
}
);
var rcbw = new OpenLayers.Layer.WMS.Post("Roads, Cities, Boundaries, Water",
"http://demo.opengeo.org/geoserver/wms",
{
'layers': 'topp:tasmania_roads,topp:tasmania_water_bodies,topp:tasmania_state_boundaries,topp:tasmania_cities',
transparent: true,
format: 'image/jpeg',
sld_body: sld
},
{
isBaseLayer: false,
unsupportedBrowsers: []
}
);
map.addLayers([layer, rcbw]);
map.setCenter(new OpenLayers.LonLat(146.65748632815,-42.230763671875), 7);
}
</script>
</head>
<body onload="init()">
<h1 id="title">Basic WMS Example via HTTP-POST protocol with a large SLD
included</h1>
<div id="tags"></div>
<div id="shortdesc">Creating a WMS layer with a large SLD in the sld_body</div>
<div id="map" style="width: 512; height: 256; border: 1px solid red;"></div>
<div id="docs">
This example uses a large SLD created on the client side to style a WMS
layer. This example uses a WMS.Post layer which transfers data via the
HTTP-POST protocol. <br>
NOTE: Opera is not able to display transparent tiles with this layer,
and in some Firefox browsers can appear ugly viewport-shaking effects
while dragging arround. Use the 'unsupportedBrowsers' property to
control which browsers should use plain image tiles (like Layer.WMS)
instead. The default setting (["mozilla", "firefox", "opera"])
excludes problematic browsers without removing the ability to use long
request parameters, because all these browsers support long urls via
GET.
</div>
</body>
</html>

View File

@@ -44,7 +44,7 @@
layer = new OpenLayers.Layer.ArcIMS(
"Global Sample Map",
"http://sample.azavea.com/servlet/com.esri.esrimap.Esrimap",
"http://sample.avencia.com/servlet/com.esri.esrimap.Esrimap",
options
);
map.addLayer(layer);

View File

@@ -21,7 +21,7 @@
};
layer = new OpenLayers.Layer.ArcIMS( "Global Sample Map",
"http://sample.azavea.com/servlet/com.esri.esrimap.Esrimap", options );
"http://sample.avencia.com/servlet/com.esri.esrimap.Esrimap", options );
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);

View File

@@ -1,49 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<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" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us"></script>
<script src="../lib/OpenLayers.js"></script>
<script>
var map;
function init(){
map = new OpenLayers.Map("map");
map.addControl(new OpenLayers.Control.LayerSwitcher());
var shaded = new OpenLayers.Layer.VirtualEarth("Shaded", {
type: VEMapStyle.Shaded
});
var hybrid = new OpenLayers.Layer.VirtualEarth("Hybrid", {
type: VEMapStyle.Hybrid
});
var aerial = new OpenLayers.Layer.VirtualEarth("Aerial", {
type: VEMapStyle.Aerial
});
map.addLayers([shaded, hybrid, aerial]);
map.setCenter(new OpenLayers.LonLat(-110, 45), 3);
}
</script>
</head>
<body onload="init()">
<h1 id="title">Bing Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates the use of Bing layers.
</p>
<div id="map" class="smallmap"></div>
<div id="docs">This example demonstrates the ability to create layers using tiles from Bing maps.</div>
</body>
</html>

View File

@@ -1,28 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Canvas Renderer Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
<script src="canvas.js"></script>
</head>
<body onload="init()">
<h1 id="title">Canvas Renderer Example</h1>
<p id="shortdesc">
Demonstrates the use of the canvas renderer with a vector layer.
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
This example shows a vector layer that uses the Canvas renderer
where available. The order of the renderers given in the layer
options is used to locate the first available renderer.
</p>
<p>
See the <a href="canvas.js" target="_blank">canvas.js source</a>
to see how this is done.
</p>
</div>
</body>
</html>

View File

@@ -1,62 +0,0 @@
var map, layer, styleMap;
OpenLayers.ProxyHost = "proxy.cgi?url=";
function init() {
map = new OpenLayers.Map({
div: "map",
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(
-20037508, -20037508, 20037508, 20037508
)
});
var g = new OpenLayers.Layer.Google("Google Layer", {
sphericalMercator: true
});
map.addLayers([g]);
// prepare to style the data
styleMap = new OpenLayers.StyleMap({
strokeColor: "black",
strokeWidth: 2,
strokeOpacity: 0.5,
fillOpacity: 0.2
});
// create a color table for state FIPS code
var colors = ["red", "orange", "yellow", "green", "blue", "purple"];
var code, fips = {};
for(var i=1; i<=66; ++i) {
code = "0" + i;
code = code.substring(code.length - 2);
fips[code] = {fillColor: colors[i % colors.length]};
}
// add unique value rules with your color lookup
styleMap.addUniqueValueRules("default", "STATE_FIPS", fips);
// create a vector layer using the canvas renderer (where available)
var wfs = new OpenLayers.Layer.Vector("States", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:900913",
url: "http://demo.opengeo.org/geoserver/wfs",
featureType: "states",
featureNS: "http://www.openplans.org/topp"
}),
styleMap: styleMap,
renderers: ["Canvas", "SVG", "VML"]
});
map.addLayer(wfs);
// if you want to use Geographic coords, transform to ESPG:900913
var ddBounds = new OpenLayers.Bounds(
-73.839111,40.287907,-68.214111,44.441624
);
map.zoomToExtent(
ddBounds.transform(map.displayProjection, map.getProjectionObject())
);
}

View File

@@ -1,37 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Document Drag Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
function init(){
map = new OpenLayers.Map( 'map', {controls: [
new OpenLayers.Control.Navigation({documentDrag: true}),
new OpenLayers.Control.PanZoom(),
new OpenLayers.Control.ArgParser(),
new OpenLayers.Control.Attribution()
]} );
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{layers: 'basic'} );
map.addLayer(layer);
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<h1 id="title">OpenLayers Document Drag Example</h1>
<div id="tags"></div>
<div id="shortdesc">Keep on dragging even when the mouse cursor moves outside of the map</div>
<div id="map" class="smallmap"></div>
<div id="docs">
This example shows how to make a map draggable outside of the map itself.
</div>
</body>
</html>

View File

@@ -11,15 +11,11 @@
p {
width: 512px;
}
/* avoid pink tiles */
.olImageLoadError {
background-color: transparent !important;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, drawControls;
OpenLayers.Util.onImageLoadErrorColor = "transparent";
function init(){
map = new OpenLayers.Map('map');

View File

@@ -1,90 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Vector Behavior Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init(){
map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0",
{layers: 'basic'}
);
var layer = new OpenLayers.Layer.Vector("POIs", {
strategies: [new OpenLayers.Strategy.BBOX({resFactor: 1.1})],
protocol: new OpenLayers.Protocol.HTTP({
url: "textfile.txt",
format: new OpenLayers.Format.Text()
})
});
map.addLayers([wms, layer]);
map.zoomToMaxExtent();
// Interaction; not needed for initial display.
selectControl = new OpenLayers.Control.SelectFeature(layer);
map.addControl(selectControl);
selectControl.activate();
layer.events.on({
'featureselected': onFeatureSelect,
'featureunselected': onFeatureUnselect
});
}
// Needed only for interaction, not for the display.
function onPopupClose(evt) {
// 'this' is the popup.
selectControl.unselect(this.feature);
}
function onFeatureSelect(evt) {
feature = evt.feature;
popup = new OpenLayers.Popup.FramedCloud("featurePopup",
feature.geometry.getBounds().getCenterLonLat(),
new OpenLayers.Size(100,100),
"<h2>"+feature.attributes.title + "</h2>" +
feature.attributes.description,
null, true, onPopupClose);
feature.popup = popup;
popup.feature = feature;
map.addPopup(popup);
}
function onFeatureUnselect(evt) {
feature = evt.feature;
if (feature.popup) {
popup.feature = null;
map.removePopup(feature.popup);
feature.popup.destroy();
feature.popup = null;
}
}
</script>
</head>
<body onload="init()">
<h1 id="title">Dynamic POIs via a Text Layer</h1>
<p id="shortdesc">
Loading dynamic data from a text file.
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
The vector layer shown uses the BBOX strategy, the HTTP protocol,
and the Text format.
This setup appends "?bbox=west,south,east,north" to every
request. This allows you to configure the location as something
like 'textfile.php', and take the '?bbox=' parameter to select
data from a database or the like.
<br /><br />
There is nothing about this example that limits it to text files;
you can do the same thing with KML, GeoJSON, etc.
<br /><br />
This is an alternative to something like the <a href="http://wiki.openstreetmap.org/index.php/OpenLayers_Dynamic_POI">OpenStreetMap "Dynamic POI"</a> example. The Layer is a standard vector layer, and interaction can be
configured via the SelectFeature control, as you can see in the
latter half of the code, which allows you to open a popup when
a feature is selected.
</div>
</body>
</html>

View File

@@ -26,15 +26,16 @@
);
var dm_wms = new OpenLayers.Layer.WMS(
"Canadian Data",
"DM Solutions Demo",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
{
layers: "bathymetry,land_fn,park,drain_fn,drainage," +
"prov_bound,fedlimit,rail,road,popplace",
transparent: "true",
format: "image/png"
},
{isBaseLayer: false, visibility: false}
transparent: "true", format: "image/png"},
{
minResolution: 0.17578125,
maxResolution: 0.703125
}
);
map.addLayers([ol_wms, jpl_wms, dm_wms]);

View File

@@ -60,21 +60,18 @@
</div>
<p id="shortdesc">
Shows how to use the GetFeature control to select features from a WMS layer.
Shows how to use the GetFeature control to select features from a
WMS layer. Click or drag a box to select features, use the Shift key to
add features to the selection, use the Ctrl key to toggle a feature's
selected status. Note that this control also has a hover option, which is
enabled in this example. This gives you a visual feedback by loading the
feature underneath the mouse pointer from the WFS, but causes a lot of
GetFeature requests to be issued.
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
Click or drag a box to select features, use the Shift key to add
features to the selection, use the Ctrl key to toggle a feature's
selected status. Note that this control also has a hover option, which
is enabled in this example. This gives you a visual feedback by loading
the feature underneath the mouse pointer from the WFS, but causes a lot
of GetFeature requests to be issued.
</p>
</div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,90 +0,0 @@
<html>
<head>
<title>GetFeatureInfo Popup</title>
<script src="../lib/OpenLayers.js"></script>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script>
OpenLayers.ProxyHost = "proxy.cgi?url=";
var map, info;
function load() {
map = new OpenLayers.Map({
div: "map",
maxExtent: new OpenLayers.Bounds(143.834,-43.648,148.479,-39.573)
});
var political = new OpenLayers.Layer.WMS("State Boundaries",
"http://demo.opengeo.org/geoserver/wms",
{'layers': 'topp:tasmania_state_boundaries', transparent: true, format: 'image/gif'},
{isBaseLayer: true}
);
var roads = new OpenLayers.Layer.WMS("Roads",
"http://demo.opengeo.org/geoserver/wms",
{'layers': 'topp:tasmania_roads', transparent: true, format: 'image/gif'},
{isBaseLayer: false}
);
var cities = new OpenLayers.Layer.WMS("Cities",
"http://demo.opengeo.org/geoserver/wms",
{'layers': 'topp:tasmania_cities', transparent: true, format: 'image/gif'},
{isBaseLayer: false}
);
var water = new OpenLayers.Layer.WMS("Bodies of Water",
"http://demo.opengeo.org/geoserver/wms",
{'layers': 'topp:tasmania_water_bodies', transparent: true, format: 'image/gif'},
{isBaseLayer: false}
);
var highlight = new OpenLayers.Layer.Vector("Highlighted Features", {
displayInLayerSwitcher: false,
isBaseLayer: false
});
map.addLayers([political, roads, cities, water, highlight]);
info = new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://demo.opengeo.org/geoserver/wms',
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
map.addPopup(new OpenLayers.Popup.FramedCloud(
"chicken",
map.getLonLatFromPixel(event.xy),
null,
event.text,
null,
true
));
}
}
});
map.addControl(info);
info.activate();
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="load()">
<h1 id="title">Feature Info in Popup</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates the WMSGetFeatureInfo control for fetching information
about a position from WMS (via GetFeatureInfo request). Results
are displayed in a popup.
</p>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -28,7 +28,7 @@
);
var gsat = new OpenLayers.Layer.Google(
"Google Satellite",
{type: G_SATELLITE_MAP, numZoomLevels: 22}
{type: G_SATELLITE_MAP, numZoomLevels: 20}
);
@@ -56,7 +56,7 @@
it is best to simply set your application to use the string "v=2" in
the request, rather than tying your application to an explicit version.</p>
<p>
In order to position the Google attribution div in the default location,
In order to position the Google attribution div in the default ocation,
you must include the extra theme/default/google.css stylesheet.</p>
</div>
</body>

View File

@@ -8,7 +8,7 @@
// user custom graphicname
OpenLayers.Renderer.symbol.lightning = [0,0, 4,2, 6,0, 10,5, 6,3, 4,5, 0,0];
OpenLayers.Renderer.symbol.rectangle = [0,0, 4,0, 4,10, 0,10, 0,0];
OpenLayers.Renderer.symbol.rectangle = [0,0, 10,0, 10,4, 0,4, 0,0];
var map;
@@ -48,8 +48,7 @@
},
"select": {
pointRadius: 20,
fillOpacity: 1,
rotation: 45
fillOpacity: 1
}
});

View File

@@ -1,102 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Graticule Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<style type="text/css">
#map {
width: 600px;
height: 300px;
border: 1px solid black;
float:left;
}
#map2 {
width: 400px;
height: 400px;
border: 1px solid black;
float:left;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script src="http://proj4js.org/lib/proj4js-compressed.js"></script>
<script type="text/javascript">
Proj4js.defs["EPSG:42304"]="+title=Atlas of Canada, LCC +proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs";
var map1, map2;
function init(){
initLonLat();
initProjected();
}
function initLonLat(){
map1 = new OpenLayers.Map('map', {
controls: [
new OpenLayers.Control.Graticule({
numPoints: 2,
labelled: true,
visible: true
}),
new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.Navigation()
]
});
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{layers: 'basic'}, {wrapDateLine: true} );
map1.addLayers([ol_wms]);
if (!map1.getCenter()) map1.zoomToMaxExtent();
};
function initProjected(){
var extent = new OpenLayers.Bounds(-2200000,-712631,3072800,3840000);
var mapOptions = {
controls: [
new OpenLayers.Control.Graticule({
labelled: true,
targetSize: 200
}),
new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.Navigation()
],
//scales: tempScales,
maxExtent: extent,
maxResolution: 50000,
units: 'm',
projection: 'EPSG:42304'
};
map2 = new OpenLayers.Map('map2', mapOptions);
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap", {
layers: "bathymetry",
format: "image/png"
},{
singleTile: true
});
map2.addLayers([dm_wms]);
if (!map2.getCenter()) map2.zoomToExtent(extent);
}
</script>
</head>
<body onload="init()">
<h1 id="title">Graticule Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Adds a Graticule control to the map to display a grid of
latitude and longitude.
</p>
<div id="map" class="smallmap"></div>
<div id="map2" class="smallmap"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -44,7 +44,7 @@
Demonstrates the use of the LayerSwitcher outside of the OpenLayers window.
</p>
<div id="layerswitcher" class="olControlLayerSwitcher"></div>
<div id="layerswitcher"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>This demonstrates use of the LayerSwitcher outside the map div. It also shows use

View File

@@ -84,7 +84,6 @@
var options = {
isBaseLayer: true,
transitionEffect: "resize",
buffer: 1,
useOverlay: false,
useAsyncOverlay: false,
@@ -126,7 +125,7 @@
layer = new OpenLayers.Layer.MapGuide( "MapGuide OS Overlay layer", url, params, options );
map.addLayer(layer);
*/
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.LayerSwitcher({'div':OpenLayers.Util.getElement('layerswitcher')}));
map.zoomToMaxExtent();
}
</script>
@@ -145,6 +144,7 @@
<div id="map" class="smallmap"></div>
<div id="map2">
<div id="layerswitcher"></div>
</div>
</body>
</html>

View File

@@ -24,7 +24,7 @@
</script>
</head>
<body onload="init()">
<h1 id="title">MapServer Layer</h1>
<div id="title">MapServer Layer</div>
<div id="tags"></div>
<div id="shortdesc">Shows MapServer Layer</div>
<div id="map" class="smallmap"></div>

View File

@@ -24,7 +24,7 @@
</script>
</head>
<body>
<h1 id="title">MapServer Single Tile Mode</h1>
<div id="title">MapServer Single Tile Mode</div>
<div id="tags"></div>
<div id="shortdesc">Shows single tile MapServer Layer</div>
<div id="map" class="smallmap"></div>

View File

@@ -39,7 +39,7 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Resize a Marker</h1>
<div id="title">Resize a Marker</div>
<div id="tags"></div>
<div id="shortdesc">Dynamically resize a marker</div>
<div id="map" class="smallmap"></div>

View File

@@ -42,7 +42,7 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Markers Layer Example</h1>
<div id="title">Markers Layer Example</div>
<div id="tags"></div>
<div id="shortdesc">Show markers layer with different markers</div>
<div id="map" class="smallmap"></div>

View File

@@ -16,15 +16,11 @@
#output {
float: right;
}
/* avoid pink tiles */
.olImageLoadError {
background-color: transparent !important;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, measureControls;
OpenLayers.Util.onImageLoadErrorColor = "transparent";
function init(){
map = new OpenLayers.Map('map');

View File

@@ -28,7 +28,7 @@
</script>
</head>
<body onload="init()">
<h1 id="title">MousePosition Control</h1>
<h3 id="title">MousePosition Control</h3>
<p id="shortdesc">
Use the MousePosition Control to display the coordinates of the cursor
inside or outside the map div.

View File

@@ -1,57 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Mousewheel Interval Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
function setCumulative() {
var nav = map.getControlsByClass("OpenLayers.Control.Navigation")[0];
var cumulative = document.getElementById("cumulative");
nav.handlers.wheel.cumulative = cumulative.checked;
}
function init(){
map = new OpenLayers.Map( 'map', {controls: [
new OpenLayers.Control.Navigation(
{mouseWheelOptions: {interval: 100}}
),
new OpenLayers.Control.PanZoom(),
new OpenLayers.Control.ArgParser(),
new OpenLayers.Control.Attribution()
]} );
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{layers: 'basic'} );
map.addLayer(layer);
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<h1 id="title">OpenLayers Mousewheel Interval Example</h1>
<div id="tags"></div>
<div id="shortdesc">Let OpenLayers send less tile requests to the server when wheel-zooming.</div>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>This example shows how to configure the Navigation control to use
the mousewheel in a less server resource consuming way: as long as you
spin the mousewheel, no request will be sent to the server. Instead,
the zoomlevel delta will be recorded. After a delay (in this example
100ms), a zoom action with the cumulated delta will be performed.</p>
<div>
<input id="cumulative" type="checkbox" checked="checked"
onchange="setCumulative()"/>
<label for="cumulative">Cumulative mode. If this mode is deactivated,
only one zoom event will be performed after the delay.</label>
</div>
</div>
</body>
</html>

View File

@@ -54,7 +54,7 @@
</script>
</head>
<body onload="init()">
<h1 id="title">MultiMap Mercator Example</h1>
<h3 id="title">MultiMap Mercator Example</h3>
<p id="shortdesc">
This sphericalMercator example using multimap demonstrates that the
multimap layer does not fully support the sphericalMercator projection at

View File

@@ -29,7 +29,7 @@
</script>
</head>
<body onload="init()">
<h1 id="title">NavToolbar Demo</h1>
<h3 id="title">NavToolbar Demo</h3>
<p id="shortdesc">
Demo the NavToolbar, a subclass of Control.Panel which shows icons for
navigation.

155
examples/openmnnd.html Normal file
View File

@@ -0,0 +1,155 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers: OpenMNND</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
function init(){
OpenLayers.ProxyHost="/proxy/?url=";
map = new OpenLayers.Map('map', {'maxResolution':'auto', maxExtent: new OpenLayers.Bounds(-203349.72008129774,4816309.33,1154786.8041952979,5472346.5), projection: 'EPSG:26915' } );
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
["http://geoint.lmic.state.mn.us/cgi-bin/wms"], {layers: 'fsa'} );
map.addLayer(layer);
wfs_url = "http://prototype.openmnnd.org/cgi-bin/mapserv.exe?map=openmnndwfs/openmnndwfs.map";
wms = new OpenLayers.Layer.WMS("Minnesota Parcels (WMS)", wfs_url, {'layers':'streams', 'transparent': true, 'format':'image/gif'});
map.addLayer(wms);
wfs = new OpenLayers.Layer.WFS("Minnesota Streams (WFS)", wfs_url, {'typename':'streams'}, {ratio:1.25, minZoomLevel:4, style: OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default'])});
// preFeatureInsert can be used to set style before the feature is drawn
wfs.preFeatureInsert= function(feature) { feature.style.strokeWidth="3"; feature.style.strokeColor="blue";
}
wfs.onFeatureInsert = function(feature) {
OpenLayers.Util.getElement('stream_features').innerHTML = feature.layer.features.length;
}
map.addLayer(wfs);
// Or a style can be set on the layer.
pwfsstyle = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
OpenLayers.Util.extend(pwfsstyle, {'fillColor': 'green'});
pwfs = new OpenLayers.Layer.WFS("Minnesota Plat (WFS)", wfs_url,
{'typename':'plat'},
{
ratio:1.25,
minZoomLevel:8,
extractAttributes: true,
style: pwfsstyle
});
pwfs.onFeatureInsert= function(feature) {
OpenLayers.Util.getElement('plat_features').innerHTML = feature.layer.features.length;
}
map.addLayer(pwfs);
rstyle = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
OpenLayers.Util.extend(rstyle, {'strokeColor': 'white', strokeWidth: "4"});
rwfs = new OpenLayers.Layer.WFS("Minnesota Roads (WFS)", wfs_url, {'typename':'roads'},
{ratio:1.25, minZoomLevel:7, extractAttributes: true, style:rstyle});
rwfs.onFeatureInsert= function(feature) {
OpenLayers.Util.getElement('road_features').innerHTML = feature.layer.features.length;
}
map.addLayer(rwfs);
map.events.register('moveend', null, function() {
OpenLayers.Util.getElement('stream_features').innerHTML = "0";
OpenLayers.Util.getElement('road_features').innerHTML = "0";
OpenLayers.Util.getElement('plat_features').innerHTML = "0";
});
var ls = new OpenLayers.Control.LayerSwitcher();
map.addControl(ls);
drawControls = {
selectPlat: new OpenLayers.Control.SelectFeature(pwfs, {callbacks: {'up':feature_info,'over':feature_info_hover}}),
selectRoad: new OpenLayers.Control.SelectFeature(rwfs, {callbacks: {'up':feature_info,'over':feature_info_hover}})
};
for(var key in drawControls) {
map.addControl(drawControls[key]);
}
drawControls.selectPlat.activate();
map.zoomToExtent(new OpenLayers.Bounds(303232.550864,5082911.694856,305885.161263,5084486.682281));
}
function toggleControl(element) {
for(key in drawControls) {
var control = drawControls[key];
if(element.value == key && element.checked) {
control.activate();
} else {
control.deactivate();
}
}
}
var displayedFeature = null;
function feature_info_hover(feature) {
if (displayedFeature != feature &&
(!feature.layer.selectedFeatures.length ||
(feature.layer.selectedFeatures[0] == feature))) {
feature_info(feature);
displayedFeature = feature;
}
}
function feature_info(feature) {
var html = "<ul>";
for(var i in feature.attributes)
html += "<li><b>" + i + "</b>: "+ feature.attributes[i] + "</li>";
html += "</ul>";
OpenLayers.Util.getElement('feature_info').innerHTML = html;
}
</script>
</head>
<body onload="init()">
<h1 id="title">OpenMNND WFS</h1>
<p id="shortdesc">This example shows the use of a WFS service rendered using the OpenLayers vector library.</p>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
This is an example that shows rendering a WFS service using OpenLayer vectors in the browser. The OpenLayers code will download the GML
from the WFS service for each layer, parse it and create features using the OL vector library to draw the features on the map. For
more information on the vector library, please visit <a href="http://trac.openlayers.org/wiki/Documentation/VectorSupport">vector support wiki</a>.
In this example there are 4 layers shown on the map. The base layer and parcel layer are created from a WMS service using the OpenLayers.Layer.WMS object.
The streams, roads, and plat layers are drawn from a WFS service using the OpenLayers.Layer.WFS object.
</p>
<p>
Rendering WFS layers into vectors is possible, but you need to be cautions when showing the features on the map. Testing has shown that when
you renderer more than 200 vectors in the browser the performance decreases dramatically. Also features that have a lot of vertices
can cause performance issues. In this example the parcel layer is rendered as a WMS layer because at the time of developing this example
there where a handful of features that had too many vertices to render without killing the browser resources.
There are a number of properties that can be set for each WFS layer, such color and line weight using style properties such as strokeColor and strokeWidth.
You can also get feature attributes from the WFS services using the extractAttribute property. View the source to see the example code.
</p>
</div>
<div id="info">
<ul>
<li>Streams: Feature Count <span id="stream_features">0</span></li>
<li>Plat: Feature Count <span id="plat_features">0</span></li>
<li>Roads: Feature Count <span id="road_features">0</span></li>
</ul>
<div id="feature_info">
</div>
<ul>
<li>
<input type="radio" name="type" value="selectRoad" id="selectToggle" onclick="toggleControl(this);" />
<label for="selectToggle">select road</label>
</li>
<li>
<input type="radio" name="type" value="selectPlat" id="selectToggle" onclick="toggleControl(this);" checked=checked />
<label for="selectToggle">select polygon</label>
</li>
</ul>
</div>
</body>
</html>

View File

@@ -1,30 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Basic Single WMS Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
function init(){
map = new OpenLayers.Map( 'map');
layer = new OpenLayers.Layer.OSM( "Simple OSM Map");
map.addLayer(layer);
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<h1 id="title">Basic OSM Example</h1>
<div id="tags"></div>
<div id="shortdesc">Show a Simple OSM Map</div>
<div id="map" class="smallmap"></div>
<div id="docs">
This example shows a very simple OSM layout with minimal controls.
</div>
</body>
</html>

View File

@@ -50,7 +50,7 @@
<body onload="init()">
<h1 id="title">Using maxResolution to control overlays</h1>
<h3 id="title">Using maxResolution to control overlays</h3>
<p id="shortdesc">
See how to control the maximum resolution for a markers layer,
causing it to not be displayed beyond a certain point.

View File

@@ -32,13 +32,13 @@
<div id="map2"></div>
<p>The second map has an overview map control that is created with
non-default options. In this case, the mapOptions property of the
control has been set to use non-default projection related properties,
and the layers property has been set to use a layer different from the main
map. In addition, any other properties of the overview map control can be
control has been set to use non-default projection related properties.
In addition, any other properties of the overview map control can be
set in this way.</p>
<script defer="defer" type="text/javascript">
// set up some layers
// create the top map (with default overview map control)
var map1 = new OpenLayers.Map('map1');
var ol = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
@@ -52,25 +52,6 @@
{layers: "landsat7"}
);
// A clone of the above layer that we will use as overview for map2.
// We need to clone jpl before the it gets added to a map, so the
// clone can have its own maxExtent and maxResolution instead of
// getting these settings initialized from map1.
var jplOverview = jpl.clone();
// A more detailled layer of Manhattan for map2
var ny = new OpenLayers.Layer.WMS(
"Manhattan",
"http://demo.opengeo.org/geoserver/wms",
{
layers: 'tiger-ny',
format: 'image/png'
}
);
// create the top map (with default overview map control)
var map1 = new OpenLayers.Map('map1');
map1.addLayers([ol, jpl]);
map1.addControl(new OpenLayers.Control.LayerSwitcher());
@@ -86,30 +67,35 @@
// create the bottom map (with advanced overview map control)
var mapOptions = {
maxExtent: new OpenLayers.Bounds(-8242894.927728, 4965204.031195,
-8227290.161511, 4994963.723637),
maxResolution: 116.24879860156216,
projection: "EPSG:900913",
maxExtent: new OpenLayers.Bounds(33861, 717605, 330846, 1019656),
maxResolution: 296985/1024,
projection: "EPSG:2805",
units: "m"
};
var map2 = new OpenLayers.Map('map2', mapOptions);
map2.addLayers([ny]);
var bos = new OpenLayers.Layer.WMS(
"Boston",
"http://boston.freemap.in/cgi-bin/mapserv",
{
map: '/www/freemap.in/boston/map/gmaps.map',
layers: 'border,water,roads,rapid_transit,buildings',
format: 'png'
}
);
map2.addLayers([bos]);
map2.addControl(new OpenLayers.Control.LayerSwitcher());
// create an overview map control with non-default options
var controlOptions = {
mapOptions: OpenLayers.Util.extend(mapOptions, {
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34)
}),
layers: [jplOverview]
mapOptions: mapOptions
}
var overview2 = new OpenLayers.Control.OverviewMap(controlOptions);
map2.addControl(overview2);
map2.setCenter(new OpenLayers.LonLat(-8233165.3575055, 4980298.21113769), 3);
map2.setCenter(new OpenLayers.LonLat(182500, 868500), 3);
// expand the overview map control
overview2.maximizeControl();

View File

@@ -40,41 +40,6 @@
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
}
</script>
<style type="text/css">
.olControlPanPanel {
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.olControlPanPanel .olControlPanNorthItemInactive {
left: 50%;
margin-left: -9px;
top: 0;
}
.olControlPanPanel .olControlPanSouthItemInactive {
left: 50%;
margin-left: -9px;
top: auto;
bottom: 0;
}
.olControlPanPanel .olControlPanWestItemInactive {
top: 50%;
margin-top: -9px;
left: 0;
}
.olControlPanPanel .olControlPanEastItemInactive {
top: 50%;
margin-top: -9px;
left: auto;
right: 0;
}
.olControlZoomPanel {
left: auto;
right: 23px;
top: 8px;
}
</style>
</head>
<body onload='init();'>
<h1 id="title">Pan and Zoom Panels</h1>

View File

@@ -85,7 +85,7 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Custom Control.Panel</h1>
<h3 id="title">Custom Control.Panel</h3>
<p id="shortdesc">
Create a custom control.panel, styled entirely with
CSS, and add your own controls to it.

View File

@@ -19,8 +19,7 @@ allowedHosts = ['www.openlayers.org', 'openlayers.org',
'labs.metacarta.com', 'world.freemap.in',
'prototype.openmnnd.org', 'geo.openplans.org',
'sigma.openplans.org', 'demo.opengeo.org',
'www.openstreetmap.org', 'sample.azavea.com',
'v-swe.uni-muenster.de:8080']
'www.openstreetmap.org', 'sample.avencia.com']
method = os.environ["REQUEST_METHOD"]

View File

@@ -28,15 +28,11 @@
margin-left: 15em;
position: absolute;
}
/* avoid pink tiles */
.olImageLoadError {
background-color: transparent !important;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, polygonControl;
OpenLayers.Util.onImageLoadErrorColor = "transparent";
function init(){
map = new OpenLayers.Map('map');
@@ -72,7 +68,7 @@
</script>
</head>
<body onload="init()">
<h1 id="title">OpenLayers Regular Polygon Example</h1>
<h2 id="title">OpenLayers Regular Polygon Example</h2>
<p id="shortdesc">
Shows how to use the RegularPolygon handler to draw features with
different numbers of sides.

View File

@@ -79,7 +79,7 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Resize Features Programatically</h1>
<h3 id="title">Resize Features Programatically</h3>
<p id="shortdesc">
Demonstration of how to use the geometry resize methods to
change feature sizes programatically.

View File

@@ -36,7 +36,7 @@
</script>
</head>
<body onload="init()">
<h1 id="title">OpenLayers Restricted Extent Example</h1>
<h3 id="title">OpenLayers Restricted Extent Example</h3>
<p id="shortdesc">
Don't let users drag outside the map extent: instead, limit dragging such
that the extent of the layer is the maximum viewable area.

View File

@@ -21,15 +21,6 @@
);
var vectors = new OpenLayers.Layer.Vector("Vector Layer");
vectors.events.on({
'featureselected': function(feature) {
$('counter').innerHTML = this.selectedFeatures.length;
},
'featureunselected': function(feature) {
$('counter').innerHTML = this.selectedFeatures.length;
},
});
map.addLayers([wmsLayer, vectors]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
@@ -83,17 +74,11 @@
function update() {
var clickout = document.getElementById("clickout").checked;
if(clickout != drawControls.select.clickout) {
drawControls.select.clickout = clickout;
}
var box = document.getElementById("box").checked;
if(box != drawControls.select.box) {
drawControls.select.box = box;
if(drawControls.select.active) {
drawControls.select.deactivate();
drawControls.select.activate();
}
drawControls.select.clickout = clickout;
drawControls.select.box = document.getElementById("box").checked;
if(drawControls.select.active) {
drawControls.select.deactivate();
drawControls.select.activate();
}
}
</script>
@@ -134,7 +119,7 @@
<li>
<input type="radio" name="type" value="select" id="selectToggle"
onclick="toggleControl(this);" />
<label for="selectToggle">select feature (<span id="counter">0</span> features selected)</label>
<label for="selectToggle">select feature</label>
<ul>
<li>
<input id="box" type="checkbox" checked="checked"

View File

@@ -1,179 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
.sosmap {
width: 768px;
height: 512px;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
OpenLayers.ProxyHost = "proxy.cgi?url=";
OpenLayers.Util.extend(OpenLayers.Lang.en,
{
'SOSClientType': "Type",
'SOSClientTime': "Date/time",
'SOSClientLastvalue': "Last value"
}
);
// Example class on how to put all the OpenLayers SOS pieces together
OpenLayers.SOSClient = OpenLayers.Class({
url: null,
map: null,
capsformat: new OpenLayers.Format.SOSCapabilities(),
obsformat: new OpenLayers.Format.SOSGetObservation(),
initialize: function (options) {
OpenLayers.Util.extend(this, options);
var params = {'service': 'SOS', 'request': 'GetCapabilities'};
var paramString = OpenLayers.Util.getParameterString(params);
url = OpenLayers.Util.urlAppend(this.url, paramString);
OpenLayers.Request.GET({url: url,
success: this.parseSOSCaps, scope: this});
},
getFois: function() {
var result = [];
this.offeringCount = 0;
for (var name in this.SOSCapabilities.contents.offeringList) {
var offering = this.SOSCapabilities.contents.offeringList[name];
this.offeringCount++;
for (var i=0, len=offering.featureOfInterestIds.length; i<len; i++) {
var foi = offering.featureOfInterestIds[i];
if (OpenLayers.Util.indexOf(result, foi) === -1) {
result.push(foi);
}
}
}
return result;
},
parseSOSCaps: function(response) {
// cache capabilities for future use
this.SOSCapabilities = this.capsformat.read(response.responseXML || response.responseText);
this.layer = new OpenLayers.Layer.Vector("Stations", {
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.SOS({
formatOptions: {internalProjection: map.getProjectionObject()},
url: this.url,
fois: this.getFois()
})
});
this.map.addLayer(this.layer);
this.ctrl = new OpenLayers.Control.SelectFeature(this.layer,
{scope: this, onSelect: this.onFeatureSelect});
this.map.addControl(this.ctrl);
this.ctrl.activate();
},
getTitleForObservedProperty: function(property) {
for (var name in this.SOSCapabilities.contents.offeringList) {
var offering = this.SOSCapabilities.contents.offeringList[name];
if (offering.observedProperty === property) {
return offering.name;
}
}
},
showPopup: function(response) {
this.count++;
var output = this.obsformat.read(response.responseXML || response.responseText);
this.html += '<tr>';
this.html += '<td width="100">'+this.getTitleForObservedProperty(output.measurements[0].observedProperty)+'</td>';
this.html += '<td>'+output.measurements[0].samplingTime.timeInstant.timePosition+'</td>';
this.html += '<td>'+output.measurements[0].result.value + ' ' + output.measurements[0].result.uom + '</td>';
this.html += '</tr>';
// check if we are done
if (this.count === this.numRequests) {
var html = '<table cellspacing="10"><tbody>';
html += '<tr>';
html += '<th><b>'+OpenLayers.i18n('SOSClientType')+'</b></th>';
html += '<th><b>'+OpenLayers.i18n('SOSClientTime')+'</b></th>';
html += '<th><b>'+OpenLayers.i18n('SOSClientLastvalue')+'</b></th>';
html += '</tr>';
html += this.html;
html += '</tbody></table>';
var popup = new OpenLayers.Popup.FramedCloud("sensor",
this.feature.geometry.getBounds().getCenterLonLat(),
null,
html,
null,
true,
function(e) {
this.hide();
OpenLayers.Event.stop(e);
// unselect so popup can be shown again
this.map.getControlsByClass('OpenLayers.Control.SelectFeature')[0].unselectAll();
}
);
this.feature.popup = popup;
this.map.addPopup(popup);
}
},
onFeatureSelect: function(feature) {
this.feature = feature;
this.count = 0;
this.html = '';
this.numRequests = this.offeringCount;
if (!this.responseFormat) {
for (format in this.SOSCapabilities.operationsMetadata.GetObservation.parameters.responseFormat.allowedValues) {
// look for a text/xml type of format
if (format.indexOf('text/xml') >= 0) {
this.responseFormat = format;
}
}
}
// do a GetObservation request to get the latest values
for (var name in this.SOSCapabilities.contents.offeringList) {
var offering = this.SOSCapabilities.contents.offeringList[name];
var xml = this.obsformat.write({
eventTime: 'latest',
resultModel: 'measurement',
responseMode: 'inline',
procedure: feature.attributes.id,
offering: name,
observedProperty: offering.observedProperty,
responseFormat: this.responseFormat
});
OpenLayers.Request.POST({
url: this.url,
scope: this,
success: this.showPopup,
data: xml
});
}
},
destroy: function () {
},
CLASS_NAME: "OpenLayers.SOSClient"
});
function init(){
map = new OpenLayers.Map( 'map' );
var baseLayer = new OpenLayers.Layer.WMS("Test Layer", "http://labs.metacarta.com/wms/vmap0?", {
layers: "basic"}, {singleTile: true});
var sos = new OpenLayers.SOSClient({map: map, url: 'http://v-swe.uni-muenster.de:8080/WeatherSOS/sos?'});
map.addLayers([baseLayer]);
map.setCenter(new OpenLayers.LonLat(5, 45), 4);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
map.addControl( new OpenLayers.Control.MousePosition() );
}
</script>
</head>
<body onload="init()">
<h1 id="title">SOS client example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows how to connect OpenLayers to a Sensor Observation Service (SOS)
</p>
<div id="map" class="sosmap"></div>
<div id="docs">
<p>This example uses a vector layer with a Protocol.SOS and a fixed Strategy.
</p><p>When clicking on a point feature (the weather stations offered by the SOS), the
latest values for all offerings are displayed in a popup.</p>
</div>
</body>
</html>

View File

@@ -8,11 +8,6 @@
#map {
height: 512px;
}
/* avoid pink tiles */
.olImageLoadError {
background-color: transparent !important;
}
</style>
<script src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>
@@ -25,8 +20,9 @@
// make map available for easy debugging
var map;
// increase reload attempts
// avoid pink tiles
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
OpenLayers.Util.onImageLoadErrorColor = "transparent";
function init(){
var options = {
@@ -106,7 +102,7 @@
"http://world.freemap.in/tiles/",
{'layers': 'factbook-overlay', 'format':'png'},
{
'opacity': 0.4, visibility: false,
'opacity': 0.4,
'isBaseLayer': false,'wrapDateLine': true
}
);

View File

@@ -4,15 +4,10 @@
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<style>
/* avoid pink tiles */
.olImageLoadError {
background-color: transparent !important;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, vectors, split;
OpenLayers.Util.onImageLoadErrorColor = "transparent";
function init(){
map = new OpenLayers.Map('map');

View File

@@ -1,43 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Rule Based Style</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script src="style-rules.js"></script>
</head>
<body onload="init()">
<h1 id="title">Rule Based Style</h1>
<p id="shortdesc">
Use rule based styling to use different symbolizers for different
feature groups.
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
This example uses four rules to render features. Rules are
based on a feature attribute and determine which symbolizer
is applied when rendering a feature. The rules in this example
change which marker is used by providing an externalGraphic
property in the symbolizer.
</p>
The features are labeled with the same attribute that determines
the symbolizer used. You should be able to confirm that the
graphic color corresponds to the range of numbers given below.
</p>
<ul>
<li>0 &lt;= blue &lt; 25
<li>25 &lt;= green &lt; 50
<li>50 &lt;= gold &lt;= 75
<li>75 &lt; red &lt;= 100
</ul>
<p>
See the <a href="style-rules.js" target="_blank">
style-rules.js source</a> to see how this is done.
</p>
</div>
</body>
</html>

View File

@@ -1,99 +0,0 @@
var map;
function init() {
map = new OpenLayers.Map("map");
var wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{layers: "basic"}
);
/**
* Create 50 vector features. Your features would typically be fetched
* from the server. These are created here to demonstrate a rule based
* style. The features are given an attribute named "foo". The value
* of this attribute is an integer that ranges from 0 to 100.
*/
var features = new Array(25);
for (var i=0; i<features.length; i++) {
features[i] = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(
(340 * Math.random()) - 170,
(160 * Math.random()) - 80
), {
foo: 100 * Math.random() | 0
}
);
}
/**
* Here we create a new style object with rules that determine
* which symbolizer will be used to render each feature.
*/
var style = new OpenLayers.Style(
// the first argument is a base symbolizer
// all other symbolizers in rules will extend this one
{
graphicWidth: 21,
graphicHeight: 25,
graphicYOffset: -28, // shift graphic up 28 pixels
label: "${foo}" // label will be foo attribute value
},
// the second argument will include all rules
{
rules: [
new OpenLayers.Rule({
// a rule contains an optional filter
filter: new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.LESS_THAN,
property: "foo", // the "foo" feature attribute
value: 25
}),
// if a feature matches the above filter, use this symbolizer
symbolizer: {
externalGraphic: "../img/marker-blue.png"
}
}),
new OpenLayers.Rule({
filter: new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.BETWEEN,
property: "foo",
lowerBoundary: 25,
upperBoundary: 50
}),
symbolizer: {
externalGraphic: "../img/marker-green.png"
}
}),
new OpenLayers.Rule({
filter: new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.BETWEEN,
property: "foo",
lowerBoundary: 50,
upperBoundary: 75
}),
symbolizer: {
externalGraphic: "../img/marker-gold.png"
}
}),
new OpenLayers.Rule({
// apply this rule if no others apply
elseFilter: true,
symbolizer: {
externalGraphic: "../img/marker.png"
}
})
]
}
);
// create the layer styleMap that uses the above style for all render intents
var vector = new OpenLayers.Layer.Vector("Points", {
styleMap: new OpenLayers.StyleMap(style)
});
vector.addFeatures(features);
map.addLayers([wms, vector]);
map.setCenter(new OpenLayers.LonLat(0, 0), 1);
}

View File

@@ -79,8 +79,4 @@ h6 {
}
#tags {
display: none;
}
#docs p {
margin-bottom: 0.5em;
}
}

View File

@@ -38,21 +38,18 @@
pointRadius: "${type}", // sized according to type attribute
fillColor: "#ffcc66",
strokeColor: "#ff9933",
strokeWidth: 2,
graphicZIndex: 1
strokeWidth: 2
}),
"select": new OpenLayers.Style({
fillColor: "#66ccff",
strokeColor: "#3399ff",
graphicZIndex: 2
strokeColor: "#3399ff"
})
});
// Create a vector layer and give it your style map.
var points = new OpenLayers.Layer.Vector("Points", {
styleMap: myStyles,
rendererOptions: {zIndexing: true}
});
var points = new OpenLayers.Layer.Vector(
'Points', {styleMap: myStyles}
);
points.addFeatures(features);
map.addLayers([wms, points]);

View File

@@ -1,8 +1,13 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Styles Rotation Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
<script type="text/javascript">
@@ -71,16 +76,10 @@
</head>
<body onload="init()">
<h1 id="title">Rotation Style Example</h1>
<p id="shortdesc">
Use the rotation property of a point symbolizer to rotate
point symbolizers.
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
To style point features with rotation, use the rotation property of the
symbolizer. The center of the rotation is the point of the image
specified by graphicXOffset and graphicYOffset. The rotation is
specified in degrees clockwise.
</div>
<p id="shortdesc">To style point features with rotation, use the rotation
property of the symbolizer. The center of the rotation is the point of the
image specified by graphicXOffset and graphicYOffset.</p>
<div id="map"></div>
<div id="docs"/>
</body>
</html>

View File

@@ -25,8 +25,7 @@
new OpenLayers.Rule({
symbolizer: {
graphic: false,
label: "Label for invisible point",
labelSelect: true
label: "Label for invisible point"
},
filter: new OpenLayers.Filter.Comparison({
type: "==",
@@ -51,9 +50,7 @@
stroke: true,
fill: false,
label: "Point without fill",
labelAlign: "rb",
fontColor: "#ff0000",
fontOpacity: 0.4
labelAlign: "rb"
},
filter: new OpenLayers.Filter.Comparison({
type: "==",
@@ -108,13 +105,6 @@
vectorLayer.drawFeature(multiFeature);
map.setCenter(new OpenLayers.LonLat(point.x, point.y), 4);
vectorLayer.addFeatures([pointFeature, polygonFeature, multiFeature]);
var select = new OpenLayers.Control.SelectFeature(vectorLayer, {
selectStyle: OpenLayers.Util.extend(
{fill: true, stroke: true},
OpenLayers.Feature.Vector.style["select"])
});
map.addControl(select);
select.activate();
}
</script>
</head>
@@ -127,8 +117,6 @@
<div id="map" class="smallmap"></div>
<div id="docs">
This example shows how to use symbolizers with defaults for stroke, fill, and graphic.
This also allows to create labels for a feature without the feature rendered. Click on
the label in the middle to see selection of features with labelSelect set to true.
</div>
</body>
</html>

View File

@@ -1,105 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers: Transformation Box</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
<script type="text/javascript">
var map, control;
function init(){
map = new OpenLayers.Map('map', {allOverlays: true});
// context for appropriate scale/resize cursors
var cursors = ["sw-resize", "s-resize", "se-resize",
"e-resize", "ne-resize", "n-resize", "nw-resize", "w-resize"];
var context = {
getCursor: function(feature){
var i = OpenLayers.Util.indexOf(control.handles, feature);
var cursor = "inherit";
if(i !== -1) {
i = (i + 8 + Math.round(control.rotation / 90) * 2) % 8;
cursor = cursors[i];
}
return cursor;
}
};
// a nice style for the transformation box
var style = new OpenLayers.Style({
cursor: "${getCursor}",
pointRadius: 5,
fillColor: "white",
fillOpacity: 1,
strokeColor: "black"
}, {context: context});
// the layer that we want to transform features on
var vectorLayer = new OpenLayers.Layer.Vector("Simple Geometry", {
styleMap: new OpenLayers.StyleMap({
"transform": style
})
});
// create the TransformFeature control, using the renderIntent
// from above
control = new OpenLayers.Control.TransformFeature(vectorLayer, {
renderIntent: "transform"
});
map.addControl(control);
// create a polygon feature from a linear ring of points
var point = new OpenLayers.Geometry.Point(-111.04, 45.68);
var pointList = [];
for(var p=0; p<6; ++p) {
var a = p * (2 * Math.PI) / 7;
var r = Math.random(1) + 2;
var newPoint = new OpenLayers.Geometry.Point(point.x + (r * Math.cos(a)),
point.y + (r * Math.sin(a)));
pointList.push(newPoint);
}
pointList.push(pointList[0]);
var linearRing = new OpenLayers.Geometry.LinearRing(pointList);
var polygonFeature = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Polygon([linearRing]));
map.addLayer(vectorLayer);
map.setCenter(new OpenLayers.LonLat(point.x, point.y), 5);
var anotherFeature = polygonFeature.clone();
polygonFeature.geometry.move(-3, 0);
anotherFeature.geometry.move(3, 0);
vectorLayer.addFeatures([polygonFeature, anotherFeature]);
// start with the transformation box on polygonFeature
control.setFeature(polygonFeature, {rotation: 45, scale: 0.5, ratio: 1.5});
}
</script>
</head>
<body onload="init()">
<h1 id="title">Vector Feature Transformation Box Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the TransformFeature control.
</p>
<div style="text-align: right">
<div dir="rtl" id="map" class="smallmap"></div>
</div>
<div id="docs">
<p>This example shows transformation of vector features with a
tranformation box. Grab one of the handles to resize the feature.
Holding the SHIFT key will preserve the aspect ratio. Position the
mouse right outside one of the corner handles to rotate the feature,
and hold the SHIFT key to only rotate in 45° increments.</p>
<p>In this example, the transformation box has been set on the left
feature, with a rotation preset of 45°. Clicking on the right feature
will set it for transformation, starting with an unrotated box.
Dragging a feature or the box edges will move it around.</p>
</div>
</body>
</html>

View File

@@ -8,24 +8,28 @@
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 12;
var lat = 41;
var lon = 5;
var lat = 40;
var zoom = 15;
var map, velayer, layer, marker;
var map, velayer, layer;
function init(){
map = new OpenLayers.Map( 'map' ,
{controls:[new OpenLayers.Control.MouseDefaults()]});
velayer = new OpenLayers.Layer.VirtualEarth( "VE", {
// turn off animated zooming
animationEnabled: false,
minZoomLevel: 4,
maxZoomLevel: 6,
'type': VEMapStyle.Aerial
});
velayer = new OpenLayers.Layer.VirtualEarth( "VE",
{ minZoomLevel: 4, maxZoomLevel: 6, 'type': VEMapStyle.Aerial});
map.addLayer(velayer);
var twms = new OpenLayers.Layer.WMS( "World Map",
"http://world.freemap.in/cgi-bin/mapserv?",
{ map: '/www/freemap.in/world/map/factbooktrans.map',
transparent:'true',
layers: 'factbook',
'format':'png'},
{'reproject': true});
map.addLayer(twms);
markers = new OpenLayers.Layer.Markers("markers");
map.addLayer(markers);
@@ -35,17 +39,13 @@
}
function add() {
if(!marker) {
marker = new OpenLayers.Marker(new OpenLayers.LonLat(15, 47));
markers.addMarker(marker);
}
marker = new OpenLayers.Marker(new OpenLayers.LonLat(2, 41));
markers.addMarker(marker);
}
function remove() {
if(marker) {
markers.removeMarker(marker);
marker = null;
}
markers.removeMarker(marker);
}
</script>
</head>
@@ -59,7 +59,7 @@
</p>
<div id="map" class="smallmap"></div>
<input type="button" onClick="javascript:add()"value="Add the marker to the map">
<input type="button" onClick="javascript:add()"value="Add the marker from the map">
<input type="button" onClick="javascript:remove()" value="Remove the marker from the map">
<div id="docs">This example demonstrates the ability to add VirtualEarth and the and remove markers.</div>
</body>

View File

@@ -33,9 +33,7 @@
fontSize: "12px",
fontFamily: "Courier New, monospace",
fontWeight: "bold",
labelAlign: "${align}",
labelXOffset: "${xOffset}",
labelYOffset: "${yOffset}"
labelAlign: "${align}"
}}),
renderers: renderer
});
@@ -85,22 +83,6 @@
favColor: 'black',
align: 'rt'
});
// Create a point feature to show the label offset options
var labelOffsetPoint = new OpenLayers.Geometry.Point(-101.04, 35.68);
var labelOffsetFeature = new OpenLayers.Feature.Vector(labelOffsetPoint);
labelOffsetFeature.attributes = {
name: "offset",
age: 22,
favColor: 'blue',
align: "cm",
// positive value moves the label to the right
xOffset: 50,
// negative value moves the label down
yOffset: -15
};
var nullFeature = new OpenLayers.Feature.Vector(null);
nullFeature.attributes = {
name: "toto is some text about the world",
@@ -112,7 +94,7 @@
map.addLayer(vectorLayer);
vectorLayer.drawFeature(multiFeature);
map.setCenter(new OpenLayers.LonLat(point.x, point.y), 3);
vectorLayer.addFeatures([pointFeature, polygonFeature, multiFeature, labelOffsetFeature, nullFeature ]);
vectorLayer.addFeatures([pointFeature, polygonFeature, multiFeature, nullFeature ]);
}
</script>
</head>

View File

@@ -59,7 +59,7 @@
// of the image will be ignored
style_mark.graphicWidth = 24;
style_mark.graphicHeight = 20;
style_mark.graphicXOffset = 10; // default is -(style_mark.graphicWidth/2);
style_mark.graphicXOffset = -(style_mark.graphicWidth/2); // this is the default value
style_mark.graphicYOffset = -style_mark.graphicHeight;
style_mark.externalGraphic = "../img/marker.png";
// graphicTitle only works in Firefox and Internet Explorer
@@ -116,7 +116,9 @@
<p id="shortdesc">
Shows the use of the shows drawing simple vector features, in different styles.
</p>
<div id="map" class="smallmap"></div>
<div style="text-align: right">
<div dir="rtl" id="map" class="smallmap"></div>
</div>
<div id="docs">
<p>This example shows drawing simple vector features -- point, line, polygon
in different styles, created 'manually', by constructing the entire style

View File

@@ -69,8 +69,6 @@
OpenLayers.Util.extend({}, gmlOptions),
out_options
);
var kmlOptionsIn = OpenLayers.Util.extend(
{extractStyles: true}, in_options);
formats = {
'in': {
wkt: new OpenLayers.Format.WKT(in_options),
@@ -78,8 +76,7 @@
georss: new OpenLayers.Format.GeoRSS(in_options),
gml2: new OpenLayers.Format.GML.v2(gmlOptionsIn),
gml3: new OpenLayers.Format.GML.v3(gmlOptionsIn),
kml: new OpenLayers.Format.KML(kmlOptionsIn),
atom: new OpenLayers.Format.Atom(in_options)
kml: new OpenLayers.Format.KML(in_options)
},
'out': {
wkt: new OpenLayers.Format.WKT(out_options),
@@ -87,8 +84,7 @@
georss: new OpenLayers.Format.GeoRSS(out_options),
gml2: new OpenLayers.Format.GML.v2(gmlOptionsOut),
gml3: new OpenLayers.Format.GML.v3(gmlOptionsOut),
kml: new OpenLayers.Format.KML(out_options),
atom: new OpenLayers.Format.Atom(out_options)
kml: new OpenLayers.Format.KML(out_options)
}
};
}
@@ -146,7 +142,7 @@
vectors.addFeatures(features);
map.zoomToExtent(bounds);
var plural = (features.length > 1) ? 's' : '';
element.value = features.length + ' feature' + plural + ' added';
element.value = features.length + ' feature' + plural + ' added'
} else {
element.value = 'Bad input ' + type;
}
@@ -185,7 +181,6 @@
<label for="formatType">Format</label>
<select name="formatType" id="formatType">
<option value="geojson" selected="selected">GeoJSON</option>
<option value="atom">Atom</option>
<option value="kml">KML</option>
<option value="georss">GeoRSS</option>
<option value="gml2">GML (v2)</option>

View File

@@ -58,32 +58,140 @@
background-position: 0px 1px;
}
</style>
<script src="wfs-protocol-transactions.js"></script>
<script type="text/javascript">
var map, wfs;
var DeleteFeature = OpenLayers.Class(OpenLayers.Control, {
initialize: function(layer, options) {
OpenLayers.Control.prototype.initialize.apply(this, [options]);
this.layer = layer;
this.handler = new OpenLayers.Handler.Feature(
this, layer, {click: this.clickFeature}
);
},
clickFeature: function(feature) {
// if feature doesn't have a fid, destroy it
if(feature.fid == undefined) {
this.layer.destroyFeatures([feature]);
} else {
feature.state = OpenLayers.State.DELETE;
this.layer.events.triggerEvent("afterfeaturemodified",
{feature: feature});
feature.renderIntent = "select";
this.layer.drawFeature(feature);
}
},
setMap: function(map) {
this.handler.setMap(map);
OpenLayers.Control.prototype.setMap.apply(this, arguments);
},
CLASS_NAME: "OpenLayers.Control.DeleteFeature"
});
function init() {
OpenLayers.ProxyHost= "proxy.cgi?url=";
map = new OpenLayers.Map('map', {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(
-11593508, 5509847, -11505759, 5557774
),
controls: [
new OpenLayers.Control.PanZoom()
]
});
var gphy = new OpenLayers.Layer.Google(
"Google Physical",
{type: G_PHYSICAL_MAP, sphericalMercator: true}
);
var saveStrategy = new OpenLayers.Strategy.Save();
wfs = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
projection: new OpenLayers.Projection("EPSG:4326"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:4326",
url: "http://demo.opengeo.org/geoserver/wfs",
featureNS : "http://opengeo.org",
featureType: "restricted",
geometryName: "the_geom",
schema: "http://demo.opengeo.org/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=og:restricted"
})
});
map.addLayers([gphy, wfs]);
var panel = new OpenLayers.Control.Panel(
{'displayClass': 'customEditingToolbar'}
);
var navigate = new OpenLayers.Control.Navigation({
title: "Pan Map",
});
var draw = new OpenLayers.Control.DrawFeature(
wfs, OpenLayers.Handler.Polygon,
{
title: "Draw Feature",
displayClass: "olControlDrawFeaturePolygon",
handlerOptions: {multi: true}
}
);
var edit = new OpenLayers.Control.ModifyFeature(wfs, {
title: "Modify Feature",
displayClass: "olControlModifyFeature",
});
var del = new DeleteFeature(wfs, {title: "Delete Feature"});
var save = new OpenLayers.Control.Button({
title: "Save Changes",
trigger: function() {
if(edit.feature) {
edit.selectControl.unselectAll();
}
saveStrategy.save();
},
displayClass: "olControlSaveFeatures"
});
panel.addControls([navigate, save, del, edit, draw]);
panel.defaultControl = navigate;
map.addControl(panel);
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<h1 id="title">WFS Transaction Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Shows the use of the WFS Transactions (WFS-T).
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
The WFS protocol allows for creation of new features and
reading, updating, or deleting of existing features.
</p>
<p>
Use the tools to create, modify, and delete (in order from left
to right) features. Use the save tool (picture of a disk) to
save your changes. Use the navigation tool (hand) to stop
editing and use the mouse for map navigation.
</p>
<p>
See the <a href="wfs-protocol-transactions.js" target="_blank">
wfs-protocol-transactions.js source</a> to see how this is done.
</p>
</div>
</body>
<h1 id="title">WFS Transaction Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the WFS Transactions (WFS-T).
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>The WFS protocol allows for creation of new features and reading,
updating, or deleting of existing features.</p>
<p>Use the tools to create, modify, and delete (in order from left
to right) features. Use the save tool (picture of a disk) to
save your changes. Use the navigation tool (hand) to stop editing
and use the mouse for map navigation.</p>
</div>
</body>
</html>

View File

@@ -1,107 +0,0 @@
var map, wfs;
OpenLayers.ProxyHost = "proxy.cgi?url=";
var DeleteFeature = OpenLayers.Class(OpenLayers.Control, {
initialize: function(layer, options) {
OpenLayers.Control.prototype.initialize.apply(this, [options]);
this.layer = layer;
this.handler = new OpenLayers.Handler.Feature(
this, layer, {click: this.clickFeature}
);
},
clickFeature: function(feature) {
// if feature doesn't have a fid, destroy it
if(feature.fid == undefined) {
this.layer.destroyFeatures([feature]);
} else {
feature.state = OpenLayers.State.DELETE;
this.layer.events.triggerEvent("afterfeaturemodified",
{feature: feature});
feature.renderIntent = "select";
this.layer.drawFeature(feature);
}
},
setMap: function(map) {
this.handler.setMap(map);
OpenLayers.Control.prototype.setMap.apply(this, arguments);
},
CLASS_NAME: "OpenLayers.Control.DeleteFeature"
});
function init() {
map = new OpenLayers.Map('map', {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(
-11593508, 5509847, -11505759, 5557774
),
controls: [
new OpenLayers.Control.PanZoom()
]
});
var gphy = new OpenLayers.Layer.Google(
"Google Physical",
{type: G_PHYSICAL_MAP, sphericalMercator: true}
);
var saveStrategy = new OpenLayers.Strategy.Save();
wfs = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
projection: new OpenLayers.Projection("EPSG:4326"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:4326",
url: "http://demo.opengeo.org/geoserver/wfs",
featureNS : "http://opengeo.org",
featureType: "restricted",
geometryName: "the_geom",
schema: "http://demo.opengeo.org/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=og:restricted"
})
});
map.addLayers([gphy, wfs]);
var panel = new OpenLayers.Control.Panel(
{'displayClass': 'customEditingToolbar'}
);
var navigate = new OpenLayers.Control.Navigation({
title: "Pan Map"
});
var draw = new OpenLayers.Control.DrawFeature(
wfs, OpenLayers.Handler.Polygon,
{
title: "Draw Feature",
displayClass: "olControlDrawFeaturePolygon",
multi: true
}
);
var edit = new OpenLayers.Control.ModifyFeature(wfs, {
title: "Modify Feature",
displayClass: "olControlModifyFeature"
});
var del = new DeleteFeature(wfs, {title: "Delete Feature"});
var save = new OpenLayers.Control.Button({
title: "Save Changes",
trigger: function() {
if(edit.feature) {
edit.selectControl.unselectAll();
}
saveStrategy.save();
},
displayClass: "olControlSaveFeatures"
});
panel.addControls([navigate, save, del, edit, draw]);
panel.defaultControl = navigate;
map.addControl(panel);
map.zoomToMaxExtent();
}

View File

@@ -19,10 +19,10 @@
var layer = new OpenLayers.Layer.Vector("WFS", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: "http://demo.opengeo.org/geoserver/wfs",
url: "http://publicus.opengeo.org/geoserver/wfs",
featureType: "tasmania_roads",
featureNS: "http://www.openplans.org/topp"
})
}),
});
map.addLayers([wms, layer]);

View File

@@ -1,37 +1,114 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WFS Reprojection Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ"></script>
<script src="wfs-reprojection.js"></script>
</head>
<body onload="init()">
<h1 id="title">WFS Reprojection Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the client side reprojection support.
</p>
<head>
<title>WFS Reprojection + Canvas Renderer Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
<script type="text/javascript">
var map, layer, styleMap;
OpenLayers.ProxyHost = "/proxy/?url=";
function init(){
map = new OpenLayers.Map('map', {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34)
});
var g = new OpenLayers.Layer.Google("G", {sphericalMercator: true});
map.addLayers([g]);
// prepare to style the data
styleMap = new OpenLayers.StyleMap({
strokeColor: "black",
strokeWidth: 2,
strokeOpacity: 0.5,
fillOpacity: 0.2
});
// create a color table for state FIPS code
var colors = ["red", "orange", "yellow", "green", "blue", "purple"];
var code, fips = {};
for(var i=1; i<=66; ++i) {
code = "0" + i;
code = code.substring(code.length - 2);
fips[code] = {fillColor: colors[i % colors.length]};
}
// add unique value rules with your color lookup
styleMap.addUniqueValueRules("default", "STATE_FIPS", fips);
// create a wfs layer with a projection different than the map
// (only if your wfs doens't support your map projection)
var wfs = layer = new OpenLayers.Layer.WFS(
"States (SVG)",
"http://sigma.openplans.org/geoserver/ows",
{typename: 'topp:states'},
{
typename: 'states',
featureNS: 'http://www.openplans.org/topp',
projection: new OpenLayers.Projection("EPSG:4326"),
extractAttributes: true,
ratio: 1.2,
styleMap: styleMap
}
);
map.addLayer(wfs);
var wfs = layer = new OpenLayers.Layer.WFS(
"States (Canvas)",
"http://sigma.openplans.org/geoserver/ows",
{typename: 'topp:states'},
{
typename: 'states',
featureNS: 'http://www.openplans.org/topp',
projection: new OpenLayers.Projection("EPSG:4326"),
extractAttributes: true,
ratio: 1.2,
styleMap: styleMap,
renderers: ['Canvas', 'SVG', 'VML']
}
);
map.addLayer(wfs);
map.addControl(new OpenLayers.Control.LayerSwitcher());
// if you want to use Geographic coords, transform to ESPG:900913
var ddBounds = new OpenLayers.Bounds(
-73.839111,40.287907,-68.214111,44.441624
);
map.zoomToExtent(
ddBounds.transform(map.displayProjection, map.getProjectionObject())
);
}
</script>
</head>
<body onload="init()">
<h1 id="title">WFS Reprojection + Canvas Renderer Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the WFS layer reprojection support
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
This example shows client side reprojection. In the case where
the projection of a vector layer differs from the projection of
the map, features are requested in the layer projection and
transformed during parsing. It is assumed that the layer
projection is "native" projection of the data (the coordinate
reference system of the data on the server).
</p>
<p>
Also shown is styleMap for the layer with unique value rules.
Colors are assigned based on the STATE_FIPS attribute.
</p>
<p>
See the <a href="wfs-reprojection.js" target="_blank">
wfs-reprojection.js source</a> to see how this is done.
</p>
</div>
</body>
<div id="docs">
<p>This example shows automatic WFS reprojection, displaying an 'unprojected'
WFS layer projected on the client side over Google Maps. The key configuration
here is the 'projection' option on the WFS layer.</p>
<p>Also shown is styleMap for the layer with unique value rules. Colors
are assigned based on the STATE_FIPS attribute.</p>
<p>Additionally, this map demonstrates the Canvas/SVG renderers in browsers
which support both. See the two different layers in the
LayerSwitcher.</p>
</div>
</body>
</html>

View File

@@ -1,65 +0,0 @@
var map, layer, styleMap;
OpenLayers.ProxyHost = "proxy.cgi?url=";
function init() {
var geographic = new OpenLayers.Projection("EPSG:4326");
var mercator = new OpenLayers.Projection("EPSG:900913");
map = new OpenLayers.Map('map', {
projection: mercator,
units: "m",
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(
-20037508, -20037508, 20037508, 20037508
)
});
var g = new OpenLayers.Layer.Google("Google Layer", {
sphericalMercator: true
});
map.addLayers([g]);
// prepare to style the data
styleMap = new OpenLayers.StyleMap({
strokeColor: "black",
strokeWidth: 2,
strokeOpacity: 0.5,
fillOpacity: 0.2
});
// create a color table for state FIPS code
var colors = ["red", "orange", "yellow", "green", "blue", "purple"];
var code, fips = {};
for(var i=1; i<=66; ++i) {
code = "0" + i;
code = code.substring(code.length - 2);
fips[code] = {fillColor: colors[i % colors.length]};
}
// add unique value rules with your color lookup
styleMap.addUniqueValueRules("default", "STATE_FIPS", fips);
// This server supports server-side reprojection, but we're using WFS 1.0
// here (which doesn't support reprojection) to illustrate client-side
// reprojection.
var wfs = new OpenLayers.Layer.Vector("States", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
version: "1.0.0",
srsName: "EPSG:4326", // this is the default
url: "http://demo.opengeo.org/geoserver/wfs",
featureType: "states",
featureNS: "http://www.openplans.org/topp"
}),
projection: geographic, // specified because it is different than the map
styleMap: styleMap
});
map.addLayer(wfs);
// if you want to use Geographic coords, transform to ESPG:900913
var ddBounds = new OpenLayers.Bounds(
-73.839111,40.287907,-68.214111,44.441624
);
map.zoomToExtent(
ddBounds.transform(geographic, mercator)
);
}

View File

@@ -1,27 +1,45 @@
<html>
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>WFS: United States (GeoServer)</title>
<script src="../lib/OpenLayers.js"></script>
<script src="wfs-states.js"></script>
</head>
<body onload="init()">
<h1 id="title">WFS United States (GeoServer) Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Shows the use of the WFS United States (GeoServer).
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
This example shows the basic use of a vector layer with the
WFS protocol.
</p>
<p>
See the <a href="wfs-states.js" target="_blank">wfs-states.js
source</a> to see how this is done.
</p>
</div>
</body>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>WFS: United States (GeoServer)</title>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
function init(){
OpenLayers.ProxyHost="proxy.cgi?url=";
map = new OpenLayers.Map('map', {controls: [ new OpenLayers.Control.PanZoom(), new OpenLayers.Control.Permalink(), new OpenLayers.Control.MouseDefaults() ]} );
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms-c/Basic.py",
{layers: 'basic'} );
map.addLayer(layer);
layer = new OpenLayers.Layer.WFS( "States WFS",
"http://sigma.openplans.org/geoserver/ows",
{ typename: 'topp:states' } );
map.addLayer(layer);
map.zoomToExtent(new OpenLayers.Bounds(-140.444336,25.115234,-44.438477,50.580078));
}
</script>
</head>
<body onload="init()">
<h1 id="title">WFS United States (GeoServer) Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the WFS United States (GeoServer)
</p>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>
</html>
</div>

View File

@@ -1,24 +0,0 @@
var map;
OpenLayers.ProxyHost = "proxy.cgi?url=";
function init() {
map = new OpenLayers.Map("map");
var base = new OpenLayers.Layer.WMS("OpenLayers WMS",
"http://labs.metacarta.com/wms-c/Basic.py",
{layers: "basic"}
);
map.addLayer(base);
var wfs = new OpenLayers.Layer.Vector("States", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: "http://demo.opengeo.org/geoserver/wfs",
featureType: "states",
featureNS: "http://www.openplans.org/topp"
})
});
map.addLayer(wfs);
map.zoomToExtent(new OpenLayers.Bounds(-140.4, 25.1, -44.4, 50.5));
}

103
examples/wfs-t.html Normal file
View File

@@ -0,0 +1,103 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers: WFS-T</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/Firebug/firebug.js"></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, wfs;
OpenLayers.ProxyHost = "proxy.cgi?url=";
function init() {
map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS(
"State",
"http://sigma.openplans.org/geoserver/wms",
{layers: 'topp:tasmania_state_boundaries'}
);
//
// Word to the Wise from an anonymous OpenLayers hacker:
//
// The typename in the options list when adding/loading a wfs
// layer not should contain the namespace before, (as in the
// first typename parameter to the wfs consctructor).
//
// Specifically, in the first parameter you write typename:
// 'topp:myLayerName', and in the following option list
// typeName: 'myLayerName'.
//
// If you have topp included in the second one you will get
// namespace 14 errors when trying to insert features.
//
wfs = new OpenLayers.Layer.WFS(
"Cities",
"http://sigma.openplans.org/geoserver/wfs",
{typename: 'topp:tasmania_cities'},
{
typename: "tasmania_cities",
featureNS: "http://www.openplans.org/topp",
extractAttributes: false,
commitReport: function(str) {
OpenLayers.Console.log(str);
}
}
);
map.addLayers([wms, wfs]);
var panel = new OpenLayers.Control.Panel({
displayClass: "olControlEditingToolbar"
});
var draw = new OpenLayers.Control.DrawFeature(
wfs, OpenLayers.Handler.Point,
{
handlerOptions: {freehand: false, multi: true},
displayClass: "olControlDrawFeaturePoint"
}
);
var save = new OpenLayers.Control.Button({
trigger: OpenLayers.Function.bind(wfs.commit, wfs),
displayClass: "olControlSaveFeatures"
});
panel.addControls([
new OpenLayers.Control.Navigation(),
save, draw
]);
map.addControl(panel);
map.zoomToExtent(new OpenLayers.Bounds(140.64,-44.42,151.89,-38.80));
}
</script>
</head>
<body onload="init()">
<h1 id="title">WFS Transaction Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use the WFS layer for transactions.
</p>
<div id="map" class="smallmap"></div>
<p id="docs">
This is an example of using a WFS layer type. Note that it requires a
working GeoServer install, which the OpenLayers project does not maintain;
however, if you're interested, you should be able to point this against
a default GeoServer setup without too much trouble.
</p>
</body>
</html>

34
examples/wfs.html Normal file
View File

@@ -0,0 +1,34 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
function init(){
OpenLayers.ProxyHost="/proxy/?url=";
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
layer = new OpenLayers.Layer.WFS( "Owl Survey",
"http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp?",
{typename: "OWLS", maxfeatures: 10},
{ featureClass: OpenLayers.Feature.WFS});
map.addLayer(layer);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(-100, 60), 3);
}
</script>
</head>
<body onload="init()">
<h1 id="title">WFS Points</h1>
<p id='shortdesc'>
Using a Layer.WFS with a featureClass, one can take in XML data
from a WFS class and display it any way you like.
</p>
<div id="map" class="smallmap"></div>
</body>
</html>

View File

@@ -7,18 +7,14 @@
width: 90%;
height: 300px;
}
/* avoid pink tiles */
.olImageLoadError {
background-color: transparent !important;
}
</style>
<script src="../lib/Firebug/firebug.js"></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
// increase reload attempts
// no pink please
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 2;
OpenLayers.Util.onImageLoadErrorColor = "transparent";
var format = new OpenLayers.Format.WMC({'layerOptions': {buffer: 0}});
var doc, context, map;
@@ -105,9 +101,7 @@
} else {
map.destroy();
try {
var jsonFormat = new OpenLayers.Format.JSON();
var mapOptions = jsonFormat.read(OpenLayers.Util.getElement('mapOptions').value);
map = format.read(text, {map: mapOptions});
map = format.read(text, {map: "map"});
map.addControl(new OpenLayers.Control.LayerSwitcher());
} catch(err) {
document.getElementById("wmc").value = err;
@@ -135,10 +129,9 @@
Shows parsing of Web Map Context documents.
</p>
<div id="map" class="smallmap"></div>
<button onclick="writeWMC();">write</button><br />
<button onclick="readWMC();">read as new map</button> with the following extra map options : <input type="text" id="mapOptions" value='{"div": "map", "allOverlays": true}'/><br />
<button onclick="readWMC(true);">read and merge</button><br />
<button onclick="pasteWMC();">try with another WMC document</button><br />
<button onclick="writeWMC();">write</button>
<button onclick="readWMC();">read as new map</button>
<button onclick="readWMC(true);">read and merge</button>
<textarea id="wmc">paste WMC doc here</textarea>
<div id="docs">
This is an example of parsing WMC documents. <br />

View File

@@ -1,52 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, map2;
function init(){
// clear array to simulate a wrong axis order request
map = new OpenLayers.Map( 'map' );
var layer = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi?",
{layers: 'Foundation.GTOPO30', version: '1.3.0'},
{singleTile: true, yx: []}
);
map.addLayer(layer);
map.zoomToMaxExtent();
map2 = new OpenLayers.Map( 'map2' );
var layer2 = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi?",
{layers: 'Foundation.GTOPO30', version: '1.3.0'},
{singleTile: true}
);
map2.addLayer(layer2);
map2.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<h1 id="title"> WMS version 1.3 (axis order) Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows an example of the influence of axis order on WMS 1.3 GetMap requests.
</p>
<div id="map" class="smallmap"></div>
<div id="map2" class="smallmap"></div>
<div id="docs">
WMS version 1.3 introduced the axis order sequence, so that for e.g. EPSG:4326 the bbox coordinate
values need to be flipped (LatLon instead of LonLat). The first map uses the incorrect (WMS 1.1) axis
order against a WMS 1.3 service, resulting in corrupted maps. The second map shows how to correctly
request a map in EPSG:4326 against a WMS 1.3 service.
</div>
</body>
</html>

View File

@@ -16,7 +16,7 @@
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"});
ia_wms = new OpenLayers.Layer.WMS("Nexrad","http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi?",{layers:"nexrad-n0r-wmst",transparent:true,format:'image/png',time:"2005-08-29T13:00:00Z"});
ia_wms = new OpenLayers.Layer.WMS("Nexrad","http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?",{layers:"nexrad-n0r-wmst",transparent:true,format:'image/png',time:"2005-08-29T13:00:00Z"});
jpl_wms.setVisibility(false);

View File

@@ -1,70 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Zoomify Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var zoomify_width = 8001;
var zoomify_height = 6943;
var zoomify_url = "http://almor.mzk.cz/moll/AA22/0103/";
var map, zoomify;
function init(){
/* First we initialize the zoomify pyramid (to get number of tiers) */
var zoomify = new OpenLayers.Layer.Zoomify( "Zoomify", zoomify_url,
new OpenLayers.Size( zoomify_width, zoomify_height ) );
/* Map with raster coordinates (pixels) from Zoomify image */
var options = {
controls: [],
maxExtent: new OpenLayers.Bounds(0, 0, zoomify_width, zoomify_height),
maxResolution: Math.pow(2, zoomify.numberOfTiers-1 ),
numZoomLevels: zoomify.numberOfTiers,
units: 'pixels'
};
map = new OpenLayers.Map("map", options);
map.addLayer(zoomify);
map.addControl(new OpenLayers.Control.MousePosition());
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.MouseDefaults());
map.addControl(new OpenLayers.Control.KeyboardDefaults());
map.setBaseLayer(zoomify);
map.zoomToMaxExtent();
};
</script>
</head>
<body onload="init()">
<h1 id="title">Zoomify Layer Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demo of a layer with Zoomify tiles.
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
Demonstration of the Zoomify layer in OpenLayers.<br />
You can have a look at <a href="http://almor.mzk.cz/moll/AA22/103.html">Zoomify viewer for this picture</a>, which is using the same <a href="http://almor.mzk.cz/moll/AA22/0103/">tiles</a>.
</p>
<p>
For change to our own image you have to specify 'url' (zoomifyImagePath in Zoomify terminology) and 'size' ('width' and 'height' from ImageProperty.xml file).<br />
Custom tiles can be easily generated with original <a href="http://www.zoomify.com/">Zoomify software</a> like with freely available <a href="http://www.zoomify.com/express.htm">ZoomifyerEZ</a> or with Adobe PhotoShop CS3 (it has built in support for export into Zoomify tiles).<br />
There is also a <a href="http://sourceforge.net/projects/zoomifyimage/">ZoomifyImage SourceForge Project</a>, a tile cutter available under GPL license.<br />
Zoomify tiles can be also served dynamically on the server side from JPEG2000 masters using <a href="http://dltj.org/article/introducing-j2ktilerenderer/">J2KTileRender</a> with available integration for DSpace and soon for Fedora Digital Repository.<br/>
<a href="http://iipimage.sourceforge.net/">IIPImage server</a> can serve Zoomify tiles dynamically from TIFF files.
</p>
<p>
Development of the Zoomify support for OpenLayers was supported from the grant <a href="http://www.oldmapsonline.org/">Old Maps Online</a>.
</p>
</div>
</body>
</html>

View File

@@ -17,12 +17,6 @@
*/
var singleFile = (typeof OpenLayers == "object" && OpenLayers.singleFile);
/**
* Cache for the script location returned from
* OpenLayers._getScriptLocation
*/
var scriptLocation;
/**
* Namespace: OpenLayers
* The OpenLayers object provides a namespace for all things OpenLayers
@@ -43,10 +37,7 @@
* {String} Path to this script
*/
_getScriptLocation: function () {
if (scriptLocation != undefined) {
return scriptLocation;
}
scriptLocation = "";
var scriptLocation = "";
var isOL = new RegExp("(^|(.*?\\/))(" + OpenLayers._scriptName + ")(\\?|$)");
var scripts = document.getElementsByTagName('script');
@@ -100,7 +91,6 @@
"OpenLayers/Popup.js",
"OpenLayers/Tile.js",
"OpenLayers/Tile/Image.js",
"OpenLayers/Tile/Image/IFrame.js",
"OpenLayers/Tile/WFS.js",
"OpenLayers/Layer/Image.js",
"OpenLayers/Layer/SphericalMercator.js",
@@ -123,14 +113,12 @@
"OpenLayers/Layer/ArcGIS93Rest.js",
"OpenLayers/Layer/WMS.js",
"OpenLayers/Layer/WMS/Untiled.js",
"OpenLayers/Layer/WMS/Post.js",
"OpenLayers/Layer/ArcIMS.js",
"OpenLayers/Layer/GeoRSS.js",
"OpenLayers/Layer/Boxes.js",
"OpenLayers/Layer/XYZ.js",
"OpenLayers/Layer/TMS.js",
"OpenLayers/Layer/TileCache.js",
"OpenLayers/Layer/Zoomify.js",
"OpenLayers/Popup/Anchored.js",
"OpenLayers/Popup/AnchoredBubble.js",
"OpenLayers/Popup/Framed.js",
@@ -178,8 +166,6 @@
"OpenLayers/Control/NavigationHistory.js",
"OpenLayers/Control/Measure.js",
"OpenLayers/Control/WMSGetFeatureInfo.js",
"OpenLayers/Control/Graticule.js",
"OpenLayers/Control/TransformFeature.js",
"OpenLayers/Geometry.js",
"OpenLayers/Geometry/Rectangle.js",
"OpenLayers/Geometry/Collection.js",
@@ -205,12 +191,6 @@
"OpenLayers/Strategy/Paging.js",
"OpenLayers/Strategy/BBOX.js",
"OpenLayers/Strategy/Save.js",
"OpenLayers/Strategy/Refresh.js",
"OpenLayers/Filter.js",
"OpenLayers/Filter/FeatureId.js",
"OpenLayers/Filter/Logical.js",
"OpenLayers/Filter/Comparison.js",
"OpenLayers/Filter/Spatial.js",
"OpenLayers/Protocol.js",
"OpenLayers/Protocol/HTTP.js",
"OpenLayers/Protocol/SQL.js",
@@ -219,13 +199,16 @@
"OpenLayers/Protocol/WFS/v1.js",
"OpenLayers/Protocol/WFS/v1_0_0.js",
"OpenLayers/Protocol/WFS/v1_1_0.js",
"OpenLayers/Protocol/SOS.js",
"OpenLayers/Protocol/SOS/v1_0_0.js",
"OpenLayers/Layer/PointTrack.js",
"OpenLayers/Layer/GML.js",
"OpenLayers/Style.js",
"OpenLayers/StyleMap.js",
"OpenLayers/Rule.js",
"OpenLayers/Filter.js",
"OpenLayers/Filter/FeatureId.js",
"OpenLayers/Filter/Logical.js",
"OpenLayers/Filter/Comparison.js",
"OpenLayers/Filter/Spatial.js",
"OpenLayers/Format.js",
"OpenLayers/Format/XML.js",
"OpenLayers/Format/ArcXML.js",
@@ -234,7 +217,6 @@
"OpenLayers/Format/GML/Base.js",
"OpenLayers/Format/GML/v2.js",
"OpenLayers/Format/GML/v3.js",
"OpenLayers/Format/Atom.js",
"OpenLayers/Format/KML.js",
"OpenLayers/Format/GeoRSS.js",
"OpenLayers/Format/WFS.js",
@@ -255,10 +237,7 @@
"OpenLayers/Format/SLD.js",
"OpenLayers/Format/SLD/v1.js",
"OpenLayers/Format/SLD/v1_0_0.js",
"OpenLayers/Format/CSWGetDomain.js",
"OpenLayers/Format/CSWGetDomain/v2_0_2.js",
"OpenLayers/Format/CSWGetRecords.js",
"OpenLayers/Format/CSWGetRecords/v2_0_2.js",
"OpenLayers/Format/SLD/v1.js",
"OpenLayers/Format/WFST.js",
"OpenLayers/Format/WFST/v1.js",
"OpenLayers/Format/WFST/v1_0_0.js",
@@ -271,18 +250,10 @@
"OpenLayers/Format/WMC/v1_0_0.js",
"OpenLayers/Format/WMC/v1_1_0.js",
"OpenLayers/Format/WMSCapabilities.js",
"OpenLayers/Format/WMSCapabilities/v1.js",
"OpenLayers/Format/WMSCapabilities/v1_1.js",
"OpenLayers/Format/WMSCapabilities/v1_1_0.js",
"OpenLayers/Format/WMSCapabilities/v1_1_1.js",
"OpenLayers/Format/WMSCapabilities/v1_3.js",
"OpenLayers/Format/WMSCapabilities/v1_3_0.js",
"OpenLayers/Format/WMSGetFeatureInfo.js",
"OpenLayers/Format/OWSCommon/v1_1_0.js",
"OpenLayers/Format/SOSCapabilities.js",
"OpenLayers/Format/SOSCapabilities/v1_0_0.js",
"OpenLayers/Format/SOSGetObservation.js",
"OpenLayers/Format/SOSGetFeatureOfInterest.js",
"OpenLayers/Layer/WFS.js",
"OpenLayers/Control/GetFeature.js",
"OpenLayers/Control/MouseToolbar.js",

View File

@@ -43,7 +43,7 @@ OpenLayers.nullHandler = function(request) {
};
/**
* APIFunction: OpenLayers.loadURL
* APIFunction: loadURL
* Background load a document. For more flexibility in using XMLHttpRequest,
* see the <OpenLayers.Request> methods.
*
@@ -84,7 +84,7 @@ OpenLayers.loadURL = function(uri, params, caller,
};
/**
* Function: OpenLayers.parseXMLString
* Function: parseXMLString
* Parse XML into a doc structure
*
* Parameters:

View File

@@ -162,7 +162,7 @@ OpenLayers.String = {
* Used to find tokens in a string.
* Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
*/
tokenRegEx: /\$\{([\w.]+?)\}/g,
tokenRegEx: /\${([\w.]+?)}/g,
/**
* Property: OpenLayers.String.numberRegEx
@@ -431,38 +431,6 @@ OpenLayers.Function = {
return function(event) {
return func.call(object, event || window.event);
};
},
/**
* APIFunction: False
* A simple function to that just does "return false". We use this to
* avoid attaching anonymous functions to DOM event handlers, which
* causes "issues" on IE<8.
*
* Usage:
* document.onclick = OpenLayers.Function.False;
*
* Returns:
* {Boolean}
*/
False : function() {
return false;
},
/**
* APIFunction: True
* A simple function to that just does "return true". We use this to
* avoid attaching anonymous functions to DOM event handlers, which
* causes "issues" on IE<8.
*
* Usage:
* document.onclick = OpenLayers.Function.True;
*
* Returns:
* {Boolean}
*/
True : function() {
return true;
}
};

View File

@@ -128,18 +128,11 @@ OpenLayers.Bounds = OpenLayers.Class({
/**
* APIMethod: toArray
*
* Parameters:
* reverseAxisOrder - {Boolean} Should we reverse the axis order?
*
* Returns:
* {Array} array of left, bottom, right, top
*/
toArray: function(reverseAxisOrder) {
if (reverseAxisOrder === true) {
return [this.bottom, this.left, this.top, this.right];
} else {
return [this.left, this.bottom, this.right, this.top];
}
toArray: function() {
return [this.left, this.bottom, this.right, this.top];
},
/**
@@ -148,26 +141,22 @@ OpenLayers.Bounds = OpenLayers.Class({
* Parameters:
* decimal - {Integer} How many significant digits in the bbox coords?
* Default is 6
* reverseAxisOrder - {Boolean} Should we reverse the axis order?
*
* Returns:
* {String} Simple String representation of bounds object.
* (ex. <i>"5,42,10,45"</i>)
*/
toBBOX:function(decimal, reverseAxisOrder) {
toBBOX:function(decimal) {
if (decimal== null) {
decimal = 6;
}
var mult = Math.pow(10, decimal);
var xmin = Math.round(this.left * mult) / mult;
var ymin = Math.round(this.bottom * mult) / mult;
var xmax = Math.round(this.right * mult) / mult;
var ymax = Math.round(this.top * mult) / mult;
if (reverseAxisOrder === true) {
return ymin + "," + xmin + "," + ymax + "," + xmax;
} else {
return xmin + "," + ymin + "," + xmax + "," + ymax;
}
var bbox = Math.round(this.left * mult) / mult + "," +
Math.round(this.bottom * mult) / mult + "," +
Math.round(this.right * mult) / mult + "," +
Math.round(this.top * mult) / mult;
return bbox;
},
/**
@@ -265,6 +254,8 @@ OpenLayers.Bounds = OpenLayers.Class({
if(origin == null){
origin = this.getCenterLonLat();
}
var bounds = [];
var origx,origy;

View File

@@ -93,7 +93,6 @@ OpenLayers.Element = {
/**
* APIFunction: getDimensions
* *Deprecated*. Returns dimensions of the element passed in.
*
* Parameters:
* element - {DOMElement}
@@ -113,13 +112,12 @@ OpenLayers.Element = {
var els = element.style;
var originalVisibility = els.visibility;
var originalPosition = els.position;
var originalDisplay = els.display;
els.visibility = 'hidden';
els.position = 'absolute';
els.display = '';
var originalWidth = element.clientWidth;
var originalHeight = element.clientHeight;
els.display = originalDisplay;
els.display = 'none';
els.position = originalPosition;
els.visibility = originalVisibility;
return {width: originalWidth, height: originalHeight};

View File

@@ -105,13 +105,6 @@ OpenLayers.Control = OpenLayers.Class({
*/
title: "",
/**
* APIProperty: autoActivate
* {Boolean} Activate the control when it is added to a map. Default is
* false.
*/
autoActivate: false,
/**
* Property: active
* {Boolean} The control is active.
@@ -265,7 +258,7 @@ OpenLayers.Control = OpenLayers.Class({
if (!this.allowSelection) {
this.div.className += " olControlNoSelect";
this.div.setAttribute("unselectable", "on", 0);
this.div.onselectstart = OpenLayers.Function.False;
this.div.onselectstart = function() { return(false); };
}
if (this.title != "") {
this.div.title = this.title;

View File

@@ -22,7 +22,7 @@ OpenLayers.Control.Attribution =
* {String} String used to seperate layers.
*/
separator: ", ",
/**
* Constructor: OpenLayers.Control.Attribution
*
@@ -81,13 +81,9 @@ OpenLayers.Control.Attribution =
for(var i=0, len=this.map.layers.length; i<len; i++) {
var layer = this.map.layers[i];
if (layer.attribution && layer.getVisibility()) {
// add attribution only if attribution text is unique
if (OpenLayers.Util.indexOf(
attributions, layer.attribution) === -1) {
attributions.push( layer.attribution );
}
attributions.push( layer.attribution );
}
}
}
this.div.innerHTML = attributions.join(this.separator);
}
},

View File

@@ -64,13 +64,6 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
*/
onComplete: function(feature, pixel) {},
/**
* APIProperty: documentDrag
* {Boolean} If set to true, mouse dragging will continue even if the
* mouse cursor leaves the map viewport. Default is false.
*/
documentDrag: false,
/**
* Property: layer
* {<OpenLayers.Layer.Vector>}
@@ -122,9 +115,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
up: this.upFeature,
out: this.cancel,
done: this.doneDragging
}, this.dragCallbacks), {
documentDrag: this.documentDrag
}
}, this.dragCallbacks)
),
feature: new OpenLayers.Handler.Feature(
this, this.layer, OpenLayers.Util.extend({

View File

@@ -34,14 +34,7 @@ OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, {
* panning the map again. Set this to increase dragging performance.
* Defaults to 25 milliseconds.
*/
interval: 25,
/**
* APIProperty: documentDrag
* {Boolean} If set to true, mouse dragging will continue even if the
* mouse cursor leaves the map viewport. Default is false.
*/
documentDrag: false,
interval: 25,
/**
* Method: draw
@@ -53,8 +46,7 @@ OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, {
"move": this.panMap,
"done": this.panMapDone
}, {
interval: this.interval,
documentDrag: this.documentDrag
interval: this.interval
}
);
},

View File

@@ -38,13 +38,6 @@ OpenLayers.Control.DrawFeature = OpenLayers.Class(OpenLayers.Control, {
*/
EVENT_TYPES: ["featureadded"],
/**
* APIProperty: multi
* {Boolean} Cast features to multi-part geometries before passing to the
* layer. Default is false.
*/
multi: false,
/**
* APIProperty: featureAdded
* {Function} Called after each feature is added
@@ -91,12 +84,9 @@ OpenLayers.Control.DrawFeature = OpenLayers.Class(OpenLayers.Control, {
this.callbacks
);
this.layer = layer;
this.handlerOptions = this.handlerOptions || {};
if (!("multi" in this.handlerOptions)) {
this.handlerOptions.multi = this.multi;
}
var sketchStyle = this.layer.styleMap && this.layer.styleMap.styles.temporary;
if(sketchStyle) {
this.handlerOptions = this.handlerOptions || {};
this.handlerOptions.layerOptions = OpenLayers.Util.applyDefaults(
this.handlerOptions.layerOptions,
{styleMap: new OpenLayers.StyleMap({"default": sketchStyle})}

View File

@@ -14,7 +14,7 @@
* Class: OpenLayers.Control.GetFeature
* Gets vector features for locations underneath the mouse cursor. Can be
* configured to act on click, hover or dragged boxes. Uses an
* <OpenLayers.Protocol> that supports spatial filters to retrieve
* <OpenLayers.Protocol> that supports spatial filters (BBOX) to retrieve
* features from a server and fires events that notify applications of the
* selected features.
*
@@ -80,11 +80,10 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: clickTolerance
* {Integer} Tolerance for the filter query in pixels. This has the
* {Integer} Tolerance for the BBOX query in pixels. This has the
* same effect as the tolerance parameter on WMS GetFeatureInfo
* requests. Will be ignored for box selections. Applies only if
* <click> or <hover> is true. Default is 5. Note that this not
* only affects requests on click, but also on hover.
* <click> is true. Default is 5.
*/
clickTolerance: 5,
@@ -102,9 +101,8 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: maxFeatures
* {Integer} Maximum number of features to return from a query in single mode
* if supported by the <protocol>. This set of features is then used to
* determine the best match client-side. Default is 10.
* {Integer} Maximum number of features to return from a query, if
* supported by the <protocol>. Default is 10.
*/
maxFeatures: 10,
@@ -143,15 +141,6 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
*/
hoverResponse: null,
/**
* Property: filterType
* {<String>} The type of filter to use when sending off a request.
* Possible values:
* OpenLayers.Filter.Spatial.<BBOX|INTERSECTS|WITHIN|CONTAINS>
* Defaults to: OpenLayers.Filter.Spatial.BBOX
*/
filterType: OpenLayers.Filter.Spatial.BBOX,
/**
* Constant: EVENT_TYPES
*
@@ -162,14 +151,6 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
* featureselected - Triggered when <click> is true and a feature is
* selected. The event object has a feature property with the
* selected feature
* beforefeaturesselected - Triggered when <click> is true before a
* set of features is selected. The event object is an array of
* feature properties with the features about to be selected.
* Return false after receiving this event to discontinue processing
* of all featureselected events and the featuresselected event.
* featuresselected - Triggered when <click> is true and a set of
* features is selected. The event object is an array of feature
* properties of the selected features
* featureunselected - Triggered when <click> is true and a feature is
* unselected. The event object has a feature property with the
* unselected feature
@@ -180,9 +161,8 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
* outfeature - Triggered when <hover> is true and the mouse moves
* moved away from a hover-selected feature
*/
EVENT_TYPES: ["featureselected", "featuresselected", "featureunselected",
"clickout", "beforefeatureselected", "beforefeaturesselected",
"hoverfeature", "outfeature"],
EVENT_TYPES: ["featureselected", "featureunselected", "clickout",
"beforefeatureselected", "hoverfeature", "outfeature"],
/**
* Constructor: OpenLayers.Control.GetFeature
@@ -209,8 +189,8 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
if(this.click) {
this.handlers.click = new OpenLayers.Handler.Click(this,
{click: this.selectSingle}, this.handlerOptions.click || {});
}
{click: this.selectSingle}, this.handlerOptions.click || {})
};
if(this.box) {
this.handlers.box = new OpenLayers.Handler.Box(
@@ -267,6 +247,25 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
);
},
/**
* Method: unselectAll
* Unselect all selected features. To unselect all except for a single
* feature, set the options.except property to the feature.
*
* Parameters:
* options - {Object} Optional configuration object.
*/
unselectAll: function(options) {
// we'll want an option to supress notification here
var feature;
for(var i=this.features.length-1; i>=0; --i) {
feature = this.features[i];
if(!options || options.except != feature) {
this.unselect(feature);
}
}
},
/**
* Method: selectSingle
* Called on click
@@ -292,7 +291,6 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
* position - {<OpenLayers.Bounds>}
*/
selectBox: function(position) {
var bounds;
if (position instanceof OpenLayers.Bounds) {
var minXY = this.map.getLonLatFromPixel(
new OpenLayers.Pixel(position.left, position.bottom)
@@ -300,15 +298,13 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
var maxXY = this.map.getLonLatFromPixel(
new OpenLayers.Pixel(position.right, position.top)
);
bounds = new OpenLayers.Bounds(
var bounds = new OpenLayers.Bounds(
minXY.lon, minXY.lat, maxXY.lon, maxXY.lat
);
} else {
bounds = this.pixelToBounds(position);
this.setModifiers(this.handlers.box.dragHandler.evt);
this.request(bounds);
}
this.setModifiers(this.handlers.box.dragHandler.evt);
this.request(bounds);
},
/**
@@ -351,7 +347,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
request: function(bounds, options) {
options = options || {};
var filter = new OpenLayers.Filter.Spatial({
type: this.filterType,
type: OpenLayers.Filter.Spatial.BBOX,
value: bounds
});
@@ -359,7 +355,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
maxFeatures: options.single == true ? this.maxFeatures : undefined,
filter: filter,
callback: function(result) {
if(result.success()) {
if(result.code == 1) {
if(result.features.length) {
if(options.single == true) {
this.selectBestFeature(result.features,
@@ -425,7 +421,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
} else {
this.select(resultFeature || features);
}
}
};
},
/**
@@ -439,13 +435,13 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
this.modifiers = {
multiple: this.multiple || (this.multipleKey && evt[this.multipleKey]),
toggle: this.toggle || (this.toggleKey && evt[this.toggleKey])
};
}
},
/**
* Method: select
* Add feature to the hash of selected features and trigger the
* featureselected and featuresselected events.
* featureselected event.
*
* Parameters:
* features - {<OpenLayers.Feature.Vector>} or an array of features
@@ -458,34 +454,24 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
features = [features];
}
var cont = this.events.triggerEvent("beforefeaturesselected", {
features: features
});
if(cont !== false) {
var selectedFeatures = [];
var feature;
for(var i=0, len=features.length; i<len; ++i) {
feature = features[i];
if(this.features[feature.fid || feature.id]) {
if(this.modifiers.toggle) {
this.unselect(this.features[feature.fid || feature.id]);
}
} else {
cont = this.events.triggerEvent("beforefeatureselected", {
feature: feature
});
if(cont !== false) {
this.features[feature.fid || feature.id] = feature;
selectedFeatures.push(feature);
this.events.triggerEvent("featureselected",
{feature: feature});
}
var feature;
for(var i=0, len=features.length; i<len; ++i) {
feature = features[i];
if(this.features[feature.fid || feature.id]) {
if(this.modifiers.toggle) {
this.unselect(this.features[feature.fid || feature.id]);
}
} else {
cont = this.events.triggerEvent("beforefeatureselected", {
feature: feature
});
if(cont !== false) {
this.features[feature.fid || feature.id] = feature;
this.events.triggerEvent("featureselected",
{feature: feature});
}
}
this.events.triggerEvent("featuresselected", {
features: selectedFeatures
});
}
},

View File

@@ -1,327 +0,0 @@
/* Copyright (c) 2006-2009 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* for the full text of the license. */
/**
* @requires OpenLayers/Control.js
*/
/**
* Class: OpenLayers.Control.Graticule
* The Graticule displays a grid of latitude/longitude lines reprojected on
* the map.
*
* Inherits from:
* - <OpenLayers.Control>
*
*/
OpenLayers.Control.Graticule = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: intervals
* {Array(Float)} A list of possible graticule widths in degrees.
*/
intervals: [ 45, 30, 20, 10, 5, 2, 1,
0.5, 0.2, 0.1, 0.05, 0.01,
0.005, 0.002, 0.001 ],
/**
* APIProperty: displayInLayerSwitcher
* {Boolean} Allows the Graticule control to be switched on and off.
* defaults to true.
*/
displayInLayerSwitcher: true,
/**
* APIProperty: visible
* {Boolean} should the graticule be initially visible (default=true)
*/
visible: true,
/**
* APIProperty: numPoints
* {Integer} The number of points to use in each graticule line. Higher
* numbers result in a smoother curve for projected maps
*/
numPoints: 50,
/**
* APIProperty: targetSize
* {Integer} The maximum size of the grid in pixels on the map
*/
targetSize: 200,
/**
* APIProperty: layerName
* {String} the name to be displayed in the layer switcher
*/
layerName: "Graticule",
/**
* APIProperty: labelled
* {Boolean} Should the graticule lines be labelled?. default=true
*/
labelled: true,
/**
* APIProperty: labelFormat
* {String} the format of the labels, default = 'dm'. See
* <OpenLayers.Util.getFormattedLonLat> for other options.
*/
labelFormat: 'dm',
/**
* APIProperty: lineSymbolizer
* {symbolizer} the symbolizer used to render lines
*/
lineSymbolizer: {
strokeColor: "#333",
strokeWidth: 1,
strokeOpacity: 0.5
},
/**
* APIProperty: labelSymbolizer
* {symbolizer} the symbolizer used to render labels
*/
labelSymbolizer: {},
/**
* Property: gratLayer
* {OpenLayers.Layer.Vector} vector layer used to draw the graticule on
*/
gratLayer: null,
/**
* Constructor: OpenLayers.Control.Graticule
* Create a new graticule control to display a grid of latitude longitude
* lines.
*
* Parameters:
* options - {Object} An optional object whose properties will be used
* to extend the control.
*/
initialize: function(options) {
OpenLayers.Control.prototype.initialize.apply(this, [options]);
this.labelSymbolizer.stroke = false;
this.labelSymbolizer.fill = false;
this.labelSymbolizer.label = "${label}";
this.labelSymbolizer.labelAlign = "${labelAlign}";
this.labelSymbolizer.labelXOffset = "${xOffset}";
this.labelSymbolizer.labelYOffset = "${yOffset}";
},
/**
* Method: draw
*
* initializes the graticule layer and does the initial update
*
* Returns:
* {DOMElement}
*/
draw: function() {
OpenLayers.Control.prototype.draw.apply(this, arguments);
if (!this.gratLayer) {
var gratStyle = new OpenLayers.Style({},{
rules: [new OpenLayers.Rule({'symbolizer':
{"Point":this.labelSymbolizer,
"Line":this.lineSymbolizer}
})]
});
this.gratLayer = new OpenLayers.Layer.Vector(this.layerName, {
styleMap: new OpenLayers.StyleMap({'default':gratStyle}),
visibility: this.visible,
displayInLayerSwitcher: this.displayInLayerSwitcher
});
this.map.addLayer(this.gratLayer);
}
this.map.events.register('moveend', this, this.update);
this.update();
return this.div;
},
/**
* Method: update
*
* calculates the grid to be displayed and actually draws it
*
* Returns:
* {DOMElement}
*/
update: function() {
//wait for the map to be initialized before proceeding
var mapBounds = this.map.getExtent();
if (!mapBounds) {
return;
}
//clear out the old grid
this.gratLayer.destroyFeatures();
//get the projection objects required
var llProj = new OpenLayers.Projection("EPSG:4326");
var mapProj = this.map.getProjectionObject();
var mapRes = this.map.getResolution();
//if the map is in lon/lat, then the lines are straight and only one
//point is required
if (mapProj.proj && mapProj.proj.projName == "longlat") {
this.numPoints = 1;
}
//get the map center in EPSG:4326
var mapCenter = this.map.getCenter(); //lon and lat here are really map x and y
var mapCenterLL = new OpenLayers.Pixel(mapCenter.lon, mapCenter.lat);
OpenLayers.Projection.transform(mapCenterLL, mapProj, llProj);
/* This block of code determines the lon/lat interval to use for the
* grid by calculating the diagonal size of one grid cell at the map
* center. Iterates through the intervals array until the diagonal
* length is less than the targetSize option.
*/
//find lat/lon interval that results in a grid of less than the target size
var testSq = this.targetSize*mapRes;
testSq *= testSq; //compare squares rather than doing a square root to save time
var llInterval;
for (var i=0; i<this.intervals.length; ++i) {
llInterval = this.intervals[i]; //could do this for both x and y??
var delta = llInterval/2;
var p1 = mapCenterLL.offset(new OpenLayers.Pixel(-delta, -delta)); //test coords in EPSG:4326 space
var p2 = mapCenterLL.offset(new OpenLayers.Pixel( delta, delta));
OpenLayers.Projection.transform(p1, llProj, mapProj); // convert them back to map projection
OpenLayers.Projection.transform(p2, llProj, mapProj);
var distSq = (p1.x-p2.x)*(p1.x-p2.x) + (p1.y-p2.y)*(p1.y-p2.y);
if (distSq <= testSq) {
break;
}
}
//alert(llInterval);
//round the LL center to an even number based on the interval
mapCenterLL.x = Math.floor(mapCenterLL.x/llInterval)*llInterval;
mapCenterLL.y = Math.floor(mapCenterLL.y/llInterval)*llInterval;
//TODO adjust for minutses/seconds?
/* The following 2 blocks calculate the nodes of the grid along a
* line of constant longitude (then latitiude) running through the
* center of the map until it reaches the map edge. The calculation
* goes from the center in both directions to the edge.
*/
//get the central longitude line, increment the latitude
var iter = 0;
var centerLonPoints = [mapCenterLL.clone()];
var newPoint = mapCenterLL.clone();
var mapXY;
do {
newPoint = newPoint.offset(new OpenLayers.Pixel(0,llInterval));
mapXY = OpenLayers.Projection.transform(newPoint.clone(), llProj, mapProj);
centerLonPoints.unshift(newPoint);
} while (mapBounds.containsPixel(mapXY) && ++iter<1000);
newPoint = mapCenterLL.clone();
do {
newPoint = newPoint.offset(new OpenLayers.Pixel(0,-llInterval));
mapXY = OpenLayers.Projection.transform(newPoint.clone(), llProj, mapProj);
centerLonPoints.push(newPoint);
} while (mapBounds.containsPixel(mapXY) && ++iter<1000);
//get the central latitude line, increment the longitude
iter = 0;
var centerLatPoints = [mapCenterLL.clone()];
newPoint = mapCenterLL.clone();
do {
newPoint = newPoint.offset(new OpenLayers.Pixel(-llInterval, 0));
mapXY = OpenLayers.Projection.transform(newPoint.clone(), llProj, mapProj);
centerLatPoints.unshift(newPoint);
} while (mapBounds.containsPixel(mapXY) && ++iter<1000);
newPoint = mapCenterLL.clone();
do {
newPoint = newPoint.offset(new OpenLayers.Pixel(llInterval, 0));
mapXY = OpenLayers.Projection.transform(newPoint.clone(), llProj, mapProj);
centerLatPoints.push(newPoint);
} while (mapBounds.containsPixel(mapXY) && ++iter<1000);
//now generate a line for each node in the central lat and lon lines
//first loop over constant longitude
var lines = [];
for(var i=0; i < centerLatPoints.length; ++i) {
var lon = centerLatPoints[i].x;
var pointList = [];
var labelPoint = null;
var latEnd = Math.min(centerLonPoints[0].y, 90);
var latStart = Math.max(centerLonPoints[centerLonPoints.length - 1].y, -90);
var latDelta = (latEnd - latStart)/this.numPoints;
var lat = latStart;
for(var j=0; j<= this.numPoints; ++j) {
var gridPoint = new OpenLayers.Geometry.Point(lon,lat);
gridPoint.transform(llProj, mapProj);
pointList.push(gridPoint);
lat += latDelta;
if (gridPoint.y >= mapBounds.bottom && !labelPoint) {
labelPoint = gridPoint;
}
}
if (this.labelled) {
//keep track of when this grid line crosses the map bounds to set
//the label position
//labels along the bottom, add 10 pixel offset up into the map
//TODO add option for labels on top
var labelPos = new OpenLayers.Geometry.Point(labelPoint.x,mapBounds.bottom);
var labelAttrs = {
value: lon,
label: this.labelled?OpenLayers.Util.getFormattedLonLat(lon, "lon", this.labelFormat):"",
labelAlign: "cb",
xOffset: 0,
yOffset: 2
};
this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(labelPos,labelAttrs));
}
var geom = new OpenLayers.Geometry.LineString(pointList);
lines.push(new OpenLayers.Feature.Vector(geom));
}
//now draw the lines of constant latitude
for (var j=0; j < centerLonPoints.length; ++j) {
lat = centerLonPoints[j].y;
if (lat<-90 || lat>90) { //latitudes only valid between -90 and 90
continue;
}
var pointList = [];
var lonStart = centerLatPoints[0].x;
var lonEnd = centerLatPoints[centerLatPoints.length - 1].x;
var lonDelta = (lonEnd - lonStart)/this.numPoints;
var lon = lonStart;
var labelPoint = null;
for(var i=0; i <= this.numPoints ; ++i) {
var gridPoint = new OpenLayers.Geometry.Point(lon,lat);
gridPoint.transform(llProj, mapProj);
pointList.push(gridPoint);
lon += lonDelta;
if (gridPoint.x < mapBounds.right) {
labelPoint = gridPoint;
}
}
if (this.labelled) {
//keep track of when this grid line crosses the map bounds to set
//the label position
//labels along the right, 30 pixel offset left into the map
//TODO add option for labels on left
var labelPos = new OpenLayers.Geometry.Point(mapBounds.right, labelPoint.y);
var labelAttrs = {
value: lat,
label: this.labelled?OpenLayers.Util.getFormattedLonLat(lat, "lat", this.labelFormat):"",
labelAlign: "rb",
xOffset: -2,
yOffset: 2
};
this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(labelPos,labelAttrs));
}
var geom = new OpenLayers.Geometry.LineString(pointList);
lines.push(new OpenLayers.Feature.Vector(geom));
}
this.gratLayer.addFeatures(lines);
},
CLASS_NAME: "OpenLayers.Control.Graticule"
});

View File

@@ -21,13 +21,6 @@
*/
OpenLayers.Control.KeyboardDefaults = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: autoActivate
* {Boolean} Activate the control when it is added to a map. Default is
* true.
*/
autoActivate: true,
/**
* APIProperty: slideFactor
* Pixels to slide by.
@@ -60,6 +53,7 @@ OpenLayers.Control.KeyboardDefaults = OpenLayers.Class(OpenLayers.Control, {
draw: function() {
this.handler = new OpenLayers.Handler.Keyboard( this, {
"keydown": this.defaultKeyPress });
this.activate();
},
/**

View File

@@ -22,19 +22,11 @@
OpenLayers.Control.LayerSwitcher =
OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: roundedCorner
* {Boolean} If true the Rico library is used for rounding the corners
* of the layer switcher div, defaults to true.
*/
roundedCorner: true,
/**
* APIProperty: roundedCornerColor
* {String} The color of the rounded corners, only applies if roundedCorner
* is true, defaults to "darkblue".
* Property: activeColor
* {String}
*/
roundedCornerColor: "darkblue",
activeColor: "darkblue",
/**
* Property: layerStates
@@ -292,7 +284,7 @@ OpenLayers.Control.LayerSwitcher =
// create input element
var inputElem = document.createElement("input");
inputElem.id = this.id + "_input_" + layer.name;
inputElem.name = (baseLayer) ? this.id + "_baseLayers" : layer.name;
inputElem.name = (baseLayer) ? "baseLayers" : layer.name;
inputElem.type = (baseLayer) ? "radio" : "checkbox";
inputElem.value = layer.name;
inputElem.checked = checked;
@@ -313,7 +305,6 @@ OpenLayers.Control.LayerSwitcher =
// create span
var labelSpan = document.createElement("span");
OpenLayers.Element.addClass(labelSpan, "labelSpan")
if (!baseLayer && !layer.inRange) {
labelSpan.style.color = "gray";
}
@@ -428,9 +419,8 @@ OpenLayers.Control.LayerSwitcher =
*/
maximizeControl: function(e) {
// set the div's width and height to empty values, so
// the div dimensions can be controlled by CSS
this.div.style.width = "";
//HACK HACK HACK - find a way to auto-size this layerswitcher
this.div.style.width = "20em";
this.div.style.height = "";
this.showControls(false);
@@ -450,10 +440,6 @@ OpenLayers.Control.LayerSwitcher =
*/
minimizeControl: function(e) {
// to minimize the control we set its div's width
// and height to 0px, we cannot just set "display"
// to "none" because it would hide the maximize
// div
this.div.style.width = "0px";
this.div.style.height = "0px";
@@ -487,7 +473,19 @@ OpenLayers.Control.LayerSwitcher =
loadContents: function() {
//configure main div
this.div.style.position = "absolute";
this.div.style.top = "25px";
this.div.style.right = "0px";
this.div.style.left = "";
this.div.style.fontFamily = "sans-serif";
this.div.style.fontWeight = "bold";
this.div.style.marginTop = "3px";
this.div.style.marginLeft = "3px";
this.div.style.marginBottom = "3px";
this.div.style.fontSize = "smaller";
this.div.style.color = "white";
this.div.style.backgroundColor = "transparent";
OpenLayers.Event.observe(this.div, "mouseup",
OpenLayers.Function.bindAsEventListener(this.mouseUp, this));
OpenLayers.Event.observe(this.div, "click",
@@ -496,24 +494,44 @@ OpenLayers.Control.LayerSwitcher =
OpenLayers.Function.bindAsEventListener(this.mouseDown, this));
OpenLayers.Event.observe(this.div, "dblclick", this.ignoreEvent);
// layers list div
this.layersDiv = document.createElement("div");
this.layersDiv.id = this.id + "_layersDiv";
OpenLayers.Element.addClass(this.layersDiv, "layersDiv");
this.layersDiv.style.paddingTop = "5px";
this.layersDiv.style.paddingLeft = "10px";
this.layersDiv.style.paddingBottom = "5px";
this.layersDiv.style.paddingRight = "75px";
this.layersDiv.style.backgroundColor = this.activeColor;
// had to set width/height to get transparency in IE to work.
// thanks -- http://jszen.blogspot.com/2005/04/ie6-opacity-filter-caveat.html
//
this.layersDiv.style.width = "100%";
this.layersDiv.style.height = "100%";
this.baseLbl = document.createElement("div");
this.baseLbl.innerHTML = OpenLayers.i18n("baseLayer");
OpenLayers.Element.addClass(this.baseLbl, "baseLbl");
this.baseLbl.style.marginTop = "3px";
this.baseLbl.style.marginLeft = "3px";
this.baseLbl.style.marginBottom = "3px";
this.baseLayersDiv = document.createElement("div");
OpenLayers.Element.addClass(this.baseLayersDiv, "baseLayersDiv");
this.baseLayersDiv.style.paddingLeft = "10px";
/*OpenLayers.Event.observe(this.baseLayersDiv, "click",
OpenLayers.Function.bindAsEventListener(this.onLayerClick, this));
*/
this.dataLbl = document.createElement("div");
this.dataLbl.innerHTML = OpenLayers.i18n("overlays");
OpenLayers.Element.addClass(this.dataLbl, "dataLbl");
this.dataLbl.style.marginTop = "3px";
this.dataLbl.style.marginLeft = "3px";
this.dataLbl.style.marginBottom = "3px";
this.dataLayersDiv = document.createElement("div");
OpenLayers.Element.addClass(this.dataLayersDiv, "dataLayersDiv");
this.dataLayersDiv.style.paddingLeft = "10px";
if (this.ascending) {
this.layersDiv.appendChild(this.baseLbl);
@@ -529,15 +547,12 @@ OpenLayers.Control.LayerSwitcher =
this.div.appendChild(this.layersDiv);
if(this.roundedCorner) {
OpenLayers.Rico.Corner.round(this.div, {
corners: "tl bl",
bgColor: "transparent",
color: this.roundedCornerColor,
blend: false
});
OpenLayers.Rico.Corner.changeOpacity(this.layersDiv, 0.75);
}
OpenLayers.Rico.Corner.round(this.div, {corners: "tl bl",
bgColor: "transparent",
color: this.activeColor,
blend: false});
OpenLayers.Rico.Corner.changeOpacity(this.layersDiv, 0.75);
var imgLocation = OpenLayers.Util.getImagesLocation();
var sz = new OpenLayers.Size(18,18);
@@ -550,7 +565,9 @@ OpenLayers.Control.LayerSwitcher =
sz,
img,
"absolute");
OpenLayers.Element.addClass(this.maximizeDiv, "maximizeDiv");
this.maximizeDiv.style.top = "5px";
this.maximizeDiv.style.right = "0px";
this.maximizeDiv.style.left = "";
this.maximizeDiv.style.display = "none";
OpenLayers.Event.observe(this.maximizeDiv, "click",
OpenLayers.Function.bindAsEventListener(this.maximizeControl, this)
@@ -567,7 +584,9 @@ OpenLayers.Control.LayerSwitcher =
sz,
img,
"absolute");
OpenLayers.Element.addClass(this.minimizeDiv, "minimizeDiv");
this.minimizeDiv.style.top = "5px";
this.minimizeDiv.style.right = "0px";
this.minimizeDiv.style.left = "";
this.minimizeDiv.style.display = "none";
OpenLayers.Event.observe(this.minimizeDiv, "click",
OpenLayers.Function.bindAsEventListener(this.minimizeControl, this)

View File

@@ -43,17 +43,6 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
* Default is true.
*/
toggle: true,
/**
* APIProperty: standalone
* {Boolean} Set to true to create a control without SelectFeature
* capabilities. Default is false. If standalone is true, to modify
* a feature, call the <selectFeature> method with the target feature.
* Note that you must call the <unselectFeature> method to finish
* feature modification in standalone mode (before starting to modify
* another feature).
*/
standalone: false,
/**
* Property: layer
@@ -218,11 +207,9 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
onUnselect: this.unselectFeature,
scope: this
};
if(this.standalone === false) {
this.selectControl = new OpenLayers.Control.SelectFeature(
layer, selectOptions
);
}
this.selectControl = new OpenLayers.Control.SelectFeature(
layer, selectOptions
);
// configure the drag control
var dragOptions = {
@@ -236,22 +223,6 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
},
onComplete: function(feature) {
control.dragComplete.apply(control, [feature]);
},
featureCallbacks: {
over: function(feature) {
/**
* In normal mode, the feature handler is set up to allow
* dragging of all points. In standalone mode, we only
* want to allow dragging of sketch vertices and virtual
* vertices - or, in the case of a modifiable point, the
* point itself.
*/
if(control.standalone !== true || feature._sketch ||
control.feature === feature) {
control.dragControl.overFeature.apply(
control.dragControl, [feature]);
}
}
}
};
this.dragControl = new OpenLayers.Control.DragFeature(
@@ -273,7 +244,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
*/
destroy: function() {
this.layer = null;
this.standalone || this.selectControl.destroy();
this.selectControl.destroy();
this.dragControl.destroy();
OpenLayers.Control.prototype.destroy.apply(this, []);
},
@@ -286,7 +257,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
* {Boolean} Successfully activated the control.
*/
activate: function() {
return ((this.standalone || this.selectControl.activate()) &&
return (this.selectControl.activate() &&
this.handlers.keyboard.activate() &&
OpenLayers.Control.prototype.activate.apply(this, arguments));
},
@@ -306,19 +277,11 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
this.layer.removeFeatures(this.virtualVertices, {silent: true});
this.vertices = [];
this.dragControl.deactivate();
var feature = this.feature;
var valid = feature && feature.geometry && feature.layer;
if(this.standalone === false) {
if(valid) {
this.selectControl.unselect.apply(this.selectControl,
[feature]);
}
this.selectControl.deactivate();
} else {
if(valid) {
this.unselectFeature(feature);
}
if(this.feature && this.feature.geometry && this.feature.layer) {
this.selectControl.unselect.apply(this.selectControl,
[this.feature]);
}
this.selectControl.deactivate();
this.handlers.keyboard.deactivate();
deactivated = true;
}
@@ -401,7 +364,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
// only change behavior if the feature is not in the vertices array
if(feature != this.feature && !feature.geometry.parent &&
feature != this.dragHandle && feature != this.radiusHandle) {
if(this.standalone === false && this.feature) {
if(this.feature) {
// unselect the currently selected feature
this.selectControl.clickFeature.apply(this.selectControl,
[this.feature]);
@@ -411,8 +374,8 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Util.indexOf(this.geometryTypes,
feature.geometry.CLASS_NAME) != -1) {
// select the point
this.standalone || this.selectControl.clickFeature.apply(
this.selectControl, [feature]);
this.selectControl.clickFeature.apply(this.selectControl,
[feature]);
/**
* TBD: These lines improve workflow by letting the user
* immediately start dragging after the mouse down.
@@ -489,8 +452,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
this.layer.destroyFeatures(this.virtualVertices, {silent: true});
this.virtualVertices = [];
}
this.layer.drawFeature(this.feature, this.standalone ? undefined :
this.selectControl.renderIntent);
this.layer.drawFeature(this.feature, this.selectControl.renderIntent);
}
// keep the vertex on top so it gets the mouseout after dragging
// this should be removed in favor of an option to draw under or
@@ -596,8 +558,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
vertex.geometry.parent) {
// remove the vertex
vertex.geometry.parent.removeComponent(vertex.geometry);
this.layer.drawFeature(this.feature, this.standalone ?
undefined :
this.layer.drawFeature(this.feature,
this.selectControl.renderIntent);
this.resetVertices();
this.setFeatureState();
@@ -747,7 +708,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
* map - {<OpenLayers.Map>} The control's map.
*/
setMap: function(map) {
this.standalone || this.selectControl.setMap(map);
this.selectControl.setMap(map);
this.dragControl.setMap(map);
OpenLayers.Control.prototype.setMap.apply(this, arguments);
},

View File

@@ -166,7 +166,7 @@ OpenLayers.Control.MouseDefaults = OpenLayers.Class(OpenLayers.Control, {
this.zoomBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
this.map.viewPortDiv.appendChild(this.zoomBox);
}
document.onselectstart = OpenLayers.Function.False;
document.onselectstart=function() { return false; };
OpenLayers.Event.stop(evt);
},

View File

@@ -52,13 +52,6 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
* {Integer}
*/
granularity: 10,
/**
* APIProperty: emptyString
* {String} Set this to some value to set when the mouse is outside the
* map.
*/
emptyString: null,
/**
* Property: lastXy
@@ -118,8 +111,7 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
var lonLat;
if (evt == null) {
this.reset();
return;
lonLat = new OpenLayers.LonLat(0, 0);
} else {
if (this.lastXy == null ||
Math.abs(evt.xy.x - this.lastXy.x) > this.granularity ||
@@ -149,15 +141,6 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
}
},
/**
* Method: reset
*/
reset: function(evt) {
if (this.emptyString != null) {
this.element.innerHTML = this.emptyString;
}
},
/**
* Method: formatOutput
* Override to provide custom display output
@@ -182,7 +165,6 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
setMap: function() {
OpenLayers.Control.prototype.setMap.apply(this, arguments);
this.map.events.register( 'mousemove', this, this.redraw);
this.map.events.register( 'mouseout', this, this.reset);
},
CLASS_NAME: "OpenLayers.Control.MousePosition"

View File

@@ -254,7 +254,7 @@ OpenLayers.Control.MouseToolbar = OpenLayers.Class(
this.map.div.style.cursor = "move";
break;
}
document.onselectstart = OpenLayers.Function.False;
document.onselectstart = function() { return false; };
OpenLayers.Event.stop(evt);
},

View File

@@ -36,37 +36,17 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
*/
dragPanOptions: null,
/**
* APIProperty: documentDrag
* {Boolean} Allow panning of the map by dragging outside map viewport.
* Default is false.
*/
documentDrag: false,
/**
* Property: zoomBox
* {<OpenLayers.Control.ZoomBox>}
*/
zoomBox: null,
/**
* APIProperty: zoomBoxEnabled
* {Boolean} Whether the user can draw a box to zoom
*/
zoomBoxEnabled: true,
/**
* APIProperty: zoomWheelEnabled
* {Boolean} Whether the mousewheel should zoom the map
*/
zoomWheelEnabled: true,
/**
* Property: mouseWheelOptions
* {Object} Options passed to the MouseWheel control (only useful if
* <zoomWheelEnabled> is set to true)
*/
mouseWheelOptions: null,
zoomWheelEnabled: true,
/**
* APIProperty: handleRightClicks
@@ -85,13 +65,6 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
*/
zoomBoxKeyMask: OpenLayers.Handler.MOD_SHIFT,
/**
* APIProperty: autoActivate
* {Boolean} Activate the control when it is added to a map. Default is
* true.
*/
autoActivate: true,
/**
* Constructor: OpenLayers.Control.Navigation
* Create a new navigation control
@@ -135,9 +108,7 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
this.handlers.wheel.activate();
}
this.handlers.click.activate();
if (this.zoomBoxEnabled) {
this.zoomBox.activate();
}
this.zoomBox.activate();
return OpenLayers.Control.prototype.activate.apply(this,arguments);
},
@@ -158,7 +129,7 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
draw: function() {
// disable right mouse context menu for support of right click events
if (this.handleRightClicks) {
this.map.viewPortDiv.oncontextmenu = OpenLayers.Function.False;
this.map.viewPortDiv.oncontextmenu = function () { return false;};
}
var clickCallbacks = {
@@ -173,10 +144,7 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
this, clickCallbacks, clickOptions
);
this.dragPan = new OpenLayers.Control.DragPan(
OpenLayers.Util.extend({
map: this.map,
documentDrag: this.documentDrag
}, this.dragPanOptions)
OpenLayers.Util.extend({map: this.map}, this.dragPanOptions)
);
this.zoomBox = new OpenLayers.Control.ZoomBox(
{map: this.map, keyMask: this.zoomBoxKeyMask});
@@ -184,8 +152,8 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
this.zoomBox.draw();
this.handlers.wheel = new OpenLayers.Handler.MouseWheel(
this, {"up" : this.wheelUp,
"down": this.wheelDown},
this.mouseWheelOptions );
"down": this.wheelDown} );
this.activate();
},
/**
@@ -218,11 +186,8 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
* deltaZ - {Integer}
*/
wheelChange: function(evt, deltaZ) {
var currentZoom = this.map.getZoom();
var newZoom = this.map.getZoom() + Math.round(deltaZ);
newZoom = Math.max(newZoom, 0);
newZoom = Math.min(newZoom, this.map.getNumZoomLevels());
if (newZoom === currentZoom) {
var newZoom = this.map.getZoom() + deltaZ;
if (!this.map.isValidZoomLevel(newZoom)) {
return;
}
var size = this.map.getSize();
@@ -242,10 +207,9 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
*
* Parameters:
* evt - {Event}
* delta - {Integer}
*/
wheelUp: function(evt, delta) {
this.wheelChange(evt, delta || 1);
wheelUp: function(evt) {
this.wheelChange(evt, 1);
},
/**
@@ -254,28 +218,9 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
*
* Parameters:
* evt - {Event}
* delta - {Integer}
*/
wheelDown: function(evt, delta) {
this.wheelChange(evt, delta || -1);
},
/**
* Method: disableZoomBox
*/
disableZoomBox : function() {
this.zoomBoxEnabled = false;
this.zoomBox.deactivate();
},
/**
* Method: enableZoomBox
*/
enableZoomBox : function() {
this.zoomBoxEnabled = true;
if (this.active) {
this.zoomBox.activate();
}
wheelDown: function(evt) {
this.wheelChange(evt, -1);
},
/**

View File

@@ -67,11 +67,11 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
limit: 50,
/**
* APIProperty: autoActivate
* {Boolean} Activate the control when it is added to a map. Default is
* true.
* Property: activateOnDraw
* {Boolean} Activate the control when it is first added to the map.
* Default is true.
*/
autoActivate: true,
activateOnDraw: true,
/**
* Property: clearOnDeactivate
@@ -126,9 +126,16 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Control.prototype.initialize.apply(this, [options]);
this.registry = OpenLayers.Util.extend({
"moveend": this.getState
"moveend": function() {
return {
center: this.map.getCenter(),
resolution: this.map.getResolution()
};
}
}, this.registry);
this.clear();
var previousOptions = {
trigger: OpenLayers.Function.bind(this.previousTrigger, this),
displayClass: this.displayClass + " " + this.displayClass + "Previous"
@@ -143,7 +150,6 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Util.extend(nextOptions, this.nextOptions);
this.next = new OpenLayers.Control.Button(nextOptions);
this.clear();
},
/**
@@ -218,6 +224,9 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Control.prototype.draw.apply(this, arguments);
this.next.draw();
this.previous.draw();
if(this.activateOnDraw) {
this.activate();
}
},
/**
@@ -279,23 +288,7 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
*/
clear: function() {
this.previousStack = [];
this.previous.deactivate();
this.nextStack = [];
this.next.deactivate();
},
/**
* Method: getState
* Get the current state and return it.
*
* Returns:
* {Object} An object representing the current state.
*/
getState: function() {
return {
center: this.map.getCenter(),
resolution: this.map.getResolution()
};
},
/**

View File

@@ -143,25 +143,15 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
if (!this.mapDiv) { // we've already been destroyed
return;
}
if (this.handlers.click) {
this.handlers.click.destroy();
}
if (this.handlers.drag) {
this.handlers.drag.destroy();
}
this.handlers.click.destroy();
this.mapDiv.removeChild(this.extentRectangle);
this.extentRectangle = null;
this.rectEvents.destroy();
this.rectEvents = null;
if (this.rectEvents) {
this.rectEvents.destroy();
this.rectEvents = null;
}
if (this.ovmap) {
this.ovmap.destroy();
this.ovmap = null;
}
this.ovmap.destroy();
this.ovmap = null;
this.element.removeChild(this.mapDiv);
this.mapDiv = null;
@@ -180,7 +170,7 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
this.div.removeChild(this.minimizeDiv);
this.minimizeDiv = null;
}
this.map.events.un({
"moveend": this.update,
"changebaselayer": this.baseLayerDraw,

View File

@@ -19,7 +19,7 @@ OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: slideFactor
* {Integer} Number of pixels by which we'll pan the map in any direction
* on clicking the arrow buttons, defaults to 50.
* on clicking the arrow buttons.
*/
slideFactor: 50,

View File

@@ -25,13 +25,6 @@
*/
OpenLayers.Control.PanPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
/**
* APIProperty: slideFactor
* {Integer} Number of pixels by which we'll pan the map in any direction
* on clicking the arrow buttons, defaults to 50.
*/
slideFactor: 50,
/**
* Constructor: OpenLayers.Control.PanPanel
* Add the four directional pan buttons.
@@ -43,14 +36,10 @@ OpenLayers.Control.PanPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
initialize: function(options) {
OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
this.addControls([
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH,
{slideFactor: this.slideFactor}),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH,
{slideFactor: this.slideFactor}),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST,
{slideFactor: this.slideFactor}),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST,
{slideFactor: this.slideFactor})
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST)
]);
},

View File

@@ -163,7 +163,6 @@ OpenLayers.Control.PanZoom = OpenLayers.Class(OpenLayers.Control, {
_removeButton: function(btn) {
OpenLayers.Event.stopObservingElement(btn);
btn.map = null;
btn.getSlideFactor = null;
this.div.removeChild(btn);
OpenLayers.Util.removeItem(this.buttons, btn);
},

View File

@@ -41,10 +41,10 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
sliderEvents: null,
/**
* Property: zoombarDiv
* Property: zoomBarDiv
* {DOMElement}
*/
zoombarDiv: null,
zoomBarDiv: null,
/**
* Property: divEvents
@@ -58,25 +58,6 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
*/
zoomWorldIcon: false,
/**
* APIProperty: forceFixedZoomLevel
* {Boolean} Force a fixed zoom level even though the map has
* fractionalZoom
*/
forceFixedZoomLevel: false,
/**
* Property: mouseDragStart
* {<OpenLayers.Pixel>}
*/
mouseDragStart: null,
/**
* Property: zoomStart
* {<OpenLayers.Pixel>}
*/
zoomStart: null,
/**
* Constructor: OpenLayers.Control.PanZoomBar
*/
@@ -97,9 +78,6 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
});
OpenLayers.Control.PanZoom.prototype.destroy.apply(this, arguments);
delete this.mouseDragStart;
delete this.zoomStart;
},
/**
@@ -288,7 +266,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
var y = evt.xy.y;
var top = OpenLayers.Util.pagePosition(evt.object)[1];
var levels = (y - top)/this.zoomStopHeight;
if(this.forceFixedZoomLevel || !this.map.fractionalZoom) {
if(!this.map.fractionalZoom) {
levels = Math.floor(levels);
}
var zoom = (this.map.getNumZoomLevels() - 1) - levels;
@@ -357,7 +335,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
if (!OpenLayers.Event.isLeftClick(evt)) {
return;
}
if (this.mouseDragStart) {
if (this.zoomStart) {
this.div.style.cursor="";
this.map.events.un({
"mouseup": this.passEventToSlider,
@@ -366,7 +344,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
});
var deltaY = this.zoomStart.y - evt.xy.y;
var zoomLevel = this.map.zoom;
if (!this.forceFixedZoomLevel && this.map.fractionalZoom) {
if (this.map.fractionalZoom) {
zoomLevel += deltaY/this.zoomStopHeight;
zoomLevel = Math.min(Math.max(zoomLevel, 0),
this.map.getNumZoomLevels() - 1);
@@ -374,8 +352,8 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
zoomLevel += Math.round(deltaY/this.zoomStopHeight);
}
this.map.zoomTo(zoomLevel);
this.moveZoomBar();
this.mouseDragStart = null;
this.zoomStart = null;
OpenLayers.Event.stop(evt);
}
},

View File

@@ -21,13 +21,6 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
*/
controls: null,
/**
* APIProperty: autoActivate
* {Boolean} Activate the control when it is added to a map. Default is
* true.
*/
autoActivate: true,
/**
* APIProperty: defaultControl
* {<OpenLayers.Control>} The control which is activated when the control is
@@ -114,6 +107,7 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
scope: this
});
}
this.activate();
return this.div;
},
@@ -189,14 +183,13 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
// since they need to pass through.
for (var i=0, len=controls.length; i<len; i++) {
var element = document.createElement("div");
var textNode = document.createTextNode(" ");
controls[i].panel_div = element;
if (controls[i].title != "") {
controls[i].panel_div.title = controls[i].title;
}
OpenLayers.Event.observe(controls[i].panel_div, "click",
OpenLayers.Function.bind(this.onClick, this, controls[i]));
OpenLayers.Event.observe(controls[i].panel_div, "dblclick",
OpenLayers.Function.bind(this.onDoubleClick, this, controls[i]));
OpenLayers.Event.observe(controls[i].panel_div, "mousedown",
OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop));
}
@@ -223,13 +216,6 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
this.activateControl(ctrl);
},
/**
* Method: onDoubleClick
*/
onDoubleClick: function(ctrl, evt) {
OpenLayers.Event.stop(evt ? evt : window.event);
},
/**
* APIMethod: getControlsBy
* Get a list of controls with properties matching the given criteria.

View File

@@ -61,12 +61,6 @@ OpenLayers.Control.ScaleLine = OpenLayers.Class(OpenLayers.Control, {
* {DOMElement}
*/
eBottom:null,
/**
* APIProperty: geodesic
* {Boolean} Use geodesic measurement. Default is false.
*/
geodesic: false,
/**
* Constructor: OpenLayers.Control.ScaleLine
@@ -89,6 +83,9 @@ OpenLayers.Control.ScaleLine = OpenLayers.Class(OpenLayers.Control, {
draw: function() {
OpenLayers.Control.prototype.draw.apply(this, arguments);
if (!this.eTop) {
this.div.style.display = "block";
this.div.style.position = "absolute";
// stick in the top bar
this.eTop = document.createElement("div");
this.eTop.className = this.displayClass + "Top";
@@ -162,14 +159,7 @@ OpenLayers.Control.ScaleLine = OpenLayers.Class(OpenLayers.Control, {
var inches = OpenLayers.INCHES_PER_UNIT;
// convert maxWidth to map units
var maxSizeData = this.maxWidth * res * inches[curMapUnits];
var geodesicRatio = 1;
if(this.geodesic === true) {
var maxSizeGeodesic = this.getGeodesicLength(this.maxWidth);
var maxSizeKilometers = maxSizeData / inches["km"];
geodesicRatio = maxSizeGeodesic / maxSizeKilometers;
maxSizeData *= geodesicRatio;
}
var maxSizeData = this.maxWidth * res * inches[curMapUnits];
// decide whether to use large or small scale units
var topUnits;
@@ -195,8 +185,8 @@ OpenLayers.Control.ScaleLine = OpenLayers.Class(OpenLayers.Control, {
bottomMax = bottomRounded / inches[curMapUnits] * inches[bottomUnits];
// and to pixel units
var topPx = topMax / res / geodesicRatio;
var bottomPx = bottomMax / res / geodesicRatio;
var topPx = topMax / res;
var bottomPx = bottomMax / res;
// now set the pixel widths
// and the values inside them
@@ -213,26 +203,6 @@ OpenLayers.Control.ScaleLine = OpenLayers.Class(OpenLayers.Control, {
},
/**
* Method: getGeodesicLength
*
* Parameters:
* pixels - {Number} the pixels to get the geodesic length in meters for.
*/
getGeodesicLength: function(pixels) {
var map = this.map;
var centerPx = map.getPixelFromLonLat(map.getCenter());
var bottom = map.getLonLatFromPixel(centerPx.add(0, -pixels / 2));
var top = map.getLonLatFromPixel(centerPx.add(0, pixels / 2));
var source = map.getProjectionObject();
var dest = new OpenLayers.Projection("EPSG:4326");
if(!source.equals(dest)) {
bottom.transform(source, dest);
top.transform(source, dest);
}
return OpenLayers.Util.distVincenty(bottom, top);
},
CLASS_NAME: "OpenLayers.Control.ScaleLine"
});

View File

@@ -111,7 +111,7 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
* {Object} The scope to use with the onBeforeSelect, onSelect, onUnselect
* callbacks. If null the scope will be this control.
*/
scope: null,
scope: this,
/**
* APIProperty: geometryTypes
@@ -178,11 +178,16 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Control.prototype.EVENT_TYPES
);
OpenLayers.Control.prototype.initialize.apply(this, [options]);
if(this.scope === null) {
this.scope = this;
if(layers instanceof Array) {
this.layers = layers;
this.layer = new OpenLayers.Layer.Vector.RootContainer(
this.id + "_container", {
layers: layers
}
);
} else {
this.layer = layers;
}
this.initLayer(layers);
var callbacks = {
click: this.clickFeature,
clickout: this.clickoutFeature
@@ -207,35 +212,11 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
);
}
},
/**
* Method: initLayer
* Assign the layer property. If layers is an array, we need to use
* a RootContainer.
*
* Parameters:
* layers - {<OpenLayers.Layer.Vector>}, or an array of vector layers.
*/
initLayer: function(layers) {
if(layers instanceof Array) {
this.layers = layers;
this.layer = new OpenLayers.Layer.Vector.RootContainer(
this.id + "_container", {
layers: layers
}
);
} else {
this.layer = layers;
}
},
/**
* Method: destroy
*/
destroy: function() {
if(this.active && this.layers) {
this.map.removeLayer(this.layer);
}
OpenLayers.Control.prototype.destroy.apply(this, arguments);
if(this.layers) {
this.layer.destroy();
@@ -487,13 +468,6 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
if(cont !== false) {
layer.selectedFeatures.push(feature);
this.highlight(feature);
// if the feature handler isn't involved in the feature
// selection (because the box handler is used or the
// feature is selected programatically) we fake the
// feature handler to allow unselecting on click
if(!this.handlers.feature.lastFeature) {
this.handlers.feature.lastFeature = layer.selectedFeatures[0];
}
layer.events.triggerEvent("featureselected", {feature: feature});
this.onSelect.call(this.scope, feature);
}
@@ -551,11 +525,6 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
layer = layers[l];
for(var i=0, len = layer.features.length; i<len; ++i) {
var feature = layer.features[i];
// check if the feature is displayed
if (!feature.getVisibility()) {
continue;
}
if (this.geometryTypes == null || OpenLayers.Util.indexOf(
this.geometryTypes, feature.geometry.CLASS_NAME) > -1) {
if (bounds.toGeometry().intersects(feature.geometry)) {
@@ -585,28 +554,5 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Control.prototype.setMap.apply(this, arguments);
},
/**
* Method: setLayer
* Attach a new layer to the control, overriding any existing layers.
*
* Parameters:
* layers - Array of {<OpenLayers.Layer.Vector>} or a single
* {<OpenLayers.Layer.Vector>}
*/
setLayer: function(layers) {
var isActive = this.active;
this.unselectAll();
this.deactivate();
if(this.layers) {
this.layer.destroy();
this.layers = null;
}
this.initLayer(layers);
this.handlers.feature.layer = this.layer;
if (isActive) {
this.activate();
}
},
CLASS_NAME: "OpenLayers.Control.SelectFeature"
});

View File

@@ -1,579 +0,0 @@
/* Copyright (c) 2009 MetaCarta, Inc., published under the Clear BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt
* for the full text of the license. */
/**
* @requires OpenLayers/Control.js
* @requires OpenLayers/Control/DragFeature.js
* @requires OpenLayers/Feature/Vector.js
* @requires OpenLayers/Geometry/LineString.js
* @requires OpenLayers/Geometry/Point.js
*/
/**
* Class: OpenLayers.Control.TransformFeature
* Control to transform features with a standard transformation box.
*
* Inherits From:
* - <OpenLayers.Control>
*/
OpenLayers.Control.TransformFeature = OpenLayers.Class(OpenLayers.Control, {
/**
* Constant: EVENT_TYPES
*
* Supported event types:
* - *beforesetfeature* Triggered before a feature is set for
* tranformation. The feature will not be set if a listener returns
* false. Listeners receive a *feature* property, with the feature
* that will be set for transformation. Listeners are allowed to
* set the control's *scale*, *ratio* and *rotation* properties,
* which will set the initial scale, ratio and rotation of the
* feature, like the <setFeature> method's initialParams argument.
* - *setfeature* Triggered when a feature is set for tranformation.
* Listeners receive a *feature* property, with the feature that
* is now set for transformation.
* - *beforetransform* Triggered while dragging, before a feature is
* transformed. The feature will not be transformed if a listener
* returns false (but the box still will). Listeners receive one or
* more of *center*, *scale*, *ratio* and *rotation*. The *center*
* property is an <OpenLayers.Geometry.Point> object with the new
* center of the transformed feature, the others are Floats with the
* scale, ratio or rotation change since the last transformation.
* - *transform* Triggered while dragging, when a feature is transformed.
* Listeners receive an event object with one or more of *center*,
* *scale*, *ratio* and *rotation*. The *center* property is an
* <OpenLayers.Geometry.Point> object with the new center of the
* transformed feature, the others are Floats with the scale, ratio
* or rotation change of the feature since the last transformation.
* - *transformcomplete" Triggered after dragging. Listeners receive
* an event object with the transformed *feature*.
*/
EVENT_TYPES: ["beforesetfeature", "setfeature", "beforetransform",
"transform", "transformcomplete"],
/**
* APIProperty: geometryTypes
* {Array(String)} To restrict transformation to a limited set of geometry
* types, send a list of strings corresponding to the geometry class
* names.
*/
geometryTypes: null,
/**
* Property: layer
* {<OpenLayers.Layer.Vector>}
*/
layer: null,
/**
* APIProperty: preserveAspectRatio
* {Boolean} set to true to not change the feature's aspect ratio.
*/
preserveAspectRatio: false,
/**
* APIProperty: rotate
* {Boolean} set to false if rotation should be disabled. Default is true.
* To be passed with the constructor or set when the control is not
* active.
*/
rotate: true,
/**
* APIProperty: feature
* {<OpenLayers.Feature.Vector>} Feature currently available for
* transformation. Read-only, use <setFeature> to set it manually.
*/
feature: null,
/**
* APIProperty: renderIntent
* {String|Object} Render intent for the transformation box and
* handles. A symbolizer object can also be provided here.
*/
renderIntent: "temporary",
/**
* APIProperty: rotationHandleSymbolizer
* {Object|String} Optional. A custom symbolizer for the rotation handles.
* A render intent can also be provided here. Defaults to
* (code)
* {
* stroke: false,
* pointRadius: 10,
* fillOpacity: 0,
* cursor: "pointer"
* }
* (end)
*/
rotationHandleSymbolizer: null,
/**
* APIProperty: box
* {<OpenLayers.Feature.Vector>} The transformation box rectangle.
* Read-only.
*/
box: null,
/**
* APIProperty: center
* {<OpenLayers.Geometry.Point>} The center of the feature bounds.
* Read-only.
*/
center: null,
/**
* APIProperty: scale
* {Float} The scale of the feature, relative to the scale the time the
* feature was set. Read-only, except for *beforesetfeature*
* listeners.
*/
scale: 1,
/**
* APIProperty: ratio
* {Float} The ratio of the feature relative to the ratio the time the
* feature was set. Read-only, except for *beforesetfeature*
* listeners.
*/
ratio: 1,
/**
* Property: rotation
* {Integer} the current rotation angle of the box. Read-only, except for
* *beforesetfeature* listeners.
*/
rotation: 0,
/**
* APIProperty: handles
* {Array(<OpenLayers.Feature.Vector>)} The 8 handles currently available
* for scaling/resizing. Numbered counterclockwise, starting from the
* southwest corner. Read-only.
*/
handles: null,
/**
* APIProperty: rotationHandles
* {Array(<OpenLayers.Feature.Vector>)} The 4 rotation handles currently
* available for rotating. Numbered counterclockwise, starting from
* the southwest corner. Read-only.
*/
rotationHandles: null,
/**
* Property: dragControl
* {<OpenLayers.Control.DragFeature>}
*/
dragControl: null,
/**
* Constructor: OpenLayers.Control.TransformFeature
* Create a new transform feature control.
*
* Parameters:
* layer - {<OpenLayers.Layer.Vector>} Layer that contains features that
* will be transformed.
* options - {Object} Optional object whose properties will be set on the
* control.
*/
initialize: function(layer, options) {
// concatenate events specific to this control with those from the base
this.EVENT_TYPES =
OpenLayers.Control.TransformFeature.prototype.EVENT_TYPES.concat(
OpenLayers.Control.prototype.EVENT_TYPES
);
OpenLayers.Control.prototype.initialize.apply(this, [options]);
this.layer = layer;
if(!this.rotationHandleSymbolizer) {
this.rotationHandleSymbolizer = {
stroke: false,
pointRadius: 10,
fillOpacity: 0,
cursor: "pointer"
};
}
this.createBox();
this.createControl();
},
/**
* APIMethod: activate
* Activates the control.
*/
activate: function() {
var activated = false;
if(OpenLayers.Control.prototype.activate.apply(this, arguments)) {
this.dragControl.activate();
this.layer.addFeatures([this.box]);
this.rotate && this.layer.addFeatures(this.rotationHandles);
this.layer.addFeatures(this.handles);
activated = true;
}
return activated;
},
/**
* APIMethod: deactivate
* Deactivates the control.
*/
deactivate: function() {
var deactivated = false;
if(OpenLayers.Control.prototype.deactivate.apply(this, arguments)) {
this.layer.removeFeatures(this.handles);
this.rotate && this.layer.removeFeatures(this.rotationHandles);
this.layer.removeFeatures([this.box]);
this.dragControl.deactivate();
deactivated = true;
}
return deactivated;
},
/**
* Method: setMap
*
* Parameters:
* map - {<OpenLayers.Map>}
*/
setMap: function(map) {
this.dragControl.setMap(map);
OpenLayers.Control.prototype.setMap.apply(this, arguments);
},
/**
* APIMethod: setFeature
* Place the transformation box on a feature and start transforming it.
* If the control is not active, it will be activated.
*
* Parameters:
* feature - {<OpenLayers.Feature.Vector>}
* initialParams - {Object} Initial values for rotation, scale or ratio.
* Setting a rotation value here will cause the transformation box to
* start rotated. Setting a scale or ratio will not affect the
* transormation box, but applications may use this to keep track of
* scale and ratio of a feature across multiple transforms.
*/
setFeature: function(feature, initialParams) {
initialParams = OpenLayers.Util.applyDefaults(initialParams, {
rotation: 0,
scale: 1,
ratio: 1
});
var evt = {feature: feature};
var oldRotation = this.rotation;
var oldCenter = this.center;
OpenLayers.Util.extend(this, initialParams);
if(this.events.triggerEvent("beforesetfeature", evt) === false) {
return;
}
this.feature = feature;
this.activate();
this._setfeature = true;
var featureBounds = this.feature.geometry.getBounds();
this.box.move(featureBounds.getCenterLonLat());
this.box.geometry.rotate(-oldRotation, oldCenter);
this._angle = 0;
var ll;
if(this.rotation) {
var geom = feature.geometry.clone();
geom.rotate(-this.rotation, this.center);
var box = new OpenLayers.Feature.Vector(
geom.getBounds().toGeometry());
box.geometry.rotate(this.rotation, this.center);
this.box.geometry.rotate(this.rotation, this.center);
this.box.move(box.geometry.getBounds().getCenterLonLat());
var llGeom = box.geometry.components[0].components[0];
ll = llGeom.getBounds().getCenterLonLat();
} else {
ll = new OpenLayers.LonLat(featureBounds.left, featureBounds.bottom);
}
this.handles[0].move(ll);
delete this._setfeature;
this.events.triggerEvent("setfeature", evt);
},
/**
* Method: createBox
* Creates the box with all handles and transformation handles.
*/
createBox: function() {
var control = this;
this.center = new OpenLayers.Geometry.Point(0, 0);
var box = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.LineString([
new OpenLayers.Geometry.Point(-1, -1),
new OpenLayers.Geometry.Point(0, -1),
new OpenLayers.Geometry.Point(1, -1),
new OpenLayers.Geometry.Point(1, 0),
new OpenLayers.Geometry.Point(1, 1),
new OpenLayers.Geometry.Point(0, 1),
new OpenLayers.Geometry.Point(-1, 1),
new OpenLayers.Geometry.Point(-1, 0),
new OpenLayers.Geometry.Point(-1, -1)
]), null,
typeof this.renderIntent == "string" ? null : this.renderIntent
);
// Override for box move - make sure that the center gets updated
box.geometry.move = function(x, y) {
control._moving = true;
OpenLayers.Geometry.LineString.prototype.move.apply(this, arguments);
control.center.move(x, y);
delete control._moving;
};
// Overrides for vertex move, resize and rotate - make sure that
// handle and rotationHandle geometries are also moved, resized and
// rotated.
var vertexMoveFn = function(x, y) {
OpenLayers.Geometry.Point.prototype.move.apply(this, arguments);
this._rotationHandle && this._rotationHandle.geometry.move(x, y);
this._handle.geometry.move(x, y);
};
var vertexResizeFn = function(scale, center, ratio) {
OpenLayers.Geometry.Point.prototype.resize.apply(this, arguments);
this._rotationHandle && this._rotationHandle.geometry.resize(
scale, center, ratio);
this._handle.geometry.resize(scale, center, ratio);
};
var vertexRotateFn = function(angle, center) {
OpenLayers.Geometry.Point.prototype.rotate.apply(this, arguments);
this._rotationHandle && this._rotationHandle.geometry.rotate(
angle, center);
this._handle.geometry.rotate(angle, center);
};
// Override for handle move - make sure that the box and other handles
// are updated, and finally transform the feature.
var handleMoveFn = function(x, y) {
var oldX = this.x, oldY = this.y;
OpenLayers.Geometry.Point.prototype.move.call(this, x, y);
if(control._moving) {
return;
}
var evt = control.dragControl.handlers.drag.evt;
var preserveAspectRatio = !control._setfeature &&
control.preserveAspectRatio;
var reshape = !preserveAspectRatio && !(evt && evt.shiftKey);
var oldGeom = new OpenLayers.Geometry.Point(oldX, oldY);
var centerGeometry = control.center;
this.rotate(-control.rotation, centerGeometry);
oldGeom.rotate(-control.rotation, centerGeometry);
var dx1 = this.x - centerGeometry.x;
var dy1 = this.y - centerGeometry.y;
var dx0 = dx1 - (this.x - oldGeom.x);
var dy0 = dy1 - (this.y - oldGeom.y);
this.x = oldX;
this.y = oldY;
var scale, ratio = 1;
if (reshape) {
scale = Math.abs(dy0) < 0.00001 ? 1 : dy1 / dy0;
ratio = (Math.abs(dx0) < 0.00001 ? 1 : (dx1 / dx0)) / scale;
} else {
var l0 = Math.sqrt((dx0 * dx0) + (dy0 * dy0));
var l1 = Math.sqrt((dx1 * dx1) + (dy1 * dy1));
scale = l1 / l0;
}
// rotate the box to 0 before resizing - saves us some
// calculations and is inexpensive because we don't drawFeature.
control._moving = true;
control.box.geometry.rotate(-control.rotation, centerGeometry);
delete control._moving;
control.box.geometry.resize(scale, centerGeometry, ratio);
control.box.geometry.rotate(control.rotation, centerGeometry);
control.transformFeature({scale: scale, ratio: ratio});
};
// Override for rotation handle move - make sure that the box and
// other handles are updated, and finally transform the feature.
var rotationHandleMoveFn = function(x, y){
var oldX = this.x, oldY = this.y;
OpenLayers.Geometry.Point.prototype.move.call(this, x, y);
if(control._moving) {
return;
}
var evt = control.dragControl.handlers.drag.evt;
var constrain = (evt && evt.shiftKey) ? 45 : 1;
var centerGeometry = control.center;
var dx1 = this.x - centerGeometry.x;
var dy1 = this.y - centerGeometry.y;
var dx0 = dx1 - x;
var dy0 = dy1 - y;
this.x = oldX;
this.y = oldY;
var a0 = Math.atan2(dy0, dx0);
var a1 = Math.atan2(dy1, dx1);
var angle = a1 - a0;
angle *= 180 / Math.PI;
control._angle = (control._angle + angle) % 360;
var diff = control.rotation % constrain;
if(Math.abs(control._angle) >= constrain || diff !== 0) {
angle = Math.round(control._angle / constrain) * constrain -
diff;
control._angle = 0;
control.box.geometry.rotate(angle, centerGeometry);
control.transformFeature({rotation: angle});
}
};
var handles = new Array(8);
var rotationHandles = new Array(4);
var geom, handle, rotationHandle;
for(var i=0; i<8; ++i) {
geom = box.geometry.components[i];
handle = new OpenLayers.Feature.Vector(geom.clone(), null,
typeof this.renderIntent == "string" ? null :
this.renderIntent);
if(i % 2 == 0) {
rotationHandle = new OpenLayers.Feature.Vector(geom.clone(),
null, typeof this.rotationHandleSymbolizer == "string" ?
null : this.rotationHandleSymbolizer);
rotationHandle.geometry.move = rotationHandleMoveFn;
geom._rotationHandle = rotationHandle;
rotationHandles[i/2] = rotationHandle;
}
geom.move = vertexMoveFn;
geom.resize = vertexResizeFn;
geom.rotate = vertexRotateFn;
handle.geometry.move = handleMoveFn;
geom._handle = handle;
handles[i] = handle;
}
this.box = box;
this.rotationHandles = rotationHandles;
this.handles = handles;
},
/**
* Method: createControl
* Creates a DragFeature control for this control.
*/
createControl: function() {
var control = this;
this.dragControl = new OpenLayers.Control.DragFeature(this.layer, {
documentDrag: true,
// avoid moving the feature itself - move the box instead
moveFeature: function(pixel) {
if(this.feature === control.feature) {
this.feature = control.box;
}
OpenLayers.Control.DragFeature.prototype.moveFeature.apply(this,
arguments);
},
// transform while dragging
onDrag: function(feature, pixel) {
var geom = feature.geometry;
if(feature === control.box) {
control.transformFeature({center: control.center});
control.drawHandles();
}
},
// set a new feature
onStart: function(feature, pixel) {
var eligible = !control.geometryTypes ||
OpenLayers.Util.indexOf(control.geometryTypes,
feature.geometry.CLASS_NAME) !== -1;
var i = OpenLayers.Util.indexOf(control.handles, feature);
i += OpenLayers.Util.indexOf(control.rotationHandles,
feature);
if(feature !== control.feature && feature !== control.box &&
i == -2 && eligible) {
control.setFeature(feature);
}
},
onComplete: function(feature, pixel) {
control.events.triggerEvent("transformcomplete",
{feature: feature});
}
});
},
/**
* Method: drawHandles
* Draws the handles to match the box.
*/
drawHandles: function() {
var layer = this.layer;
for(var i=0; i<8; ++i) {
if(this.rotate && i % 2 === 0) {
layer.drawFeature(this.rotationHandles[i/2],
this.rotationHandleSymbolizer);
}
layer.drawFeature(this.handles[i], this.renderIntent);
}
},
/**
* Method: transformFeature
* Transforms the feature.
*
* Parameters:
* mods - {Object} An object with optional scale, ratio, rotation and
* center properties.
*/
transformFeature: function(mods) {
if(!this._setfeature) {
this.scale *= (mods.scale || 1);
this.ratio *= (mods.ratio || 1);
var oldRotation = this.rotation;
this.rotation = (this.rotation + (mods.rotation || 0)) % 360;
if(this.events.triggerEvent("beforetransform", mods) !== false) {
var feature = this.feature;
var geom = feature.geometry;
var center = this.center;
geom.rotate(-oldRotation, center);
if(mods.scale || mods.ratio) {
geom.resize(mods.scale, center, mods.ratio);
} else if(mods.center) {
feature.move(mods.center.getBounds().getCenterLonLat());
}
geom.rotate(this.rotation, center);
this.layer.drawFeature(feature);
feature.toState(OpenLayers.State.UPDATE);
this.events.triggerEvent("transform", mods);
}
}
this.layer.drawFeature(this.box, this.renderIntent);
this.drawHandles();
},
/**
* APIMethod: destroy
* Take care of things that are not handled in superclass.
*/
destroy: function() {
var geom;
for(var i=0; i<8; ++i) {
geom = this.box.geometry.components[i];
geom._handle.destroy();
geom._handle = null;
geom._rotationHandle && geom._rotationHandle.destroy();
geom._rotationHandle = null;
};
this.box.destroy();
this.box = null;
this.layer = null;
this.dragControl.destroy();
OpenLayers.Control.prototype.destroy.apply(this, arguments);
},
CLASS_NAME: "OpenLayers.Control.TransformFeature"
});

View File

@@ -23,7 +23,7 @@
* - <OpenLayers.Control>
*/
OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: hover
* {Boolean} Send GetFeatureInfo requests when mouse stops moving.
@@ -31,14 +31,6 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
*/
hover: false,
/**
* APIProperty: drillDown
* {Boolean} Drill down over all WMS layers in the map. When
* using drillDown mode, hover is not possible, and an infoFormat that
* returns parseable features is required. Default is false.
*/
drillDown: false,
/**
* APIProperty: maxFeatures
* {Integer} Maximum number of features to return from a WMS query. This
@@ -46,19 +38,12 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
* requests.
*/
maxFeatures: 10,
/** APIProperty: clickCallback
* {String} The click callback to register in the
* {<OpenLayers.Handler.Click>} object created when the hover
* option is set to false. Default is "click".
*/
clickCallback: "click",
/**
* Property: layers
* {Array(<OpenLayers.Layer.WMS>)} The layers to query for feature info.
* If omitted, all map WMS layers with a url that matches this <url> or
* <layerUrls> will be considered.
* <layerUrl> will be considered.
*/
layers: null,
@@ -146,20 +131,14 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
* Constant: EVENT_TYPES
*
* Supported event types (in addition to those from <OpenLayers.Control>):
* beforegetfeatureinfo - Triggered before the request is sent.
* The event object has an *xy* property with the position of the
* mouse click or hover event that triggers the request.
* getfeatureinfo - Triggered when a GetFeatureInfo response is received.
* The event object has a *text* property with the body of the
* response (String), a *features* property with an array of the
* parsed features, an *xy* property with the position of the mouse
* click or hover event that triggered the request, and a *request*
* property with the request itself. If drillDown is set to true and
* multiple requests were issued to collect feature info from all
* layers, *text* and *request* will only contain the response body
* and request object of the last request.
* property with the request itself.
*/
EVENT_TYPES: ["beforegetfeatureinfo", "getfeatureinfo"],
EVENT_TYPES: ["getfeatureinfo"],
/**
* Constructor: <OpenLayers.Control.WMSGetFeatureInfo>
@@ -184,12 +163,8 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
options.formatOptions
);
}
if(this.drillDown === true) {
this.hover = false;
}
if(this.hover) {
if (this.hover) {
this.handler = new OpenLayers.Handler.Hover(
this, {
'move': this.cancelHover,
@@ -199,10 +174,8 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
'delay': 250
}));
} else {
var callbacks = {};
callbacks[this.clickCallback] = this.getInfoForClick;
this.handler = new OpenLayers.Handler.Click(
this, callbacks, this.handlerOptions.click || {});
this.handler = new OpenLayers.Handler.Click(this,
{click: this.getInfoForClick}, this.handlerOptions.click || {});
}
},
@@ -243,7 +216,6 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
* evt - {<OpenLayers.Event>}
*/
getInfoForClick: function(evt) {
this.events.triggerEvent("beforegetfeatureinfo", {xy: evt.xy});
// Set the cursor to "wait" to tell the user we're working on their
// click.
OpenLayers.Element.addClass(this.map.viewPortDiv, "olCursorWait");
@@ -258,7 +230,6 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
* evt - {Object}
*/
getInfoForHover: function(evt) {
this.events.triggerEvent("beforegetfeatureinfo", {xy: evt.xy});
this.request(evt.xy, {hover: true});
},
@@ -280,8 +251,9 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
*/
findLayers: function() {
var candidates = this.layers || this.map.layers;
var layers = [];
var candidates = this.layers || this.map.layers;
var layer, url;
for(var i=0, len=candidates.length; i<len; ++i) {
layer = candidates[i];
@@ -290,14 +262,15 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
url = layer.url instanceof Array ? layer.url[0] : layer.url;
// if the control was not configured with a url, set it
// to the first layer url
if(this.drillDown === false && !this.url) {
if(!this.url) {
this.url = url;
}
if(this.drillDown === true || this.urlMatches(url)) {
if(this.urlMatches(url)) {
layers.push(layer);
}
}
}
return layers;
},
@@ -326,89 +299,6 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
return matches;
},
/**
* Method: buildWMSOptions
* Build an object with the relevant WMS options for the GetFeatureInfo request
*
* Parameters:
* url - {String} The url to be used for sending the request
* layers - {Array(<OpenLayers.Layer.WMS)} An array of layers
* clickPosition - {<OpenLayers.Pixel>} The position on the map where the mouse
* event occurred.
* format - {String} The format from the corresponding GetMap request
*/
buildWMSOptions: function(url, layers, clickPosition, format) {
var layerNames = [], styleNames = [];
for (var i = 0, len = layers.length; i < len; i++) {
layerNames = layerNames.concat(layers[i].params.LAYERS);
styleNames = styleNames.concat(this.getStyleNames(layers[i]));
}
var params = OpenLayers.Util.extend({
service: "WMS",
version: layers[0].params.VERSION,
request: "GetFeatureInfo",
layers: layerNames,
query_layers: layerNames,
styles: styleNames,
bbox: this.map.getExtent().toBBOX(null,
layers[0].reverseAxisOrder()),
feature_count: this.maxFeatures,
height: this.map.getSize().h,
width: this.map.getSize().w,
format: format,
info_format: this.infoFormat
}, (parseFloat(layers[0].params.VERSION) >= 1.3) ?
{
crs: this.map.getProjection(),
i: clickPosition.x,
j: clickPosition.y
} :
{
srs: this.map.getProjection(),
x: clickPosition.x,
y: clickPosition.y
}
);
OpenLayers.Util.applyDefaults(params, this.vendorParams);
return {
url: url,
params: OpenLayers.Util.upperCaseObject(params),
callback: function(request) {
this.handleResponse(clickPosition, request);
},
scope: this
};
},
/**
* Method: getStyleNames
* Gets the STYLES parameter for the layer. Make sure the STYLES parameter
* matches the LAYERS parameter
*
* Parameters:
* layer - {<OpenLayers.Layer.WMS>}
*
* Returns:
* {Array(String)} The STYLES parameter
*/
getStyleNames: function(layer) {
// in the event of a WMS layer bundling multiple layers but not
// specifying styles,we need the same number of commas to specify
// the default style for each of the layers. We can't just leave it
// blank as we may be including other layers that do specify styles.
var styleNames;
if (layer.params.STYLES) {
styleNames = layer.params.STYLES;
} else {
if (layer.params.LAYERS instanceof Array) {
styleNames = new Array(layer.params.LAYERS.length);
} else { // Assume it's a String
styleNames = layer.params.LAYERS.replace(/[^,]/g, "");
}
}
return styleNames;
},
/**
* Method: request
* Sends a GetFeatureInfo request to the WMS
@@ -422,70 +312,64 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
* - *hover* {Boolean} true if we do the request for the hover handler
*/
request: function(clickPosition, options) {
var layers = this.findLayers();
if(layers.length == 0) {
// Reset the cursor.
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
return;
}
options = options || {};
if(this.drillDown === false) {
var wmsOptions = this.buildWMSOptions(this.url, layers,
clickPosition, layers[0].params.FORMAT);
var layerNames = [];
var styleNames = [];
var layers = this.findLayers();
if(layers.length > 0) {
for (var i = 0, len = layers.length; i < len; i++) {
layerNames = layerNames.concat(layers[i].params.LAYERS);
// in the event of a WMS layer bundling multiple layers but not
// specifying styles,we need the same number of commas to specify
// the default style for each of the layers. We can't just leave it
// blank as we may be including other layers that do specify styles.
if (layers[i].params.STYLES) {
styleNames = styleNames.concat(layers[i].params.STYLES);
} else {
if (layers[i].params.LAYERS instanceof Array) {
styleNames = styleNames.concat(new Array(layers[i].params.LAYERS.length));
} else { // Assume it's a String
styleNames = styleNames.concat(layers[i].params.LAYERS.replace(/[^,]/g, ""));
}
}
}
var wmsOptions = {
url: this.url,
params: OpenLayers.Util.applyDefaults({
service: "WMS",
version: "1.1.0",
request: "GetFeatureInfo",
layers: layerNames,
query_layers: layerNames,
styles: styleNames,
bbox: this.map.getExtent().toBBOX(),
srs: this.map.getProjection(),
feature_count: this.maxFeatures,
x: clickPosition.x,
y: clickPosition.y,
height: this.map.getSize().h,
width: this.map.getSize().w,
info_format: this.infoFormat
}, this.vendorParams),
callback: function(request) {
this.handleResponse(clickPosition, request);
},
scope: this
};
var response = OpenLayers.Request.GET(wmsOptions);
if (options.hover === true) {
this.hoverRequest = response.priv;
}
} else {
this._requestCount = 0;
this._numRequests = 0;
this.features = [];
// group according to service url to combine requests
var services = {}, url;
for(var i=0, len=layers.length; i<len; i++) {
var layer = layers[i];
var service, found = false;
url = layer.url instanceof Array ? layer.url[0] : layer.url;
if(url in services) {
services[url].push(layer);
} else {
this._numRequests++;
services[url] = [layer];
}
}
var layers;
for (var url in services) {
layers = services[url];
var wmsOptions = this.buildWMSOptions(url, layers,
clickPosition, layers[0].params.FORMAT);
OpenLayers.Request.GET(wmsOptions);
}
// Reset the cursor.
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
}
},
/**
* Method: triggerGetFeatureInfo
* Trigger the getfeatureinfo event when all is done
*
* Parameters:
* request - {XMLHttpRequest} The request object
* xy - {<OpenLayers.Pixel>} The position on the map where the
* mouse event occurred.
* features - {Array(<OpenLayers.Feature.Vector>)}
*/
triggerGetFeatureInfo: function(request, xy, features) {
this.events.triggerEvent("getfeatureinfo", {
text: request.responseText,
features: features,
request: request,
xy: xy
});
// Reset the cursor.
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
},
/**
* Method: handleResponse
@@ -503,18 +387,16 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
doc = request.responseText;
}
var features = this.format.read(doc);
if (this.drillDown === false) {
this.triggerGetFeatureInfo(request, xy, features);
} else {
this._requestCount++;
this._features = (this._features || []).concat(features);
if (this._requestCount === this._numRequests) {
this.triggerGetFeatureInfo(request, xy, this._features.concat());
delete this._features;
delete this._requestCount;
delete this._numRequests;
}
}
this.events.triggerEvent("getfeatureinfo", {
text: request.responseText,
features: features,
request: request,
xy: xy
});
// Reset the cursor.
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
},
/**

View File

@@ -51,13 +51,12 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, {
*/
zoomBox: function (position) {
if (position instanceof OpenLayers.Bounds) {
var bounds;
if (!this.out) {
var minXY = this.map.getLonLatFromPixel(
new OpenLayers.Pixel(position.left, position.bottom));
var maxXY = this.map.getLonLatFromPixel(
new OpenLayers.Pixel(position.right, position.top));
bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat,
var bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat,
maxXY.lon, maxXY.lat);
} else {
var pixWidth = Math.abs(position.right-position.left);
@@ -71,7 +70,7 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, {
var xmax = center.lon + (extent.getWidth()/2)*zoomFactor;
var ymin = center.lat - (extent.getHeight()/2)*zoomFactor;
var ymax = center.lat + (extent.getHeight()/2)*zoomFactor;
bounds = new OpenLayers.Bounds(xmin, ymin, xmax, ymax);
var bounds = new OpenLayers.Bounds(xmin, ymin, xmax, ymax);
}
// always zoom in/out
var lastZoom = this.map.getZoom();

View File

@@ -435,14 +435,6 @@ OpenLayers.Events = OpenLayers.Class({
*/
includeXY: false,
/**
* Method: clearMouseListener
* A version of <clearMouseCache> that is bound to this instance so that
* it can be used with <OpenLayers.Event.observe> and
* <OpenLayers.Event.stopObserving>.
*/
clearMouseListener: null,
/**
* Constructor: OpenLayers.Events
* Construct an OpenLayers.Events object.
@@ -466,11 +458,6 @@ OpenLayers.Events = OpenLayers.Class({
this.eventHandler = OpenLayers.Function.bindAsEventListener(
this.handleBrowserEvent, this
);
// to be used with observe and stopObserving
this.clearMouseListener = OpenLayers.Function.bind(
this.clearMouseCache, this
);
// if eventTypes is specified, create a listeners list for each
// custom application event.
@@ -494,11 +481,6 @@ OpenLayers.Events = OpenLayers.Class({
destroy: function () {
if (this.element) {
OpenLayers.Event.stopObservingElement(this.element);
if(this.element.hasScrollEvent) {
OpenLayers.Event.stopObserving(
window, "scroll", this.clearMouseListener
);
}
}
this.element = null;
@@ -550,29 +532,16 @@ OpenLayers.Events = OpenLayers.Class({
},
/**
* APIMethod: on
* Method: on
* Convenience method for registering listeners with a common scope.
* Internally, this method calls <register> as shown in the examples
* below.
*
* Example use:
* (code)
* // register a single listener for the "loadstart" event
* events.on({"loadstart", loadStartListener});
*
* // this is equivalent to the following
* events.register("loadstart", undefined, loadStartListener);
*
* // register multiple listeners to be called with the same `this` object
* events.on({
* "loadstart": loadStartListener,
* "loadend": loadEndListener,
* scope: object
* });
*
* // this is equivalent to the following
* events.register("loadstart", object, loadStartListener);
* events.register("loadstart", object, loadEndListener);
* (end)
*/
on: function(object) {
@@ -654,29 +623,16 @@ OpenLayers.Events = OpenLayers.Class({
},
/**
* APIMethod: un
* Method: un
* Convenience method for unregistering listeners with a common scope.
* Internally, this method calls <unregister> as shown in the examples
* below.
*
* Example use:
* (code)
* // unregister a single listener for the "loadstart" event
* events.un({"loadstart", loadStartListener});
*
* // this is equivalent to the following
* events.unregister("loadstart", undefined, loadStartListener);
*
* // unregister multiple listeners with the same `this` object
* events.un({
* "loadstart": loadStartListener,
* "loadend": loadEndListener,
* scope: object
* });
*
* // this is equivalent to the following
* events.unregister("loadstart", object, loadStartListener);
* events.unregister("loadstart", object, loadEndListener);
* (end)
*/
un: function(object) {
@@ -817,7 +773,8 @@ OpenLayers.Events = OpenLayers.Class({
if (!this.includeXY) {
this.clearMouseCache();
} else if (!this.element.hasScrollEvent) {
OpenLayers.Event.observe(window, "scroll", this.clearMouseListener);
OpenLayers.Event.observe(window, 'scroll',
OpenLayers.Function.bind(this.clearMouseCache, this));
this.element.hasScrollEvent = true;
}

View File

@@ -90,10 +90,6 @@ OpenLayers.Feature = OpenLayers.Class({
this.layer.map.removePopup(this.popup);
}
}
// remove the marker from the layer
if (this.layer != null && this.marker != null) {
this.layer.removeMarker(this.marker);
}
this.layer = null;
this.id = null;

View File

@@ -67,13 +67,6 @@ OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, {
* {Object}
*/
style: null,
/**
* APIProperty: url
* {String} If this property is set it will be taken into account by
* {<OpenLayers.HTTP>} when upadting or deleting the feature.
*/
url: null,
/**
* Property: renderIntent
@@ -166,27 +159,6 @@ OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, {
}
return onScreen;
},
/**
* Method: getVisibility
* Determine whether the feature is displayed or not. It may not displayed
* because:
* - its style display property is set to 'none',
* - it doesn't belong to any layer,
* - the styleMap creates a symbolizer with display property set to 'none'
* for it,
* - the layer which it belongs to is not visible.
*
* Returns:
* {Boolean} The feature is currently displayed.
*/
getVisibility: function() {
return !(this.style && this.style.display == 'none' ||
!this.layer ||
this.layer && this.layer.styleMap &&
this.layer.styleMap.createSymbolizer(this, this.renderIntent).display == 'none' ||
this.layer && !this.layer.getVisibility());
},
/**
* Method: createMarker
@@ -360,7 +332,6 @@ OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, {
* graphicOpacity - {Number} Opacity (0-1) for an external graphic.
* graphicXOffset - {Number} Pixel offset along the positive x axis for displacing an external graphic.
* graphicYOffset - {Number} Pixel offset along the positive y axis for displacing an external graphic.
* rotation - {Number} For point symbolizers, this is the rotation of a graphic in the clockwise direction about its center point (or any point off center as specified by graphicXOffset and graphicYOffset).
* graphicZIndex - {Number} The integer z-index value to use in rendering.
* graphicName - {String} Named graphic to use when rendering points. Supported values include "circle" (default),
* "square", "star", "x", "cross", "triangle".
@@ -378,12 +349,7 @@ OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, {
* alignment. Valid values for horizontal alignment: "l"=left, "c"=center, "r"=right. Valid values for vertical
* alignment: "t"=top, "m"=middle, "b"=bottom. Example values: "lt", "cm", "rb". The canvas renderer does not
* support vertical alignment, it will always use "b".
* labelXOffset - {Number} Pixel offset along the positive x axis for displacing the label.
* labelYOffset - {Number} Pixel offset along the positive y axis for displacing the label.
* labelSelect - {Boolean} If set to true, labels will be selectable using SelectFeature or similar controls.
* Default is false.
* fontColor - {String} The font color for the label, to be provided like CSS.
* fontOpacity - {Number} Opacity (0-1) for the label
* fontFamily - {String} The font family for the label, to be provided like in CSS.
* fontSize - {String} The font size for the label, to be provided like in CSS.
* fontWeight - {String} The font weight for the label, to be provided like in CSS.

Some files were not shown because too many files have changed in this diff Show More