Compare commits

...

342 Commits

Author SHA1 Message Date
bartvde
07dada3e0f Tagging the 2.9 rc3 Release
git-svn-id: http://svn.openlayers.org/tags/openlayers/release-2.9-rc3@10220 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-04-15 15:27:11 +00:00
bartvde
0a87606285 pulling up #2582 into the 2.9 branch
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.9@10219 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-04-15 14:58:05 +00:00
bartvde
12264fb33a pullup #2581 into the 2.9 branch
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.9@10218 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-04-15 14:55:44 +00:00
bartvde
91752898e0 pulling r10200 (ticket:2398) into the 2.9 branch
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.9@10205 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-04-13 05:27:43 +00:00
bartvde
ac1e566b70 pullup #2558 to the 2.9 branch in time for RC2
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.9@10185 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-04-08 13:39:23 +00:00
bartvde
9359035324 pullup #2569 to the 2.9 branch in time for RC2
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.9@10184 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-04-08 13:29:39 +00:00
bartvde
21b5141c09 forgot to pullup tests for #2561 and #2562 for 2.9 RC2
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.9@10176 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-04-08 06:26:36 +00:00
bartvde
bada3d98a1 Pullup #2561 #2562 #2563 #2564 for 2.9RC2
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.9@10175 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-04-08 06:23:01 +00:00
bartvde
2150a2c783 Branching for the 2.9 Release
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.9@10146 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-26 15:14:59 +00:00
Tim Schaub
20cbb95feb Avoid pink in primary example.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10145 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-25 17:07:21 +00:00
Tim Schaub
14ac071f20 Demonstrate the control of z-index in different render intents.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10144 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-25 17:04:26 +00:00
Tim Schaub
e7d3e64908 Adding an example of rule based style.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10143 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-24 18:27:57 +00:00
Tim Schaub
3de62b703a Adding multi property to the DrawFeature control. If true, geometries will be cast to multi-part counterparts before features are added to the target layer. r=ahocevar (closes #2542)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10142 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-23 17:49:13 +00:00
bartvde
ff8b356638 fix up Layer.Vector tests in IE which were broken as of r10039, r=elemoine (closes #2465)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10141 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-23 08:19:11 +00:00
pgiraud
180eb8485f let's remove unrequired tests, r=bartvde, (Closes #2477)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10140 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-22 16:44:16 +00:00
bartvde
48cc4b138b reverting r10112 Spelling of API methods getURL and setUrl of imagelayers is inconsistent and confusing, see ticket:2354
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10139 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-22 07:29:35 +00:00
ahocevar
f4fbc96036 fixed KML parsing for cases where a line break is only before or after a CDATA block. r=bartvde (closes #2398)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10138 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-21 21:10:33 +00:00
Tim Schaub
1f77d278ef Demonstrating that graphicXOffset works the same in IE and FF.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10137 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-21 18:00:33 +00:00
ahocevar
7632e54a4d fixed rotation center for non-square symbols in non-defs mode (Webkit). r=bartvde (closes #2499)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10136 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-20 21:50:39 +00:00
ahocevar
35168dc219 fixing rotation so previously rotated geometries will be rotated back if the rotation symbolizer attribute is not set any more. r=bartvde (closes #2500)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10135 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-20 21:33:36 +00:00
Tim Schaub
a5bb2b01b3 Adding tests for encoding & decoding URI components to avoid future regressions.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10134 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-20 03:46:49 +00:00
Tim Schaub
5038090d74 Being liberal in what we accept in query strings. A properly encoded '+' should be '%2B' in a URI component. A properly encoded ' ' (space) should be '%20'. When we encounter a '+', we can safely replace it with ' ' before properly decoding the remainder of the component. This follows the convention that '+' is used widely to represent a space in a URL. r=bartvde (closes #2527)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10133 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-20 03:06:22 +00:00
Tim Schaub
fcfb22920b Reverting r10130 to avoid double decoding (see #1704).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10132 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-20 02:48:55 +00:00
Tim Schaub
d324395de6 Test to demonstrate regression introduced in r10130 (see #1704).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10131 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-20 02:47:32 +00:00
bartvde
a1db2ca642 Malformed URI sequence in Firefox when using special characters in url, p=jaj@gecko.no, r=me (closes #1704)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10130 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 20:57:37 +00:00
Frédéric Junod
1faed26393 extend Protocol.HTTP for MapFish and FeatureServer. p=elemoine, r=bartvde,me (closes #2393)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10129 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 15:12:50 +00:00
Frédéric Junod
fe9aa59b91 remove unused mapRect variable, add missing semicolons, non-functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10128 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 13:34:45 +00:00
crschmidt
3304c6cb0e "MousePosition control should support mouseOut event", r=bartvde,
initial patch cmoullet, (Closes #2404)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@10127 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 13:34:14 +00:00
Frédéric Junod
cca74e7635 fix semicolons and remove a global var
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10126 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 13:22:56 +00:00
Frédéric Junod
27234b07ff mark Element.getDimensions as deprecated and remove the workaround in Map.getCurrentSize. p=bbinet, r=me (closes #2414)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10125 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 12:38:29 +00:00
bartvde
223547e227 fix up Format/CSWGetRecords/v2_0_2.html tests in IE6, non-functional change (closes #2537)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10124 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 12:30:23 +00:00
bartvde
6ecdf6c1aa fix up Control ScaleLine tests in IE6
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10123 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 11:52:42 +00:00
bartvde
1c51a13903 fix up tests for Google Layer if there is no valid key (closes #2535)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10122 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 11:22:13 +00:00
bartvde
c1409ee57d fix up ArcGIS93Rest Layer tests (closes #2533)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10121 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 10:45:27 +00:00
bartvde
ba91df7f1b fix up tests in Layer.html after clone method was changed, since the clone now represents the original in its current state, and not the state at creation, two tests had to be adapted, non-functional change (closes #2477)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10120 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 10:02:08 +00:00
Frédéric Junod
48ba06b294 remove unneeded layerswitcher div and add a transitionEffect
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10119 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 09:47:30 +00:00
Frédéric Junod
4ab6b7ec24 Layer.MapGuide.getURL: use map.getSize instead of map.getCurrentSize. r=bartvde (closes #2532)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10118 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 09:38:46 +00:00
Éric Lemoine
76983744da changes to WMSGetFeatureInfo so requests can be sent on click,
rightclick, and dblclick, r=bartvde (closes #2528)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10117 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 09:35:53 +00:00
Frédéric Junod
37e0c0b4f5 LinearRing.getCentroid: return null if the geometry has no components. r=pgiraud (closes #2530)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10116 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 09:05:12 +00:00
bartvde
c54dc76d15 when select feature control is destroyed and layers parameter was an array, the root container is not moved correctly, p=jorix, r=ahocevar,me (closes #2502)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10115 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 09:00:41 +00:00
Frédéric Junod
1757d4082e deactivate on clear. r=bartvde (closes #2471)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10114 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 08:46:36 +00:00
bartvde
fc4e05dd83 canvas and textAlign: middle not recognized, I made one change to original patch to not include the default value in LABEL_ALIGN since I did not see the purpose of adding that, p=fredj, r=me (closes #2439)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10113 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 08:14:48 +00:00
bartvde
3e5bd85849 Spelling of API methods getURL and setUrl of imagelayers is inconsistent and confusing, p=marcjansen, r=me (closes #2354)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10112 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-19 07:54:11 +00:00
Frédéric Junod
dc5fa3c612 add missing semicolon, remove global variables. r=bartvde (closes #2529)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10111 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-18 13:30:33 +00:00
ahocevar
e7b0857e31 Give the ScaleLine control a geodesic option. Setting this to true will provide an accurate scale bar in Spherical Mercator maps. r=bartvde (closes #1890)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10110 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-18 13:26:02 +00:00
bartvde
1dd852ef09 Layer.WFS missing OpenLayers.Util.upperCaseObject(params), p=pdziemiela, r=elemoine,me (closes #2362)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10109 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-18 13:19:42 +00:00
ahocevar
a036ffff1b reverted previous comment change - the comment was correct, we are dealing with kilometers here. non-functional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10108 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-17 23:12:38 +00:00
bartvde
bc1246877e use layer.filter in Strategy.Fixed, p=pspencer, r=tschaub (closes #2152)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10107 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-17 21:22:51 +00:00
bartvde
e061da04c9 fix bug in panzoombar slider, p=sowee, r=me (closes #2384)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10106 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-17 21:16:01 +00:00
bartvde
1d6c1f437e change property zoomBarDiv to zoombarDiv to match the actual code in PanZoomBar, reported by Gerardo, non-functional change (closes #2188)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10105 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-17 20:46:47 +00:00
bartvde
4e2d70b770 support pointRadius for canvas renderer, p=gregers, r=me (closes #2126)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10104 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-17 20:31:58 +00:00
bartvde
90c6a020c7 add 2 more resolutions to Bing Maps, p=fredj, r=me (closes #1893)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10103 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-17 20:21:38 +00:00
ahocevar
891b12160c fixed comment - distVincenty returns meters, not kilometers. Non-functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10102 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-17 17:47:18 +00:00
bartvde
bc84b54343 bbox strategy should call loadend when aborting, p=fvanderbiest, r=me (closes #2504)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10100 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-16 15:16:19 +00:00
Frédéric Junod
fd768cf170 fix all examples title. non-functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10098 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-12 07:44:02 +00:00
bartvde
6fa1a14456 Change domain name in ArcIMS samples, p=dzwarg, non-functional change (closes #2514)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10097 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-11 17:15:25 +00:00
ahocevar
94c4837475 Fixed typo in LayerSwitcher. Thanks Pierre for the quick review response. r=pgiraud (closes #2512)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10096 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-09 09:59:09 +00:00
ahocevar
3d4d2de615 added rotation to "select" intent - helps us to find renderer rotation issues
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10087 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-05 06:51:44 +00:00
ahocevar
22f0f933fb Added Layer.Zoomify. This is a late follow-up on the FOSS4G 2009 sprint
in Sydney. Thanks Petr for the hard work on this. p=klokan, r=me (closes 
#1285)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@10086 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-04 08:41:18 +00:00
ahocevar
8adcc155fb Added Map::addControls method. Yet another quality patch from Marc, with everything done right plus unit tests. p=marcjansen, r=me (closes #2399)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10085 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-02 21:39:23 +00:00
Tim Schaub
a27c552554 Switching to a proxy that allows POST.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10084 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-03-01 17:12:00 +00:00
bartvde
ac60e4fcf6 load events not working properly in OpenLayers.Tile.Image.IFrame, r=fvanderbiest (closes #2406)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10082 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-23 17:16:49 +00:00
Tim Schaub
09a858559b Adding clone method to the Google layer. r=ahocevar (closes #2473)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10081 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-20 20:14:53 +00:00
ahocevar
2eb866658a fixed visibility issue with allOverlays:true. r=pgiraud (closes #2328)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10079 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-17 18:12:29 +00:00
Frédéric Junod
876fdebec9 OpenLayers.Util.getParameters: decodeURIComponent the keys, not only the values. r=elemoine (closes #2327)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10071 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-17 06:59:49 +00:00
Frédéric Junod
662564957c Move the control.div styling from the code to style.css. r=elemoine (closes #2476)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10070 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-16 08:21:25 +00:00
ahocevar
e21dc76468 hide Terms Of Use for invisible Google Layers using a negative offset,
because during GMap2 initialization, we don't have control over 
style.display. r=fredj (closes #2328)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@10069 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-16 08:05:52 +00:00
pgiraud
b165d015e1 adds a zoomBoxEnabled boolean option in Control.Navigation, r=ahocevar, (Closes #2416)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10067 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-15 13:08:28 +00:00
pgiraud
7a546bf5c5 fixed the unit tests on OpenLayers.js (broken since r9935), patch from Andreas who found a nice and clean way to bypass the cache system on _getScriptLocation for the tests, r=me,fredj (Closes #2389)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10066 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-15 12:41:23 +00:00
bartvde
5c03ebd729 change comment for maxFeatures in OpenLayers.Control.GetFeature
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10065 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-15 10:30:40 +00:00
pgiraud
7179166603 adds a new getVisibility method in the Feature.Vector class, used in the SelectFeature control this method now allows us to tell the select feature box handler wether to select or not the features, r=ahocevar, (Closes #2418)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10064 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-15 09:05:49 +00:00
ahocevar
6b7fd781ee fixed VML renderer so it does not change fillColor on node._style
anymore when rendering externalGraphic. r=fredj (closes #2485)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@10063 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-15 08:19:37 +00:00
ahocevar
e17dc78e1d now that we truncate instead of rounding, graphics with odd width are shifted .5 pixels to the left (to the right before that change).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10061 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-13 17:31:13 +00:00
ahocevar
fbc9a6f43a fixed regression with broken polygon fills. r=crschmidt (closes #2465)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10049 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-11 15:57:26 +00:00
ahocevar
50f26e3313 Changing our layers' clone methods so they create a clone of the layer state at the time of clone creation, not at the time the original was created. r=tschaub (closes #2477)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10045 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-10 21:29:37 +00:00
Tim Schaub
83297678ba Allowing layers, center, and zoom to be set in the layer constructor. r=ahocevar (closes #2480)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10044 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-10 20:14:02 +00:00
ahocevar
2e47542fbe give map::getResolution a fallback from baseLayer to the 1st layer if in allOverlays mode. r=tschaub (closes #2479)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10043 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-10 19:05:58 +00:00
Tim Schaub
e5e4d49d33 Destroying what we create.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10042 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-10 18:43:20 +00:00
ahocevar
5050814fa4 remove acceptance test again, because this can easily be shown in a unit test instead (see #2477)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10041 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-10 13:01:14 +00:00
ahocevar
15de885540 Acceptance test checking for proper clone() behavior (see #2477)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10040 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-10 12:53:45 +00:00
ahocevar
6811dc3745 Fix initial offset and visibility issues in VML renderer; also make sure that all floats are converted to integers (previously using toFixed(), now using (num | 0)). p=tschaub,me, r=tschaub,me (closes #2465)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10039 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-10 07:04:31 +00:00
ahocevar
b19261d417 Update size of invisible Google layer before making it visible. r=tschaub (closes #2475)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10038 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-10 06:58:21 +00:00
Tim Schaub
74aaf479a5 Making this closer to a positive assertion.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10037 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-09 23:01:47 +00:00
ahocevar
ec8e2146ec manual test showing a regression (see #1797)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10036 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-09 20:24:59 +00:00
ahocevar
0af99e0de7 Give the GetFeature control a beforefeaturesselected and featuresselected event. p=komacke, r=me (closes #2442)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10035 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-09 12:30:02 +00:00
bartvde
777ef007ad Make Format.SLD work against ArcGIS Server, r=tschaub (closes #2166)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10034 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-09 06:38:54 +00:00
bartvde
1b3af5d26d add ability to write out a WFS Transaction without a geometry, r=tschaub (closes #2033)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10033 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-09 06:26:06 +00:00
Éric Lemoine
07437865db change da-DK.js to UTF-8, p=adube, r=me (closes #2472)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10032 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-09 05:46:23 +00:00
Frédéric Junod
2ba1de77f8 add 2 fixed resolutions to the Google layer. r=bartvde (closes #2429)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10031 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-08 15:35:31 +00:00
Frédéric Junod
d14f3c6c31 remove global and unused variable. r=bartvde (closes #2459)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10030 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-06 14:47:19 +00:00
ahocevar
b2a1dee791 changing google.css so our maps are also terms of use compliant in IE. r=tschaub (closes #2466)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10028 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-05 20:19:56 +00:00
Tim Schaub
db153e199a Correctly parse feature attributes when the attribute name matches the feature type name. r=bartvde (closes #2435)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10027 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-05 20:17:59 +00:00
Tim Schaub
2d61186deb Respecting fractional zoom when desired. Allowing string argument to map.zoomTo. r=bartvde (closes #2180)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10026 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-05 19:48:29 +00:00
Tim Schaub
52f34e0baf Improving the PanZoomBar behavior so that when you click on the bar after dragging to the top, the map doesn't re-zoom on mouse up. r=me (closes #1861)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10025 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-05 19:16:51 +00:00
bartvde
8521ebb7c0 Format.WMC: protect against MinScaleDenominator of 0, r=tschaub thanks tschaub for the updated patch, tests still pass in FF 3.5 and Safari 4 (closes #2028)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10024 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-05 18:13:24 +00:00
Tim Schaub
36d96126eb Ensuring that setVisibility is called during setBaseLayer for layers where visibility is true. (With allOverlays true, a layer doesn't have to be visible to beocome the base layer - twisted huh?) r=ahocevar (closes #2290)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10023 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-05 16:38:34 +00:00
Tim Schaub
06d2b4229d Making it so the Map constructor doesn't fail when the provided viewport element isn't displayed. r=ahocevar (closes #2461)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10022 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-04 19:49:10 +00:00
Tim Schaub
929e6b323c Reworking the Google layer so that a shared GMap object is used for all Google layers on a single map. This reduces the DOM overhead and gets rid of map resizing issues. Excellent solution by ahocevar. r=me,ahocevar (closes #1797).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10021 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-04 19:18:53 +00:00
Tim Schaub
77ffdf7248 Give all elements position for IE.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10020 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-04 17:54:12 +00:00
Tim Schaub
37e881bc54 Making it so OpenLayers.Util.getResolutionFromScale returns undefined resolution when given a falsey scale. r=ahocevar (closes #2464, see #2462)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10019 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-04 17:02:23 +00:00
Tim Schaub
ae73ca0679 Including required stylesheet.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10018 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-04 00:25:19 +00:00
Tim Schaub
78a2289d6a Update to multiple Google acceptance test to demonstrate issue with initially visible layer.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10017 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-03 23:55:04 +00:00
Tim Schaub
e3561c3ceb Adding manual acceptance test for multiple Google layers (see #1797).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10016 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-03 18:35:38 +00:00
Tim Schaub
5c7d3e5632 Looks as if /proxy no longer supports POST.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10015 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-03 17:23:12 +00:00
Tim Schaub
a5848fc84d Preserving center and scale when switching base layers. This improves behavior when the map wraps around the domain of the coordinate reference system or when changing between layers in different projections. r=ahocever (closes #2457).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10014 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-03 17:09:17 +00:00
Tim Schaub
af1e754546 Keeping a reference to the event pane when a layer is removed from the map. The pane is set in initialize and set to null in destroy. r=ahocevar (closes #2456)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10013 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-03 16:28:29 +00:00
ahocevar
ec455e81e1 fixed typo that broke fontColor rendering in VML.js. Thanks paco for spotting this. r=fredj (closes #2231)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10011 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-03 14:43:19 +00:00
crschmidt
f927d79977 add 4-line OSM example.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10010 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-03 12:22:40 +00:00
Frédéric Junod
c75e16e5f2 Parse the KML LabelStyle and use the color and opacity value. Create a parseKmlColor function to avoid code duplication. r=pgiraud (closes #2413)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10007 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-03 10:23:19 +00:00
pgiraud
2100d63846 we were missing a break statement in the KML parseStyle method, tests are modified accordingly, r=fredj (Closes #2448)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10006 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-03 09:35:45 +00:00
Frédéric Junod
6223d7fd82 Add a cumulative mode in MouseWheel handler. r=ahocevar (closes #2450)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10002 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-02-01 08:42:17 +00:00
ahocevar
9b728d048d fixed encoding issue in the example description (see #2433)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10000 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-31 14:23:47 +00:00
ahocevar
cb0dffc045 Created a TransformFeature control and added a documentDrag option to the DragFeature control. r=elemoine (closes #2433)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9999 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-31 14:08:36 +00:00
Frédéric Junod
7a78237bdd add missing semicolon
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9980 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-28 11:37:58 +00:00
Éric Lemoine
5edcc97240 cannot unselect on clickout when selecting by drawing a box, r=pgiraud (closes #2204)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9979 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-28 08:07:09 +00:00
Frédéric Junod
153cba8147 New fontOpacity option for vector feature style. r=pgiraud (closes #2438)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9978 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-27 15:31:53 +00:00
Frédéric Junod
86eb16a208 Use style.label as placemark name if available. r=pgiraud (closes #2441)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9977 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-27 15:27:04 +00:00
Frédéric Junod
1f481f3d38 Don't create Folder name or description if foldersName or foldersDesc are null. r=pgiraud (closes #2417)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9976 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-27 14:44:35 +00:00
Frédéric Junod
e5aab2453d set a default EPSG:4326 externalProjection to the KML, OSM and GPX formats. r=pgiraud (closes #2424)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9975 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-27 14:36:46 +00:00
Frédéric Junod
c1f9945838 Extract the kml outline attribute. r=pgiraud (closes #2412)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9974 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-27 14:05:37 +00:00
Frédéric Junod
822e8f5485 don't calculateInRange if it's not needed. r=elemoine (closes #2400)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9958 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-22 08:13:11 +00:00
Éric Lemoine
e562626f87 make OverviewMap.destroy more robust, r=fredj (closes #2430)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9957 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-22 07:35:22 +00:00
Frédéric Junod
8cbac47177 Cast zoom level to integer. r=pgiraud (closes #2180)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9955 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-20 11:05:42 +00:00
ahocevar
ca8222a13c Rotate point geometries only. Committed version differs from the patch (=== instead of == for all geometry type checks). r=tschaub (closes #2423)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9954 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-18 12:44:50 +00:00
ahocevar
da664350fe fixed rotation for browsers that don't support defs/use. Committed version modified from patch version as suggested by tschaub. r=tschaub (closes #2402)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9953 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-18 12:34:56 +00:00
Frédéric Junod
65bed91e4e layer argument was undefined
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9950 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-13 13:03:42 +00:00
pgiraud
14749daa74 finally, this is the good version of the unit tests for the #2320 ticket, sorry for the noise
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9949 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-13 11:02:08 +00:00
pgiraud
5c397b8d0c I forgot to ad the unit tests file in the commit for #2320
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9948 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-13 10:59:52 +00:00
Frédéric Junod
e8d8aa7d47 don't pass the layer to the feature constructor
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9947 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-13 10:24:06 +00:00
Frédéric Junod
9911bb55ce fix tests for buggy webkit. (see #2402)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9946 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-13 10:00:46 +00:00
pgiraud
cca8894b91 added a slideFactor property in the PanPanel control patches from elemoine and me, r=bartvde (closes #2320)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9945 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-13 08:40:41 +00:00
Frédéric Junod
311f47da78 Missing semicolon.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9944 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-12 10:20:41 +00:00
Frédéric Junod
eda2a80187 comment fix, no functional changes
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9943 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-11 09:00:44 +00:00
ahocevar
88b05f55a1 Give Layer.Vector a proper clone() method. r=crschmidt (closes #2391)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9942 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-09 12:01:45 +00:00
Tim Schaub
44ba385429 Removing any onImageLoadError class name from images when they successfully load. r=ahocevar (closes #2407)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9940 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-08 21:14:04 +00:00
ahocevar
9066c0e960 workaround for webkit versions that have problems with defs/use. r=crschmidt (closes #2402)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9937 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-08 16:00:56 +00:00
Frédéric Junod
c64c2e4296 Cache the function result if scriptLocation is ''. r=elemoine (closes #2389)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9936 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-07 08:26:29 +00:00
Frédéric Junod
871a790f3f cache the result of the OpenLayers._getScriptLocation function. r=ahocevar (closes #2389)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9935 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-07 07:22:05 +00:00
ahocevar
8a74ad8ed5 longer timeout to avoid failing test on slow machines
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9934 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-06 16:46:53 +00:00
Tim Schaub
bae2fa59ed Document rotation property for point symbolizers.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9932 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-05 22:13:29 +00:00
ahocevar
f6b00d7ced re-added the layer prefix property that got lost with r9883. r=bartvde (closes #2283)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9931 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-01-04 17:59:24 +00:00
Éric Lemoine
2619586558 add missing semi-colon, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9930 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-27 22:23:28 +00:00
Éric Lemoine
442d760fe5 featuresremoved event is called with zero lenght array if layer.selectedFeature is supplied to layer.removeFeatures, p=igrcic, r,t=me (closes #2379)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9929 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-27 22:16:56 +00:00
Éric Lemoine
be246326ee test that "featuresremoved" listeners are passed the expected features when all the features of the layer are being removed, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9928 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-27 22:05:10 +00:00
Éric Lemoine
52e055294f reorg of test_Layer_Vector_removeFeatures, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9927 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-27 21:44:13 +00:00
bartvde
fcc2057b42 forgot the actual example, should have gone in with r9920
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9921 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-23 11:35:57 +00:00
bartvde
728fcdcda2 adding example for using the Sensor Observation Service client, r=ahocevar (closes #2333)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9920 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-23 11:35:26 +00:00
bartvde
3a6ac9b83f add Protocol for Sensor Observation Service r=ahocevar (closes #2373)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9912 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-21 14:37:08 +00:00
bartvde
2c23d9ff25 add parser for Sensor Observation Service GetFeatureOfInterest method, r=ahocevar (closes #2347)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9911 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-21 14:31:32 +00:00
Tim Schaub
e99979ffe5 Adding a missing verb.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9909 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-19 00:07:25 +00:00
Tim Schaub
e95b023b5e Unconfusing NaturalDocs by putting 'Note:' on a separate line.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9908 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-19 00:06:17 +00:00
Tim Schaub
2ddb4c1927 Doc menu update (futile, I know).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9905 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-17 22:41:02 +00:00
Tim Schaub
7bbacbc7cc Marking events.on and events.un as part of the API. Adding examples for both. If this is not the concensus (that these are part of the API) revert this change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9904 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-17 22:20:49 +00:00
Frédéric Junod
793396a4cb add missing requires (OpenLayers.Format.WMSCapabilities namespace)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9903 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-17 14:18:36 +00:00
Éric Lemoine
321a237d2f overview map control destroys drag handler too late, r=ahocevar (closes #2383)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9902 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-17 08:23:38 +00:00
Tim Schaub
f54fd67504 Adding an Atom parser. Thanks sgillies for the patch (and patience). r=me (closes #1366)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9901 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-17 00:38:13 +00:00
crschmidt
2449b7029c GML v3 is also a dependancy.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9900 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-16 20:48:55 +00:00
crschmidt
3ee6c4663c add missing requires statement.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9899 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-16 20:39:33 +00:00
bartvde
cc4b914fff add format for Sensor Observation Service GetObservation operation, r=ahocevar (closes #2372)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9898 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-16 15:29:41 +00:00
bartvde
b948eb163b adding parser for Sensor Observation Service (SOS) GetCapabilities interface, r=ahocevar (closes #2337)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9897 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-16 14:25:08 +00:00
ahocevar
f5ff990898 removed redundancy (1.0.0 leftover) when parsing srs. r=bartvde (closes #2283)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9896 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-16 12:23:27 +00:00
bartvde
31189f1e45 add WMS 1.3 GetCapabilities parser, r=ahocevar (closes #2294)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9894 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-16 10:24:12 +00:00
bartvde
e9264d89eb rewrite WMS GetCapabilities parser, tests now pass in IE, r=ahocevar (closes #2283)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9883 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-13 15:43:15 +00:00
ahocevar
e6f4a27b93 fixed tests by pulling the geoserver example into the main html.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9882 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-10 22:11:16 +00:00
ahocevar
30b936399a fixed dtd url to avoid failing tests in IE.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9881 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-10 15:13:42 +00:00
Frédéric Junod
6770cffdac form.method is upper case in chrome and lower case in FF.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9880 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-10 07:38:59 +00:00
bartvde
fdb924ebfb make WMSGetFeatureInfo Control WMS 1.3 compatible, r=ahocevar (closes #2355)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9879 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 19:08:55 +00:00
ahocevar
f28ebc2a02 added required layer url to fix failing test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9878 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 17:38:42 +00:00
ahocevar
fe126f123f fixed failing test by parseFloat'ing the frame styles
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9877 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 17:29:21 +00:00
Tim Schaub
11924d0d0f Only zoom by integer values with changes in the mouse wheel. r=bartvde (closes #2376)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9876 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 15:34:19 +00:00
bartvde
711d412f88 WMSGetFeatureInfo control: add support for mutiple WMS services, r=ahocevar (closes #2091)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9874 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 14:29:48 +00:00
Éric Lemoine
b655b14f01 NavigationHistory - move the code for getting the current state from an anonymous function to a method of the class, r=bartvde (closes #2377)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9867 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 11:51:55 +00:00
Tim Schaub
42f06c259b Separating docs from shortdesc.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9866 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 04:36:22 +00:00
Tim Schaub
03a6de0fb7 Removing this for now. Resurrect it if someone can get this service working with GetFeature requests via POST.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9865 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 04:26:14 +00:00
Tim Schaub
e6c6f93477 Going with one WFS-T example.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9864 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 04:13:21 +00:00
Tim Schaub
e0be3f2e65 Updating the wfs-states example.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9863 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 04:04:52 +00:00
Tim Schaub
e10e39b19c Putting the canvas renderer bit in its own example. Using the Vector layer for WFS. Extracting the relevant code and providing an easy to open link for viewing the source.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9862 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 03:11:13 +00:00
Tim Schaub
a23f2229cf Taking down the openmnnd.html example since http://prototype.openmnnd.org/ says it is no longer maintained.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9861 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-09 02:10:47 +00:00
Frédéric Junod
4ff1ece2e4 Use array.indexOf native function when available. p=arno, r=ahocevar
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9859 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-04 08:07:53 +00:00
Frédéric Junod
610c2b9933 method is upper case in code, update test (error reported by chrome)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9858 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-12-04 07:53:41 +00:00
bartvde
ec3d804af4 make OpenLayers.Layer.WFS and OpenLayers.Layer.GML deprecated and provide instructions on what to do now
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9849 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-30 10:15:16 +00:00
Éric Lemoine
40206dc8cf a change to Util.getParameters, which accidentaly slipped in [9757], makes the tests fail, reverting that change. Please join me in saying thanks to our unit tests for catching this :-) r=ahocevar (closes #2357)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9848 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-29 21:47:16 +00:00
bartvde
e60dee85b9 Feature.destroy does not remove marker from layer, p=gregers, r=me (closes #2181)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9847 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-27 15:54:03 +00:00
bartvde
95055aa457 Bad Encoding in Catalan translation breaks IE6, p=edgemaster, r=me (closes #2161)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9846 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-27 13:44:37 +00:00
bartvde
0038def935 use setVisibility instead of directly setting the visibility property, p=sbenthall (closes #2111)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9845 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-27 13:31:25 +00:00
Éric Lemoine
5018aaa4ba provide full names of loadURL and parseXMLString in the API docs, no functional change, thanks David Potts for spotting this
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9843 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-25 15:08:02 +00:00
pgiraud
7b9de2be30 typo in the doc comments, no functional changes
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9842 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-24 17:29:59 +00:00
Éric Lemoine
9e81d4d332 the WFS 1.0 standard does not support specifying the SRS name (srsName) in GetFeature requests, but GeoServer has specific support for this, this patch introduces a boolean option (add srsNameInQuery) to force the addition of srsName, initial patch from fvanderbiest, r=bartvde (closes #2228)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9838 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-23 15:56:56 +00:00
Tim Schaub
d9a982f169 Exposing the documentDrag property on the Navigation control. r=ahocevar (closes #39)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9805 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-18 05:42:17 +00:00
bartvde
081ce883fb create an option to cancel adding a layer, r=tschaub (closes #2121)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9802 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-17 07:34:51 +00:00
Tim Schaub
f57e19ae2d Parse gml:boundedBy elements on features as feature.bounds instead of geometry.bounds. This fixes issues when GML comes without a geometry and it is a more correct representation of the element. r=bartvde (closes #2255)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9801 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-16 22:25:46 +00:00
bartvde
10920f6f93 add parsing of boundedBy in Format.WMSGetFeatureInfo, r=elemoine (closes #2329)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9800 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-16 10:44:02 +00:00
ahocevar
ebc5d7c021 added option to the MouseWheel handler to trigger up/down events only
when wheel is released. r=elemoine (closes #2345)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9799 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-16 10:38:26 +00:00
bartvde
33e39a205a fix up Graticule test in IE, missing var keyword
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9796 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-12 19:28:11 +00:00
bartvde
12c83b533d adding limited support for reading SimpleData from KML ExtendedData SchemaData, keeping structure the same as current ExtendedData support, patch=joh, r=me (closes #2062)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9795 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-12 15:28:20 +00:00
pgiraud
1b95a25ee1 adds the ability for the user to give map options when reading a WMC document, those options are taken into account with higher priority\n this patch also introduces the new util method isElement, r=me,elemoine, thanks Eric (Closes #2339)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9794 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-12 13:43:40 +00:00
ahocevar
c9df8f4d43 Added documentDrag option to the DragPan control and Drag handler.
When set to true, this allow pan-dragging while outside the map. 
Thanks vmx for the initial patches. r=vmx, bartvde (closes #39)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9791 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-10 11:14:28 +00:00
bartvde
01debb1c53 Create a possibility to refresh a layer every N seconds: OpenLayers.Strategy.Refresh, excellent patch by krisgeus, r=me (closes #2317)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9790 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-09 14:43:58 +00:00
bartvde
e77a804559 add setLayer function to SelectFeature control so that we can change the layer attached to the control on the fly, r=ahocevar (closes #2340)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9789 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-08 16:58:33 +00:00
crschmidt
5fd5085eba forgot to make a variable global.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9779 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-03 15:28:33 +00:00
crschmidt
7907a81ae5 Add dynamic text layer example, with BBOX strategy, SelectFeatureControl,
and popups.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9778 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-03 15:26:49 +00:00
bartvde
e003972959 Have Layer.WMS support WMS version 1.3 with the axis order sequence, r=elemoine,crschmidt,ahocevar (closes #2284)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9775 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-03 14:01:51 +00:00
Éric Lemoine
1e87b26029 provide slideFactor default value in the doc, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9774 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-02 16:15:14 +00:00
Éric Lemoine
4ca45ced61 the broken.img is no longer used by the library, remove it, thanks rdewit for catching that (closes #2318)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9773 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-02 13:54:54 +00:00
pgiraud
6f17fa1c9a give the radio buttons for the baselayers in the layer switcher control a name depending on the layerswitcher, this avoids problems with several maps and several layer switchers in the same page, r=bartvde (Closes #2331)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9772 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-02 12:24:03 +00:00
Éric Lemoine
6568eb4d8a do not change the src of broken images, as this prevents from being able to right-click on the image and see the server error, p=rdewit, r=me (closes #2318)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9771 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-02 09:55:18 +00:00
bartvde
d9fd39d547 make spatial filter configurable for OpenLayers.Control.GetFeature, p=rdewit, r=me (closes #2325)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9770 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-11-02 07:12:53 +00:00
bartvde
cf4c14a1e4 clean up duplicate code block from the fix for ticket 2256
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9769 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-30 17:23:47 +00:00
bartvde
5119ffa50e GetFeature doesn't handle Handler.Box case when result of user interaction is a pixel, patch by bjornharrtell, r=me (closes #2256)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9768 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-30 14:28:54 +00:00
Éric Lemoine
6839605b0f theme LayerSwitcher with CSS, r=ahocevar, p=tmcw,me (closes #1632)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9767 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-29 15:45:27 +00:00
Éric Lemoine
ab42111aac code cleanup - remove unused variables and declare local variables, p=avlee, r=me (closes #2326)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9766 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-27 12:15:22 +00:00
Éric Lemoine
316136b346 [9732] broke CSW GetRecords tests, this commit fixes them, patch from bbinet
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9765 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-27 11:04:04 +00:00
ahocevar
4e6c3b1f3e reverted change from r9754 because it breaks applications that register an event before the marker is drawn (see #2258)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9764 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-26 20:41:56 +00:00
ahocevar
dbcab22339 fixed memory leak in the PanZoom control. Thanks rcoup for the patch and the test. p=rcoup, r=me (closes #2323)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9763 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-25 17:36:10 +00:00
ahocevar
56382e8e49 Manual memory leak tests that should have been committed with r9759 and r9760. Thanks rcoup for setting them up. (see #2170)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9761 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-25 01:41:12 +00:00
ahocevar
c67d1f5952 2170_tileEvents.html: fixed memory leak with tile events. p=rcoup, r=me (see #2170)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9760 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-24 09:27:14 +00:00
ahocevar
ee737577f7 2170_anonfuncs.diff: created functions returning true and false instead of using anonymous functions all over. p=rcoup, r=me (see #2170)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9759 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-24 09:23:24 +00:00
ahocevar
f000057659 making pink tiles a css matter. p=rdewit, r=me (closes #2318)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9758 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-24 05:57:41 +00:00
ahocevar
6d43a28da6 added Graticule control and Util.getFormattedLonLat function. Thanks madair for this excellent patch. p=madair, r=me (closes #1083)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9757 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-24 05:36:34 +00:00
ahocevar
a864838e96 call layer.getImageSize with the tile bounds to support layer implementations
with different tile sizes at the extent edges. p=klokan, r=me (closes #2324)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9756 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-24 05:11:51 +00:00
ahocevar
839348a3b2 added labelXOffset and labelYOffset symbolizer properties. Thanks madair for the original patch, and thanks jlacroix for turning it into symbolizer properties so nicely. p=jlacroix, r=me (fixes #2312)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9755 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-24 04:41:36 +00:00
ahocevar
fd514e8435 fixed memory leak in Marker.js. With manual test. p=rcoup, r=me (closes #2258)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9754 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-24 04:21:02 +00:00
ahocevar
6c213ba86b removed empty file
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9753 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-24 03:30:30 +00:00
Éric Lemoine
6e508f5cd6 Save strategy should preserve feature.url when transforming, p=pwr,me, r=me (closes #2215)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9752 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-24 01:55:55 +00:00
bartvde
caff5d5261 give PanZoomBar control an option to force fixed zoomlevels even if the map has fractionalZoom, patch by marcjansen, r=me, (closes #2288)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9751 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-23 23:31:15 +00:00
Schuyler Erle
4031b304a6 Merge r9745 through r9748. i18n updates from translatewiki.net. Closes #2310.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9750 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-20 23:43:26 +00:00
pgiraud
5b3f6f68d3 added some css to actually show how to customize the panPanel and zoomPanel example look and feel
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9737 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-09 14:02:47 +00:00
bartvde
13c5f5ac4c clean up unused code in Format.WMC.v1, correct minor spelling mistake, non functional change, see ticket:2251 for details
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9736 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-09 09:55:04 +00:00
Éric Lemoine
9711381289 remove an inrelevant comment, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9735 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-08 20:59:04 +00:00
ahocevar
e264e8c6c4 added Layer.WMS.Post for WMS request params exceeding the maximum url length for GET requests. Thanks ingo for this excellent work! It is an honor to commit such a high quality patch. p=ingo, r=elemoine,me (closes #2224)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9734 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-08 18:13:55 +00:00
Tim Schaub
6dabe0646e Adding some serious enhancements to the WMC format. With this, OL map and layer objects can be created from WMC context objects and vice versa. Thanks for the great patch bbinet. r=me (closes #2251)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9733 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-08 17:24:54 +00:00
Tim Schaub
039618366f Reading and writing the 'escapeChar' attribute for Filter Encoding 1.1.0. r=ahocevar (closes #2301)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9732 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-08 17:02:54 +00:00
Tim Schaub
bff91d251c The attribution control no longer shows duplicate attribution text. r=crschmidt (closes #2300)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9731 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-08 17:00:40 +00:00
ahocevar
ab2b2356f1 "Create an urlAppend function that appends strings to urls and handles ? and & appropriately". r=crschmidt (closes #2297)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9730 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-08 16:48:50 +00:00
crschmidt
3e0b053009 Fix for Missing @requires directive in Layer/XYZ.js results in broken custom
singlefile-builds, (closes #2299), thx marcjansen. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9729 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-08 14:29:18 +00:00
crschmidt
0cced02fec add requirement for format/text (Closes #2298), thx marcjansen.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9728 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-08 14:04:53 +00:00
ahocevar
e13078b64a removed duplicate definition of unselectAll. Thanks fredj for finding this one. r=tschaub (closes #2229)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9727 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-08 12:58:15 +00:00
ahocevar
fa324ec7f3 fixed regression with style missing in graphicRotate method. r=tschaub (closes #2198)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9726 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-08 12:49:27 +00:00
bartvde
5a9e1fe0b4 allow WFS protocol to use a different outputFormat, for instance json, patch by rdewit, r=me (closes #2107)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9725 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-07 18:21:59 +00:00
ahocevar
7919d2a314 removed duplicate inclusion of OpenLayers/Format/SLD/v1.js
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9723 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-07 13:54:50 +00:00
Éric Lemoine
b2056fd141 fix documentation, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9721 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-06 19:41:20 +00:00
Tim Schaub
d1cecf3be1 Adding an option to avoid duplicate attribution.
Thanks Marc Jansen for this nice contribution.  Without wanting
to gush, I think this should be a model contribution because:

 1. it is a simple change
 2. with a nice example that clearly demonstrates the benefit
 3. it includes tests!
 4. and Marc wrote a note to the dev list with links to the ticket

r = me (closes #2266)



git-svn-id: http://svn.openlayers.org/trunk/openlayers@9720 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-06 18:46:06 +00:00
bartvde
11b38e5419 Format.WFST.v1: Query writer can be removed, r=tschaub (closes #2249)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9719 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-06 17:15:19 +00:00
bartvde
10398c5865 GetFeatureInfo control does not send required FORMAT parameter, r=tschaub (closes #2201)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9718 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-06 17:10:32 +00:00
ahocevar
2c2bf63c3f removed trailing commas to fix example for IE.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9708 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-06 08:12:04 +00:00
Tim Schaub
f7143f7e02 Deal with dash arrays that come in with extra spaces at the end. r=ahocevar (closes #2271)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9707 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-05 22:36:51 +00:00
Tim Schaub
7e821da0b5 Write out stroke dash style and linecap in SLD. r=ahocevar (closes #2270)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9706 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-05 22:34:16 +00:00
Tim Schaub
a84e06a075 WMSCapabilities format should call initialize on the XML format. r=crschmidt (closes #2269)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9705 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-05 22:32:25 +00:00
Tim Schaub
8c094a8977 Use a unique id for the map viewport. r=crshmidt (closes #2259)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9704 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-05 22:29:01 +00:00
bartvde
79aad5a1b4 When writing a WMC, bounds should not be rounded to a predefined precision, original patch by bbinet, r=me (closes #2242)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9703 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-05 14:30:00 +00:00
Éric Lemoine
86bd389152 allow protocols to be configured with a default filter, p=aabt, r=me (closes #2292)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9702 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-05 12:14:37 +00:00
Éric Lemoine
2633f9ba88 GeoJSON input should accept 3D coords, p=sgillies, r=me (closes #2070)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9700 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-05 09:21:07 +00:00
Éric Lemoine
5fad952e8a add formats for CSW GetRecords and GetDomain requests, p=bbinet, r=me (closes #2132)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9699 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-05 08:15:48 +00:00
ahocevar
3fa2971816 some love for the ve example: removed non-existent WMS layer, show animationEnabled option, fixed marker addition/removal.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9698 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-01 20:08:11 +00:00
ahocevar
d7a37c67b7 make selectors for Save button more specific so they also work in a Panel with displayClass set to olControlEditingToolbar. Non-functional change (fixes #2287)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9697 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-01 19:54:18 +00:00
ahocevar
449ea29086 added option to turn of animation. r=crschmidt,tschaub (closes #2286)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9696 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-01 19:47:31 +00:00
Frédéric Junod
8c3562e3ad onMapResize takes no parameters, no functionnal changes
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9695 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-01 09:39:23 +00:00
Frédéric Junod
e0167bdeec Update the VirtualEarth layer size when the map is resized. r=ahocevar, p=Matthew D. Diez (closes #2285)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9694 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-10-01 09:37:27 +00:00
crschmidt
7a9e54afdc change docs slightly. report by jeff adams. (Closes #2276)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9686 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-21 18:22:40 +00:00
Tim Schaub
6c4556666e WMSCapabilities inherits from and requires XML (no functional change).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9681 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-18 18:29:20 +00:00
Tim Schaub
8c3b6cc4b5 As with Google and VE, we should pull in SphericalMercator here. No functional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9679 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-18 16:47:52 +00:00
Paul Spencer
6088de516c (Closes #2146) enhance createLiterals to merge context, attributes and pass attribute name through to context functions
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9676 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-17 17:17:11 +00:00
ahocevar
507fd0b86d change getDateExtent() so it does not break when the layer has features without geometry. p=fvanderbiest, r=me (closes #2267)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9674 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-17 13:08:52 +00:00
Paul Spencer
3fcda4df56 (Closes #2148) enable vector features to be selectable from their text node. r=ahocevar
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9671 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-17 12:05:38 +00:00
Tim Schaub
21b680868f Spelling correction in Google example.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9670 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-16 02:13:15 +00:00
Tim Schaub
4102871392 As we do for the other proprietary providers, let's pull in SphericalMercator with VE. No functional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9668 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-16 00:15:39 +00:00
ahocevar
93eccfc003 Fix for rendering custom symbols with aspect ratio differnt than 1.
r=pgiraud (closes #1836)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9665 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-14 10:25:54 +00:00
Tim Schaub
7f240d3ba9 Adding more complete WMS capabilities parsing. Thanks trondmm for the comprehensive patch. Some minor changes by me - including leaving the srs member value an object. r=me (closes #2164)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9664 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-11 22:48:56 +00:00
Tim Schaub
912a12c0b8 Typos that IE doesn't like (no functional change).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9660 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-11 20:23:48 +00:00
Tim Schaub
361f6065a7 Adding a runner for WMS capabilities parsing benchmarks.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9659 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-11 20:02:21 +00:00
Tim Schaub
f8c2889947 Adding more extensive parsing of WFS capabilities documents. Thanks fvanderbiest for the great patch. r=me (closes #2245)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9658 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-11 19:17:10 +00:00
Frédéric Junod
bdabaa86f9 fix comment, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9656 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-11 08:12:24 +00:00
Éric Lemoine
e6a2c4c7de tests on GetFeature control fail, thanks fvanderbiest for the initial
patch, non-functional change (closes #2261)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9650 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-10 06:50:45 +00:00
Tim Schaub
9945381043 Making invisible the factbook-overlay as it is not working.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9646 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-08 17:09:04 +00:00
crschmidt
9970eaff16 add events to strategy.save: start, success, fail. r=elemoine, (Closes #1902)
(It is possible Save may need extension for additional events; this should be
a new ticket.)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9645 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-08 13:06:15 +00:00
ahocevar
19057eedd8 Replaced the no longer existent Boston Freemap with the tiger-ny demo that ships with GeoServer. Thanks to Billy Thoen for making us aware of this issue.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9641 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-03 14:28:27 +00:00
Éric Lemoine
ef1952e953 make WFS protocol and format more robust, r=ahocevar (closes #2237)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9636 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-09-02 06:17:19 +00:00
Tim Schaub
f3f6974eb6 Adding back the WMS overlay. No functional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9631 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-08-25 20:05:18 +00:00
Tim Schaub
8e73b3f8db Avoid pink tiles on example.html.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9630 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-08-24 20:22:28 +00:00
Frédéric Junod
b9bcc0b7f8 use OpenLayers.Protocol.Response.success function, r=elemoine (closes #2227)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9623 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-08-19 06:34:54 +00:00
Éric Lemoine
f587b05d35 in OpenLayers.Request call the "complete", "success" and "failure" callbacks from within a separate method, this allows executing the callbacks from outside and at the time it lmakes the most sense to the application, p=fvanderbiest, r=me (closes #2218)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9621 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-08-13 19:47:08 +00:00
Éric Lemoine
d83376de64 add changelayer event to mergeNewParams function, r=bartvde (closes #2179)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9618 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-08-13 06:31:47 +00:00
Frédéric Junod
2b9bd25530 trigger an event when the layer's opacity change. r=elemoine (closes #2112)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9616 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-08-10 06:10:29 +00:00
Tim Schaub
c1a0d405e4 Proper handling of null and undefined attribute values in WFS transactions. r=ahocevar (closes #2222)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9615 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-08-07 22:35:55 +00:00
bartvde
5964a8db60 fix up sequence of elements in Web Map Context 1.1 Format when writing, thanks trondmm for the catch and initial patch, r=tschaub (closes #2174)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9614 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-08-07 15:59:43 +00:00
ahocevar
01d4330c81 In standalone mode, allow only dragging of sketch vertices or the point
selected for modification. Thanks tschaub for the improved patch. 
r=tschaub (closes #2219)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9613 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-08-05 23:33:26 +00:00
Éric Lemoine
868f886cad make the point1 and point2 variables local to the getSortedSegments method, no functional change, p=igrcic (closes #2217)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9612 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-08-05 07:28:08 +00:00
Schuyler Erle
0f35a3a434 Applying bobkare's patches to Norwegian language support from #2212. Closes #2212.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9605 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-31 18:38:15 +00:00
Schuyler Erle
ed6790e652 Merged from roberthl's branch again. This time all tests pass. ;)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9604 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-31 16:34:04 +00:00
ahocevar
77ea74cc2c added getBounds() to mockup geometry. Non-functional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9601 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-30 22:27:23 +00:00
crschmidt
e5a577b062 larger, not smaller
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9597 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-30 14:43:31 +00:00
crschmidt
f0c5e94403 Add better documentation for the 'ratio' property of WFS layers.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9596 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-30 14:36:44 +00:00
Éric Lemoine
6012498ae8 in the select-feature.html example, when checkboxes are changes, reactivate the select control only if the "box" property changes, we do not need to reactivate the control when the "clickout" property changes, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9595 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-29 06:31:35 +00:00
Tim Schaub
6f18a6abd0 Stopping double clicks on the panel control. Thanks for the patch sbenthall. r=me (closes #2069)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9594 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-29 04:20:57 +00:00
ahocevar
1f3d495a12 fixed docs for clickTolerance, which also affects hover requests. Non-functional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9593 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-28 14:39:58 +00:00
ahocevar
8fdd423104 provide a standalone mode for the ModifyFeature control. Thanks tschaub
for the fix in deactivate() and the tests. r=tschaub (closes #2199)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9591 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-27 18:00:36 +00:00
Tim Schaub
7b90863198 Instead of storing the geometry on all nodes (increasing memory drain) we only store what the indexer needs. The bounds bottom is only used in the compare method when checking for z and y ordering. r=ahocevar (closes #2198)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9590 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-27 16:50:33 +00:00
Tim Schaub
8b741bc666 Adding an autoActivate property for controls. If this is set to true, the control will be activated when it is added to a map. This is true for the Navigation, NavigationHistory, KeyboardDefaults, and Panel controls. False for others. r=elemoine (closes #2200)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9589 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-24 21:58:39 +00:00
Tim Schaub
1afb016408 Unmixing tabs and spaces. Non-functional change. Four spaces for tabs.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9588 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-24 19:50:45 +00:00
Éric Lemoine
f7a2efe2bf make updateSize not call setCenter if map has no center, and remove unused code, r=tschaub (closes #2105) (closes #2114)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9587 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-24 12:49:13 +00:00
Éric Lemoine
1faae2a2a2 allow proxy host function, r=tschaub (closes #2128)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9586 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-24 12:44:33 +00:00
Tim Schaub
f838aa3a03 Ensure that sld elements are written in the sld namespace. r=bartvde (closes #2087)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9584 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-23 20:53:14 +00:00
crschmidt
2564da4403 Revert r9582, which breaks OpeNLayers trunk. Tickets 2158 and 2159 need to
be reopened.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9583 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-23 16:08:33 +00:00
Schuyler Erle
547371f107 Merge r9410 and r9520 from
source:/sandbox/roberthl/openlayers/lib/OpenLayers/Lang. These patches import
the latest work from the MediaWiki translation team, and only impact the
language files. This closes #2158 and #2159. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9582 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-23 15:29:19 +00:00
ahocevar
82cbb8c7cb fixed getParameterString to handle null/undefined values correctly. r=elemoine (closes #2157)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9573 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-20 21:11:03 +00:00
bartvde
2c8ec98643 correctly parse ScaleHint values from WMS GetCapabilities response, thanks elemoine for the testcase, r=elemoine (closes #2150)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9571 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-20 12:32:31 +00:00
bartvde
f4d60b89a8 add parsing of layer name in WMS DescribeLayer format, r=elemoine (closes #2027)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9570 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-20 12:18:02 +00:00
Éric Lemoine
feb29516b3 WMSGetFeatureInfo: add beforegetfeatureinfo event, p=fvanderbiest, r=me (closes #2127)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9569 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-20 09:07:37 +00:00
Éric Lemoine
4e77c9648a add missing semi-colons, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9568 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-20 08:53:00 +00:00
Éric Lemoine
7c4f85ffd5 Undocumented property 'filter' in Layer.Vector assumed in BBOX Strategy, initial patch from rdewit, no functional change (closes #2061)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9567 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-20 08:42:42 +00:00
Tim Schaub
cb71201350 Different layer order.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9551 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-14 16:18:47 +00:00
Tim Schaub
1b4d654ff8 Demonstrating the use of the rebranded Virtual Earth API.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9550 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-14 16:03:07 +00:00
Tim Schaub
ca23e49707 Add an example that demonstrates the use of a popup with the WMSGetFeatureInfo control.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9549 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-07-10 17:43:37 +00:00
Tim Schaub
d6d824b389 Typo in docs. Non-functional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9528 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-26 15:15:28 +00:00
Tim Schaub
1e35173c2b If the pan tween is playing when the map is destroyed, stop the tween. r=pspencer (closes #2156)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9526 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-26 01:01:00 +00:00
ahocevar
9d74c087ce added parsing of Attribution, KeywordList and MetadataURL to
WMSCapabilities. Thanks tschaub for the improvements to my original 
patch. r=tschaub (closes #2145)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9499 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-23 20:34:27 +00:00
ahocevar
253a8bbaf7 added extractStyles:true for KML input
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9480 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-16 14:17:00 +00:00
ahocevar
ef739e42c3 Support for IE8 standards mode. Thanks ahayes, crschmidt, pspencer and madair, who all provided patches and valuable research to make this happen. r=crschmidt,ngerber999,Quelbs,ksgeograf (pullup #1910)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9476 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-13 08:55:44 +00:00
crschmidt
3fd553cdf4 Fix two missing semicolons. Thanks to ksgeograf for the catch. No functional
change. (Pullup #2134)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9475 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-12 20:06:12 +00:00
crschmidt
8765b0199f Commit bug for missing 'exact' in ArcXML format parser, from dzwarg. Includes
manual test. Thanks! (Pullup #2117) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9474 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-12 20:03:12 +00:00
ahocevar
be1d375bf7 How and where do I create tickets for IE7 bugs? No idea, so we are fixing it here. r=crschmidt (pullup #2135)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9473 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-12 15:45:49 +00:00
ahocevar
a20a209f0e changed wfs url to a working one
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9468 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-12 09:02:41 +00:00
ahocevar
cad1839201 Updated server url. Thanks akrherz for making us aware of the new url (closes #2129)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9467 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-12 06:54:25 +00:00
ahocevar
81ea635430 satisfy Opera 9.27 by escaping curly braces in regular expression. r=crschmidt (pullup #2103)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9466 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-11 17:24:48 +00:00
ahocevar
d6a3c508a1 Fixed the scope of onSelect, onUnselect,... when scope is not specified.
r=crschmidt (pullup #2115)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9419 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-06-01 16:27:02 +00:00
ahocevar
553f05d293 Another fix for the problem with resized Google layers that were previously invisible. Has the GMaps API changed in the meantime? At least this fix (listening for the "load" event) feels like it makes more sense than the previous one (listening for the "tilesloaded" event). r=pgiraud (closes #1797)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9418 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-29 07:59:10 +00:00
Tim Schaub
94437d3e5f Making createUrlObject more reliable. Tests demonstrate what to expect. r=elemoine (pullup #2060)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9413 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-27 17:49:05 +00:00
crschmidt
ebaa5066fc Fix a broken aspect of my change to the ArcXML code when cleaning it up:
missed an 'arcxml' -> 'response' change. Caught by dzwarg, r=me, (Pullup #2110) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9412 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-26 16:59:40 +00:00
ahocevar
2bf02bda35 Better fix for SVG rendering issues when redrawing complex graphics. Thanks tschaub for the investigation and the original patch which pointed me into the right direction. r=tschaub (pullup #2101)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9405 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-21 22:02:05 +00:00
Tim Schaub
52a4d4f8cc Making it so createUrlObject casts all urls to absolute ones first. r=crschmidt (pullup #2060)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9404 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-21 18:27:26 +00:00
Tim Schaub
d178a7675b Using util method for array indexOf in TMS layer. r=crschmidt (pullup #2100)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9403 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-21 14:52:38 +00:00
Tim Schaub
16715f41f6 Using the cross-browser util method for array indexOf in the TileCache layer. r=crschmidt (closes #2099)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9402 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-21 14:50:43 +00:00
Tim Schaub
e946b0a7eb Store a reference to the bound mouse cache clearer so we can unregister it as a listener later. This solves an issue with slider events on the PanZoomBar. r=crschmidt (pullup #2054)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9401 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-21 00:20:36 +00:00
Tim Schaub
6b6ca2a125 Take care not to clobber any previously set window.$ value. IE, in its mysterious ways, sets $ to undefined if we have a conditional 'var $ = somefunc;' expression - even if the condition evaluates to false. Problem does not occur if expression is 'window.$ = somefunc;'. This makes OL play nicely with jQuery (among others) in IE. r=crschmidt (pullup #1391)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9400 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-21 00:17:20 +00:00
Tim Schaub
5f0d573ff5 Trivial change. Removing string concatenation. Reportedly changes things in minified build in IE6. (pullup #2093)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9386 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-18 19:49:10 +00:00
crschmidt
51b5095d48 Committing an updated fix for #1906. This fixes a 2.7->2.8 regression in
particular behavior with regard to determining the size of a popup. thanks
to the absolutely tireless work of gregers on this issue! Also, in case 
anyone was wondering? Browsers suck. (Pullup #1906)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9384 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-15 15:36:21 +00:00
Éric Lemoine
b768574d72 when allOverlays is true a hidden layer can cause a WFS request, testsed by bartvde, r=tschaub (closes #2072)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9370 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-12 06:18:00 +00:00
ahocevar
0ec407ca04 use event-based checkResize not only for invisible layers, but also for layers that have not finished loading. r=pgiraud (pullup #2075)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9362 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-05-07 07:49:38 +00:00
Tim Schaub
5a8b116d10 To abort loading of any previous image when we destroy the image tile, we set the src to the location of blank.gif. r=crschmidt (pullup #1978)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9334 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-04-30 22:07:26 +00:00
ahocevar
b98dba227e Fix GMap initialization sequence when resizing previously invisible
layers. r=tschaub (pullup #1797)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9333 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-04-30 21:52:08 +00:00
crschmidt
6785e06150 Fix broken comma (Pullup #2066)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9328 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-04-29 11:41:00 +00:00
ahocevar
51b1937aa6 fix for urls with same host in createUrlObject in IE. r=tschaub (pullup
#2060)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9320 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2009-04-27 20:57:14 +00:00
327 changed files with 33481 additions and 8131 deletions

View File

@@ -74,6 +74,7 @@ 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)
@@ -96,6 +97,7 @@ 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)
@@ -124,6 +126,13 @@ 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 {
@@ -133,6 +142,9 @@ 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)
@@ -141,6 +153,12 @@ 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)
@@ -148,25 +166,21 @@ Group: OpenLayers {
File: v1_0_0 (no auto-title, OpenLayers/Format/SLD/v1_0_0.js)
} # Group: SLD
Group: WMC {
File: WMC (no auto-title, OpenLayers/Format/WMC.js)
File: v1 (no auto-title, OpenLayers/Format/WMC/v1.js)
File: v1_0_0 (no auto-title, OpenLayers/Format/WMC/v1_0_0.js)
File: v1_1_0 (no auto-title, OpenLayers/Format/WMC/v1_1_0.js)
} # Group: WMC
Group: Format {
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: 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)
File: WFSDescribeFeatureType (OpenLayers/Format/WFSDescribeFeatureType.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 {
@@ -177,12 +191,34 @@ Group: OpenLayers {
} # 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
Group: WMC {
File: WMC (no auto-title, OpenLayers/Format/WMC.js)
File: v1 (no auto-title, OpenLayers/Format/WMC/v1.js)
File: v1_0_0 (no auto-title, OpenLayers/Format/WMC/v1_0_0.js)
File: v1_1_0 (no auto-title, OpenLayers/Format/WMC/v1_1_0.js)
} # Group: WMC
Group: WMSCapabilities {
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
Group: WMSDescribeLayer {
File: WMSDescribeLayer (no auto-title, OpenLayers/Format/WMSDescribeLayer.js)
File: v1_1 (no auto-title, OpenLayers/Format/WMSDescribeLayer/v1_1.js)
} # Group: WMSDescribeLayer
File: WMSGetFeatureInfo (no auto-title, OpenLayers/Format/WMSGetFeatureInfo.js)
File: XML (no auto-title, OpenLayers/Format/XML.js)
} # Group: Format
Group: Geometry {
@@ -221,6 +257,10 @@ 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)
@@ -228,12 +268,35 @@ 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
@@ -242,6 +305,7 @@ 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)
@@ -264,13 +328,15 @@ 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: RootContainer (OpenLayers/Layer/Vector/RootContainer.js)
File: Vector.RootContainer (no auto-title, 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)
@@ -306,9 +372,9 @@ Group: OpenLayers {
Group: WFS {
File: WFS (no auto-title, OpenLayers/Protocol/WFS.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)
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)
} # Group: WFS
} # Group: Protocol
@@ -337,6 +403,7 @@ 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
@@ -348,6 +415,7 @@ 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,6 +74,7 @@ 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)
@@ -96,6 +97,7 @@ 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)
@@ -124,6 +126,13 @@ 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 {
@@ -133,6 +142,9 @@ 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)
@@ -141,6 +153,12 @@ 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)
@@ -148,25 +166,21 @@ Group: OpenLayers {
File: v1_0_0 (no auto-title, OpenLayers/Format/SLD/v1_0_0.js)
} # Group: SLD
Group: WMC {
File: WMC (no auto-title, OpenLayers/Format/WMC.js)
File: v1 (no auto-title, OpenLayers/Format/WMC/v1.js)
File: v1_0_0 (no auto-title, OpenLayers/Format/WMC/v1_0_0.js)
File: v1_1_0 (no auto-title, OpenLayers/Format/WMC/v1_1_0.js)
} # Group: WMC
Group: Format {
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: 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)
File: WFSDescribeFeatureType.js (OpenLayers/Format/WFSDescribeFeatureType.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 {
@@ -177,12 +191,34 @@ Group: OpenLayers {
} # 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
Group: WMC {
File: WMC (no auto-title, OpenLayers/Format/WMC.js)
File: v1 (no auto-title, OpenLayers/Format/WMC/v1.js)
File: v1_0_0 (no auto-title, OpenLayers/Format/WMC/v1_0_0.js)
File: v1_1_0 (no auto-title, OpenLayers/Format/WMC/v1_1_0.js)
} # Group: WMC
Group: WMSCapabilities {
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
Group: WMSDescribeLayer {
File: WMSDescribeLayer (no auto-title, OpenLayers/Format/WMSDescribeLayer.js)
File: v1_1 (no auto-title, OpenLayers/Format/WMSDescribeLayer/v1_1.js)
} # Group: WMSDescribeLayer
File: WMSGetFeatureInfo (no auto-title, OpenLayers/Format/WMSGetFeatureInfo.js)
File: XML (no auto-title, OpenLayers/Format/XML.js)
} # Group: Format
Group: Geometry {
@@ -221,6 +257,10 @@ 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)
@@ -228,12 +268,35 @@ 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
@@ -242,6 +305,7 @@ 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)
@@ -264,13 +328,15 @@ 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: RootContainer (OpenLayers/Layer/Vector/RootContainer.js)
File: Vector.RootContainer (no auto-title, 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)
@@ -306,9 +372,9 @@ Group: OpenLayers {
Group: WFS {
File: WFS (no auto-title, OpenLayers/Protocol/WFS.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)
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)
} # Group: WFS
} # Group: Protocol
@@ -337,6 +403,7 @@ 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
@@ -348,6 +415,7 @@ 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)

175
examples/WMSPost.html Normal file
View File

@@ -0,0 +1,175 @@
<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.avencia.com/servlet/com.esri.esrimap.Esrimap",
"http://sample.azavea.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.avencia.com/servlet/com.esri.esrimap.Esrimap", options );
"http://sample.azavea.com/servlet/com.esri.esrimap.Esrimap", options );
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);

49
examples/bing.html Normal file
View File

@@ -0,0 +1,49 @@
<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>

28
examples/canvas.html Normal file
View File

@@ -0,0 +1,28 @@
<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>

62
examples/canvas.js Normal file
View File

@@ -0,0 +1,62 @@
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

@@ -0,0 +1,37 @@
<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,11 +11,15 @@
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

@@ -0,0 +1,90 @@
<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,16 +26,15 @@
);
var dm_wms = new OpenLayers.Layer.WMS(
"DM Solutions Demo",
"Canadian Data",
"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"},
{
minResolution: 0.17578125,
maxResolution: 0.703125
}
transparent: "true",
format: "image/png"
},
{isBaseLayer: false, visibility: false}
);
map.addLayers([ol_wms, jpl_wms, dm_wms]);

View File

@@ -60,18 +60,21 @@
</div>
<p id="shortdesc">
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.
Shows how to use the GetFeature control to select features from a WMS layer.
</p>
<div id="map" class="smallmap"></div>
<div id="docs"></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>
</body>
</html>

View File

@@ -0,0 +1,90 @@
<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: 20}
{type: G_SATELLITE_MAP, numZoomLevels: 22}
);
@@ -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 ocation,
In order to position the Google attribution div in the default location,
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, 10,0, 10,4, 0,4, 0,0];
OpenLayers.Renderer.symbol.rectangle = [0,0, 4,0, 4,10, 0,10, 0,0];
var map;
@@ -48,7 +48,8 @@
},
"select": {
pointRadius: 20,
fillOpacity: 1
fillOpacity: 1,
rotation: 45
}
});

102
examples/graticule.html Normal file
View File

@@ -0,0 +1,102 @@
<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"></div>
<div id="layerswitcher" class="olControlLayerSwitcher"></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,6 +84,7 @@
var options = {
isBaseLayer: true,
transitionEffect: "resize",
buffer: 1,
useOverlay: false,
useAsyncOverlay: false,
@@ -125,7 +126,7 @@
layer = new OpenLayers.Layer.MapGuide( "MapGuide OS Overlay layer", url, params, options );
map.addLayer(layer);
*/
map.addControl(new OpenLayers.Control.LayerSwitcher({'div':OpenLayers.Util.getElement('layerswitcher')}));
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}
</script>
@@ -144,7 +145,6 @@
<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()">
<div id="title">MapServer Layer</div>
<h1 id="title">MapServer Layer</h1>
<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>
<div id="title">MapServer Single Tile Mode</div>
<h1 id="title">MapServer Single Tile Mode</h1>
<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()">
<div id="title">Resize a Marker</div>
<h1 id="title">Resize a Marker</h1>
<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()">
<div id="title">Markers Layer Example</div>
<h1 id="title">Markers Layer Example</h1>
<div id="tags"></div>
<div id="shortdesc">Show markers layer with different markers</div>
<div id="map" class="smallmap"></div>

View File

@@ -16,11 +16,15 @@
#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()">
<h3 id="title">MousePosition Control</h3>
<h1 id="title">MousePosition Control</h1>
<p id="shortdesc">
Use the MousePosition Control to display the coordinates of the cursor
inside or outside the map div.

View File

@@ -0,0 +1,57 @@
<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()">
<h3 id="title">MultiMap Mercator Example</h3>
<h1 id="title">MultiMap Mercator Example</h1>
<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()">
<h3 id="title">NavToolbar Demo</h3>
<h1 id="title">NavToolbar Demo</h1>
<p id="shortdesc">
Demo the NavToolbar, a subclass of Control.Panel which shows icons for
navigation.

View File

@@ -1,155 +0,0 @@
<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>

30
examples/osm.html Normal file
View File

@@ -0,0 +1,30 @@
<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()">
<h3 id="title">Using maxResolution to control overlays</h3>
<h1 id="title">Using maxResolution to control overlays</h1>
<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.
In addition, any other properties of the overview map control can be
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
set in this way.</p>
<script defer="defer" type="text/javascript">
// create the top map (with default overview map control)
var map1 = new OpenLayers.Map('map1');
// set up some layers
var ol = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
@@ -52,6 +52,25 @@
{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());
@@ -67,35 +86,30 @@
// create the bottom map (with advanced overview map control)
var mapOptions = {
maxExtent: new OpenLayers.Bounds(33861, 717605, 330846, 1019656),
maxResolution: 296985/1024,
projection: "EPSG:2805",
maxExtent: new OpenLayers.Bounds(-8242894.927728, 4965204.031195,
-8227290.161511, 4994963.723637),
maxResolution: 116.24879860156216,
projection: "EPSG:900913",
units: "m"
};
var map2 = new OpenLayers.Map('map2', mapOptions);
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());
map2.addLayers([ny]);
// create an overview map control with non-default options
var controlOptions = {
mapOptions: mapOptions
mapOptions: OpenLayers.Util.extend(mapOptions, {
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34)
}),
layers: [jplOverview]
}
var overview2 = new OpenLayers.Control.OverviewMap(controlOptions);
map2.addControl(overview2);
map2.setCenter(new OpenLayers.LonLat(182500, 868500), 3);
map2.setCenter(new OpenLayers.LonLat(-8233165.3575055, 4980298.21113769), 3);
// expand the overview map control
overview2.maximizeControl();

View File

@@ -40,6 +40,41 @@
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()">
<h3 id="title">Custom Control.Panel</h3>
<h1 id="title">Custom Control.Panel</h1>
<p id="shortdesc">
Create a custom control.panel, styled entirely with
CSS, and add your own controls to it.

View File

@@ -19,7 +19,8 @@ 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.avencia.com']
'www.openstreetmap.org', 'sample.azavea.com',
'v-swe.uni-muenster.de:8080']
method = os.environ["REQUEST_METHOD"]

View File

@@ -28,11 +28,15 @@
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');
@@ -68,7 +72,7 @@
</script>
</head>
<body onload="init()">
<h2 id="title">OpenLayers Regular Polygon Example</h2>
<h1 id="title">OpenLayers Regular Polygon Example</h1>
<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()">
<h3 id="title">Resize Features Programatically</h3>
<h1 id="title">Resize Features Programatically</h1>
<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()">
<h3 id="title">OpenLayers Restricted Extent Example</h3>
<h1 id="title">OpenLayers Restricted Extent Example</h1>
<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,6 +21,15 @@
);
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());
@@ -74,13 +83,19 @@
function update() {
var clickout = document.getElementById("clickout").checked;
if(clickout != drawControls.select.clickout) {
drawControls.select.clickout = clickout;
drawControls.select.box = document.getElementById("box").checked;
}
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();
}
}
}
</script>
</head>
<body onload="init()">
@@ -119,7 +134,7 @@
<li>
<input type="radio" name="type" value="select" id="selectToggle"
onclick="toggleControl(this);" />
<label for="selectToggle">select feature</label>
<label for="selectToggle">select feature (<span id="counter">0</span> features selected)</label>
<ul>
<li>
<input id="box" type="checkbox" checked="checked"

179
examples/sos.html Normal file
View File

@@ -0,0 +1,179 @@
<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,6 +8,11 @@
#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>
@@ -20,9 +25,8 @@
// make map available for easy debugging
var map;
// avoid pink tiles
// increase reload attempts
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
OpenLayers.Util.onImageLoadErrorColor = "transparent";
function init(){
var options = {
@@ -102,7 +106,7 @@
"http://world.freemap.in/tiles/",
{'layers': 'factbook-overlay', 'format':'png'},
{
'opacity': 0.4,
'opacity': 0.4, visibility: false,
'isBaseLayer': false,'wrapDateLine': true
}
);

View File

@@ -4,10 +4,15 @@
<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');

43
examples/style-rules.html Normal file
View File

@@ -0,0 +1,43 @@
<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>

99
examples/style-rules.js Normal file
View File

@@ -0,0 +1,99 @@
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

@@ -80,3 +80,7 @@ h6 {
#tags {
display: none;
}
#docs p {
margin-bottom: 0.5em;
}

View File

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

View File

@@ -1,13 +1,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Styles Rotation Example</title>
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<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">
@@ -76,10 +71,16 @@
</head>
<body onload="init()">
<h1 id="title">Rotation Style Example</h1>
<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"/>
<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>
</body>
</html>

View File

@@ -25,7 +25,8 @@
new OpenLayers.Rule({
symbolizer: {
graphic: false,
label: "Label for invisible point"
label: "Label for invisible point",
labelSelect: true
},
filter: new OpenLayers.Filter.Comparison({
type: "==",
@@ -50,7 +51,9 @@
stroke: true,
fill: false,
label: "Point without fill",
labelAlign: "rb"
labelAlign: "rb",
fontColor: "#ff0000",
fontOpacity: 0.4
},
filter: new OpenLayers.Filter.Comparison({
type: "==",
@@ -105,6 +108,13 @@
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>
@@ -117,6 +127,8 @@
<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

@@ -0,0 +1,105 @@
<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,28 +8,24 @@
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
var lat = 40;
var lon = 12;
var lat = 41;
var zoom = 15;
var map, velayer, layer;
var map, velayer, layer, marker;
function init(){
map = new OpenLayers.Map( 'map' ,
{controls:[new OpenLayers.Control.MouseDefaults()]});
velayer = new OpenLayers.Layer.VirtualEarth( "VE",
{ minZoomLevel: 4, maxZoomLevel: 6, 'type': VEMapStyle.Aerial});
velayer = new OpenLayers.Layer.VirtualEarth( "VE", {
// turn off animated zooming
animationEnabled: false,
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);
@@ -39,13 +35,17 @@
}
function add() {
marker = new OpenLayers.Marker(new OpenLayers.LonLat(2, 41));
if(!marker) {
marker = new OpenLayers.Marker(new OpenLayers.LonLat(15, 47));
markers.addMarker(marker);
}
}
function remove() {
if(marker) {
markers.removeMarker(marker);
marker = null;
}
}
</script>
</head>
@@ -59,7 +59,7 @@
</p>
<div id="map" class="smallmap"></div>
<input type="button" onClick="javascript:add()"value="Add the marker from the map">
<input type="button" onClick="javascript:add()"value="Add the marker to 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,7 +33,9 @@
fontSize: "12px",
fontFamily: "Courier New, monospace",
fontWeight: "bold",
labelAlign: "${align}"
labelAlign: "${align}",
labelXOffset: "${xOffset}",
labelYOffset: "${yOffset}"
}}),
renderers: renderer
});
@@ -83,6 +85,22 @@
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",
@@ -94,7 +112,7 @@
map.addLayer(vectorLayer);
vectorLayer.drawFeature(multiFeature);
map.setCenter(new OpenLayers.LonLat(point.x, point.y), 3);
vectorLayer.addFeatures([pointFeature, polygonFeature, multiFeature, nullFeature ]);
vectorLayer.addFeatures([pointFeature, polygonFeature, multiFeature, labelOffsetFeature, 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 = -(style_mark.graphicWidth/2); // this is the default value
style_mark.graphicXOffset = 10; // default is -(style_mark.graphicWidth/2);
style_mark.graphicYOffset = -style_mark.graphicHeight;
style_mark.externalGraphic = "../img/marker.png";
// graphicTitle only works in Firefox and Internet Explorer
@@ -116,9 +116,7 @@
<p id="shortdesc">
Shows the use of the shows drawing simple vector features, in different styles.
</p>
<div style="text-align: right">
<div dir="rtl" id="map" class="smallmap"></div>
</div>
<div id="map" class="smallmap"></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,6 +69,8 @@
OpenLayers.Util.extend({}, gmlOptions),
out_options
);
var kmlOptionsIn = OpenLayers.Util.extend(
{extractStyles: true}, in_options);
formats = {
'in': {
wkt: new OpenLayers.Format.WKT(in_options),
@@ -76,7 +78,8 @@
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(in_options)
kml: new OpenLayers.Format.KML(kmlOptionsIn),
atom: new OpenLayers.Format.Atom(in_options)
},
'out': {
wkt: new OpenLayers.Format.WKT(out_options),
@@ -84,7 +87,8 @@
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)
kml: new OpenLayers.Format.KML(out_options),
atom: new OpenLayers.Format.Atom(out_options)
}
};
}
@@ -142,7 +146,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;
}
@@ -181,6 +185,7 @@
<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,140 +58,32 @@
background-position: 0px 1px;
}
</style>
<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>
<script src="wfs-protocol-transactions.js"></script>
</head>
<body onload="init()">
<h1 id="title">WFS Transaction Example</h1>
<div id="tags">
</div>
<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
<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>
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>
</body>
</html>

View File

@@ -0,0 +1,107 @@
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://publicus.opengeo.org/geoserver/wfs",
url: "http://demo.opengeo.org/geoserver/wfs",
featureType: "tasmania_roads",
featureNS: "http://www.openplans.org/topp"
}),
})
});
map.addLayers([wms, layer]);

View File

@@ -1,114 +1,37 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WFS Reprojection + Canvas Renderer Example</title>
<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 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>
<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 + Canvas Renderer Example</h1>
<h1 id="title">WFS Reprojection Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the WFS layer reprojection support
Shows the use of the client side reprojection support.
</p>
<div id="map" class="smallmap"></div>
<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>
<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>
</html>

View File

@@ -0,0 +1,65 @@
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,45 +1,27 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<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 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>
<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"></div>
<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>
</div>

24
examples/wfs-states.js Normal file
View File

@@ -0,0 +1,24 @@
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));
}

View File

@@ -1,103 +0,0 @@
<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>

View File

@@ -1,34 +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, 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,14 +7,18 @@
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">
// no pink please
// increase reload attempts
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 2;
OpenLayers.Util.onImageLoadErrorColor = "transparent";
var format = new OpenLayers.Format.WMC({'layerOptions': {buffer: 0}});
var doc, context, map;
@@ -101,7 +105,9 @@
} else {
map.destroy();
try {
map = format.read(text, {map: "map"});
var jsonFormat = new OpenLayers.Format.JSON();
var mapOptions = jsonFormat.read(OpenLayers.Util.getElement('mapOptions').value);
map = format.read(text, {map: mapOptions});
map.addControl(new OpenLayers.Control.LayerSwitcher());
} catch(err) {
document.getElementById("wmc").value = err;
@@ -129,9 +135,10 @@
Shows parsing of Web Map Context documents.
</p>
<div id="map" class="smallmap"></div>
<button onclick="writeWMC();">write</button>
<button onclick="readWMC();">read as new map</button>
<button onclick="readWMC(true);">read and merge</button>
<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 />
<textarea id="wmc">paste WMC doc here</textarea>
<div id="docs">
This is an example of parsing WMC documents. <br />

52
examples/wms-v13.html Normal file
View File

@@ -0,0 +1,52 @@
<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.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-t.cgi?",{layers:"nexrad-n0r-wmst",transparent:true,format:'image/png',time:"2005-08-29T13:00:00Z"});
jpl_wms.setVisibility(false);

70
examples/zoomify.html Normal file
View File

@@ -0,0 +1,70 @@
<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,6 +17,12 @@
*/
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
@@ -37,7 +43,10 @@
* {String} Path to this script
*/
_getScriptLocation: function () {
var scriptLocation = "";
if (scriptLocation != undefined) {
return scriptLocation;
}
scriptLocation = "";
var isOL = new RegExp("(^|(.*?\\/))(" + OpenLayers._scriptName + ")(\\?|$)");
var scripts = document.getElementsByTagName('script');
@@ -91,6 +100,7 @@
"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",
@@ -113,12 +123,14 @@
"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",
@@ -166,6 +178,8 @@
"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",
@@ -191,6 +205,12 @@
"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",
@@ -199,16 +219,13 @@
"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",
@@ -217,6 +234,7 @@
"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",
@@ -237,7 +255,10 @@
"OpenLayers/Format/SLD.js",
"OpenLayers/Format/SLD/v1.js",
"OpenLayers/Format/SLD/v1_0_0.js",
"OpenLayers/Format/SLD/v1.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/WFST.js",
"OpenLayers/Format/WFST/v1.js",
"OpenLayers/Format/WFST/v1_0_0.js",
@@ -250,10 +271,18 @@
"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: loadURL
* APIFunction: OpenLayers.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: parseXMLString
* Function: OpenLayers.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,6 +431,38 @@ 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,11 +128,18 @@ 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() {
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];
}
},
/**
@@ -141,22 +148,26 @@ 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) {
toBBOX:function(decimal, reverseAxisOrder) {
if (decimal== null) {
decimal = 6;
}
var mult = Math.pow(10, decimal);
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;
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;
}
},
/**
@@ -255,8 +266,6 @@ OpenLayers.Bounds = OpenLayers.Class({
origin = this.getCenterLonLat();
}
var bounds = [];
var origx,origy;
// get origin coordinates

View File

@@ -93,6 +93,7 @@ OpenLayers.Element = {
/**
* APIFunction: getDimensions
* *Deprecated*. Returns dimensions of the element passed in.
*
* Parameters:
* element - {DOMElement}
@@ -112,12 +113,13 @@ 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 = 'none';
els.display = originalDisplay;
els.position = originalPosition;
els.visibility = originalVisibility;
return {width: originalWidth, height: originalHeight};

View File

@@ -105,6 +105,13 @@ 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.
@@ -258,7 +265,7 @@ OpenLayers.Control = OpenLayers.Class({
if (!this.allowSelection) {
this.div.className += " olControlNoSelect";
this.div.setAttribute("unselectable", "on", 0);
this.div.onselectstart = function() { return(false); };
this.div.onselectstart = OpenLayers.Function.False;
}
if (this.title != "") {
this.div.title = this.title;

View File

@@ -81,9 +81,13 @@ 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 );
}
}
}
this.div.innerHTML = attributions.join(this.separator);
}
},

View File

@@ -64,6 +64,13 @@ 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>}
@@ -115,7 +122,9 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
up: this.upFeature,
out: this.cancel,
done: this.doneDragging
}, this.dragCallbacks)
}, this.dragCallbacks), {
documentDrag: this.documentDrag
}
),
feature: new OpenLayers.Handler.Feature(
this, this.layer, OpenLayers.Util.extend({

View File

@@ -36,6 +36,13 @@ OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, {
*/
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,
/**
* Method: draw
* Creates a Drag handler, using <panMap> and
@@ -46,7 +53,8 @@ OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, {
"move": this.panMap,
"done": this.panMapDone
}, {
interval: this.interval
interval: this.interval,
documentDrag: this.documentDrag
}
);
},

View File

@@ -38,6 +38,13 @@ 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
@@ -84,9 +91,12 @@ 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 (BBOX) to retrieve
* <OpenLayers.Protocol> that supports spatial filters to retrieve
* features from a server and fires events that notify applications of the
* selected features.
*
@@ -59,8 +59,10 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: click
* {Boolean} Use a click handler for selecting/unselecting features.
* Default is true.
* {Boolean} Use a click handler for selecting/unselecting features. If
* both <click> and <box> are set to true, the click handler takes
* precedence over the box handler if a box with zero extent was
* selected. Default is true.
*/
click: true,
@@ -80,10 +82,11 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: clickTolerance
* {Integer} Tolerance for the BBOX query in pixels. This has the
* {Integer} Tolerance for the filter 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> is true. Default is 5.
* <click> or <hover> is true. Default is 5. Note that this not
* only affects requests on click, but also on hover.
*/
clickTolerance: 5,
@@ -101,8 +104,9 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: maxFeatures
* {Integer} Maximum number of features to return from a query, if
* supported by the <protocol>. Default is 10.
* {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.
*/
maxFeatures: 10,
@@ -141,6 +145,15 @@ 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
*
@@ -151,6 +164,14 @@ 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
@@ -161,8 +182,9 @@ 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", "featureunselected", "clickout",
"beforefeatureselected", "hoverfeature", "outfeature"],
EVENT_TYPES: ["featureselected", "featuresselected", "featureunselected",
"clickout", "beforefeatureselected", "beforefeaturesselected",
"hoverfeature", "outfeature"],
/**
* Constructor: OpenLayers.Control.GetFeature
@@ -189,8 +211,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(
@@ -247,25 +269,6 @@ 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
@@ -291,6 +294,7 @@ 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)
@@ -298,13 +302,19 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
var maxXY = this.map.getLonLatFromPixel(
new OpenLayers.Pixel(position.right, position.top)
);
var bounds = new OpenLayers.Bounds(
bounds = new OpenLayers.Bounds(
minXY.lon, minXY.lat, maxXY.lon, maxXY.lat
);
} else {
if(this.click) {
// box without extent - let the click handler take care of it
return;
}
bounds = this.pixelToBounds(position);
}
this.setModifiers(this.handlers.box.dragHandler.evt);
this.request(bounds);
}
},
/**
@@ -347,7 +357,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
request: function(bounds, options) {
options = options || {};
var filter = new OpenLayers.Filter.Spatial({
type: OpenLayers.Filter.Spatial.BBOX,
type: this.filterType,
value: bounds
});
@@ -355,7 +365,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
maxFeatures: options.single == true ? this.maxFeatures : undefined,
filter: filter,
callback: function(result) {
if(result.code == 1) {
if(result.success()) {
if(result.features.length) {
if(options.single == true) {
this.selectBestFeature(result.features,
@@ -421,7 +431,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
} else {
this.select(resultFeature || features);
}
};
}
},
/**
@@ -435,13 +445,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 event.
* featureselected and featuresselected events.
*
* Parameters:
* features - {<OpenLayers.Feature.Vector>} or an array of features
@@ -454,6 +464,11 @@ 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];
@@ -467,12 +482,17 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
});
if(cont !== false) {
this.features[feature.fid || feature.id] = feature;
selectedFeatures.push(feature);
this.events.triggerEvent("featureselected",
{feature: feature});
}
}
}
this.events.triggerEvent("featuresselected", {
features: selectedFeatures
});
}
},
/**

View File

@@ -0,0 +1,327 @@
/* 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,6 +21,13 @@
*/
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.
@@ -53,7 +60,6 @@ OpenLayers.Control.KeyboardDefaults = OpenLayers.Class(OpenLayers.Control, {
draw: function() {
this.handler = new OpenLayers.Handler.Keyboard( this, {
"keydown": this.defaultKeyPress });
this.activate();
},
/**

View File

@@ -23,10 +23,18 @@ OpenLayers.Control.LayerSwitcher =
OpenLayers.Class(OpenLayers.Control, {
/**
* Property: activeColor
* {String}
* APIProperty: roundedCorner
* {Boolean} If true the Rico library is used for rounding the corners
* of the layer switcher div, defaults to true.
*/
activeColor: "darkblue",
roundedCorner: true,
/**
* APIProperty: roundedCornerColor
* {String} The color of the rounded corners, only applies if roundedCorner
* is true, defaults to "darkblue".
*/
roundedCornerColor: "darkblue",
/**
* Property: layerStates
@@ -284,7 +292,7 @@ OpenLayers.Control.LayerSwitcher =
// create input element
var inputElem = document.createElement("input");
inputElem.id = this.id + "_input_" + layer.name;
inputElem.name = (baseLayer) ? "baseLayers" : layer.name;
inputElem.name = (baseLayer) ? this.id + "_baseLayers" : layer.name;
inputElem.type = (baseLayer) ? "radio" : "checkbox";
inputElem.value = layer.name;
inputElem.checked = checked;
@@ -305,6 +313,7 @@ OpenLayers.Control.LayerSwitcher =
// create span
var labelSpan = document.createElement("span");
OpenLayers.Element.addClass(labelSpan, "labelSpan")
if (!baseLayer && !layer.inRange) {
labelSpan.style.color = "gray";
}
@@ -419,8 +428,9 @@ OpenLayers.Control.LayerSwitcher =
*/
maximizeControl: function(e) {
//HACK HACK HACK - find a way to auto-size this layerswitcher
this.div.style.width = "20em";
// set the div's width and height to empty values, so
// the div dimensions can be controlled by CSS
this.div.style.width = "";
this.div.style.height = "";
this.showControls(false);
@@ -440,6 +450,10 @@ 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";
@@ -473,18 +487,6 @@ 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));
@@ -494,44 +496,24 @@ 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";
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%";
OpenLayers.Element.addClass(this.layersDiv, "layersDiv");
this.baseLbl = document.createElement("div");
this.baseLbl.innerHTML = OpenLayers.i18n("baseLayer");
this.baseLbl.style.marginTop = "3px";
this.baseLbl.style.marginLeft = "3px";
this.baseLbl.style.marginBottom = "3px";
OpenLayers.Element.addClass(this.baseLbl, "baseLbl");
this.baseLayersDiv = document.createElement("div");
this.baseLayersDiv.style.paddingLeft = "10px";
/*OpenLayers.Event.observe(this.baseLayersDiv, "click",
OpenLayers.Function.bindAsEventListener(this.onLayerClick, this));
*/
OpenLayers.Element.addClass(this.baseLayersDiv, "baseLayersDiv");
this.dataLbl = document.createElement("div");
this.dataLbl.innerHTML = OpenLayers.i18n("overlays");
this.dataLbl.style.marginTop = "3px";
this.dataLbl.style.marginLeft = "3px";
this.dataLbl.style.marginBottom = "3px";
OpenLayers.Element.addClass(this.dataLbl, "dataLbl");
this.dataLayersDiv = document.createElement("div");
this.dataLayersDiv.style.paddingLeft = "10px";
OpenLayers.Element.addClass(this.dataLayersDiv, "dataLayersDiv");
if (this.ascending) {
this.layersDiv.appendChild(this.baseLbl);
@@ -547,12 +529,15 @@ OpenLayers.Control.LayerSwitcher =
this.div.appendChild(this.layersDiv);
OpenLayers.Rico.Corner.round(this.div, {corners: "tl bl",
if(this.roundedCorner) {
OpenLayers.Rico.Corner.round(this.div, {
corners: "tl bl",
bgColor: "transparent",
color: this.activeColor,
blend: false});
color: this.roundedCornerColor,
blend: false
});
OpenLayers.Rico.Corner.changeOpacity(this.layersDiv, 0.75);
}
var imgLocation = OpenLayers.Util.getImagesLocation();
var sz = new OpenLayers.Size(18,18);
@@ -565,9 +550,7 @@ OpenLayers.Control.LayerSwitcher =
sz,
img,
"absolute");
this.maximizeDiv.style.top = "5px";
this.maximizeDiv.style.right = "0px";
this.maximizeDiv.style.left = "";
OpenLayers.Element.addClass(this.maximizeDiv, "maximizeDiv");
this.maximizeDiv.style.display = "none";
OpenLayers.Event.observe(this.maximizeDiv, "click",
OpenLayers.Function.bindAsEventListener(this.maximizeControl, this)
@@ -584,9 +567,7 @@ OpenLayers.Control.LayerSwitcher =
sz,
img,
"absolute");
this.minimizeDiv.style.top = "5px";
this.minimizeDiv.style.right = "0px";
this.minimizeDiv.style.left = "";
OpenLayers.Element.addClass(this.minimizeDiv, "minimizeDiv");
this.minimizeDiv.style.display = "none";
OpenLayers.Event.observe(this.minimizeDiv, "click",
OpenLayers.Function.bindAsEventListener(this.minimizeControl, this)

View File

@@ -44,6 +44,17 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
*/
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
* {<OpenLayers.Layer.Vector>}
@@ -207,9 +218,11 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
onUnselect: this.unselectFeature,
scope: this
};
if(this.standalone === false) {
this.selectControl = new OpenLayers.Control.SelectFeature(
layer, selectOptions
);
}
// configure the drag control
var dragOptions = {
@@ -223,6 +236,22 @@ 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(
@@ -244,7 +273,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
*/
destroy: function() {
this.layer = null;
this.selectControl.destroy();
this.standalone || this.selectControl.destroy();
this.dragControl.destroy();
OpenLayers.Control.prototype.destroy.apply(this, []);
},
@@ -257,7 +286,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
* {Boolean} Successfully activated the control.
*/
activate: function() {
return (this.selectControl.activate() &&
return ((this.standalone || this.selectControl.activate()) &&
this.handlers.keyboard.activate() &&
OpenLayers.Control.prototype.activate.apply(this, arguments));
},
@@ -277,11 +306,19 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
this.layer.removeFeatures(this.virtualVertices, {silent: true});
this.vertices = [];
this.dragControl.deactivate();
if(this.feature && this.feature.geometry && this.feature.layer) {
var feature = this.feature;
var valid = feature && feature.geometry && feature.layer;
if(this.standalone === false) {
if(valid) {
this.selectControl.unselect.apply(this.selectControl,
[this.feature]);
[feature]);
}
this.selectControl.deactivate();
} else {
if(valid) {
this.unselectFeature(feature);
}
}
this.handlers.keyboard.deactivate();
deactivated = true;
}
@@ -364,7 +401,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.feature) {
if(this.standalone === false && this.feature) {
// unselect the currently selected feature
this.selectControl.clickFeature.apply(this.selectControl,
[this.feature]);
@@ -374,8 +411,8 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Util.indexOf(this.geometryTypes,
feature.geometry.CLASS_NAME) != -1) {
// select the point
this.selectControl.clickFeature.apply(this.selectControl,
[feature]);
this.standalone || this.selectControl.clickFeature.apply(
this.selectControl, [feature]);
/**
* TBD: These lines improve workflow by letting the user
* immediately start dragging after the mouse down.
@@ -452,7 +489,8 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
this.layer.destroyFeatures(this.virtualVertices, {silent: true});
this.virtualVertices = [];
}
this.layer.drawFeature(this.feature, this.selectControl.renderIntent);
this.layer.drawFeature(this.feature, this.standalone ? undefined :
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
@@ -558,7 +596,8 @@ 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.layer.drawFeature(this.feature, this.standalone ?
undefined :
this.selectControl.renderIntent);
this.resetVertices();
this.setFeatureState();
@@ -708,7 +747,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
* map - {<OpenLayers.Map>} The control's map.
*/
setMap: function(map) {
this.selectControl.setMap(map);
this.standalone || 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=function() { return false; };
document.onselectstart = OpenLayers.Function.False;
OpenLayers.Event.stop(evt);
},

View File

@@ -53,6 +53,13 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
*/
granularity: 10,
/**
* APIProperty: emptyString
* {String} Set this to some value to set when the mouse is outside the
* map.
*/
emptyString: null,
/**
* Property: lastXy
* {<OpenLayers.Pixel>}
@@ -111,7 +118,8 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
var lonLat;
if (evt == null) {
lonLat = new OpenLayers.LonLat(0, 0);
this.reset();
return;
} else {
if (this.lastXy == null ||
Math.abs(evt.xy.x - this.lastXy.x) > this.granularity ||
@@ -141,6 +149,15 @@ 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
@@ -165,6 +182,7 @@ 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 = function() { return false; };
document.onselectstart = OpenLayers.Function.False;
OpenLayers.Event.stop(evt);
},

View File

@@ -36,18 +36,38 @@ 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,
/**
* APIProperty: handleRightClicks
* {Boolean} Whether or not to handle right clicks. Default is false.
@@ -65,6 +85,13 @@ 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
@@ -108,7 +135,9 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
this.handlers.wheel.activate();
}
this.handlers.click.activate();
if (this.zoomBoxEnabled) {
this.zoomBox.activate();
}
return OpenLayers.Control.prototype.activate.apply(this,arguments);
},
@@ -129,7 +158,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 = function () { return false;};
this.map.viewPortDiv.oncontextmenu = OpenLayers.Function.False;
}
var clickCallbacks = {
@@ -144,7 +173,10 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
this, clickCallbacks, clickOptions
);
this.dragPan = new OpenLayers.Control.DragPan(
OpenLayers.Util.extend({map: this.map}, this.dragPanOptions)
OpenLayers.Util.extend({
map: this.map,
documentDrag: this.documentDrag
}, this.dragPanOptions)
);
this.zoomBox = new OpenLayers.Control.ZoomBox(
{map: this.map, keyMask: this.zoomBoxKeyMask});
@@ -152,8 +184,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.activate();
"down": this.wheelDown},
this.mouseWheelOptions );
},
/**
@@ -186,8 +218,11 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
* deltaZ - {Integer}
*/
wheelChange: function(evt, deltaZ) {
var newZoom = this.map.getZoom() + deltaZ;
if (!this.map.isValidZoomLevel(newZoom)) {
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) {
return;
}
var size = this.map.getSize();
@@ -207,9 +242,10 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
*
* Parameters:
* evt - {Event}
* delta - {Integer}
*/
wheelUp: function(evt) {
this.wheelChange(evt, 1);
wheelUp: function(evt, delta) {
this.wheelChange(evt, delta || 1);
},
/**
@@ -218,9 +254,28 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
*
* Parameters:
* evt - {Event}
* delta - {Integer}
*/
wheelDown: function(evt) {
this.wheelChange(evt, -1);
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();
}
},
/**

View File

@@ -67,11 +67,11 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
limit: 50,
/**
* Property: activateOnDraw
* {Boolean} Activate the control when it is first added to the map.
* Default is true.
* APIProperty: autoActivate
* {Boolean} Activate the control when it is added to a map. Default is
* true.
*/
activateOnDraw: true,
autoActivate: true,
/**
* Property: clearOnDeactivate
@@ -126,16 +126,9 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Control.prototype.initialize.apply(this, [options]);
this.registry = OpenLayers.Util.extend({
"moveend": function() {
return {
center: this.map.getCenter(),
resolution: this.map.getResolution()
};
}
"moveend": this.getState
}, this.registry);
this.clear();
var previousOptions = {
trigger: OpenLayers.Function.bind(this.previousTrigger, this),
displayClass: this.displayClass + " " + this.displayClass + "Previous"
@@ -150,6 +143,7 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Util.extend(nextOptions, this.nextOptions);
this.next = new OpenLayers.Control.Button(nextOptions);
this.clear();
},
/**
@@ -224,9 +218,6 @@ 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();
}
},
/**
@@ -288,7 +279,23 @@ 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,15 +143,25 @@ 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.mapDiv.removeChild(this.extentRectangle);
this.extentRectangle = null;
if (this.rectEvents) {
this.rectEvents.destroy();
this.rectEvents = null;
}
if (this.ovmap) {
this.ovmap.destroy();
this.ovmap = null;
}
this.element.removeChild(this.mapDiv);
this.mapDiv = null;

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.
* on clicking the arrow buttons, defaults to 50.
*/
slideFactor: 50,

View File

@@ -25,6 +25,13 @@
*/
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.
@@ -36,10 +43,14 @@ 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),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST)
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})
]);
},

View File

@@ -163,6 +163,7 @@ 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,6 +58,25 @@ 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
*/
@@ -78,6 +97,9 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
});
OpenLayers.Control.PanZoom.prototype.destroy.apply(this, arguments);
delete this.mouseDragStart;
delete this.zoomStart;
},
/**
@@ -266,7 +288,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.map.fractionalZoom) {
if(this.forceFixedZoomLevel || !this.map.fractionalZoom) {
levels = Math.floor(levels);
}
var zoom = (this.map.getNumZoomLevels() - 1) - levels;
@@ -335,7 +357,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
if (!OpenLayers.Event.isLeftClick(evt)) {
return;
}
if (this.zoomStart) {
if (this.mouseDragStart) {
this.div.style.cursor="";
this.map.events.un({
"mouseup": this.passEventToSlider,
@@ -344,7 +366,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
});
var deltaY = this.zoomStart.y - evt.xy.y;
var zoomLevel = this.map.zoom;
if (this.map.fractionalZoom) {
if (!this.forceFixedZoomLevel && this.map.fractionalZoom) {
zoomLevel += deltaY/this.zoomStopHeight;
zoomLevel = Math.min(Math.max(zoomLevel, 0),
this.map.getNumZoomLevels() - 1);
@@ -352,8 +374,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,6 +21,13 @@ 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
@@ -107,7 +114,6 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
scope: this
});
}
this.activate();
return this.div;
},
@@ -183,13 +189,14 @@ 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));
}
@@ -216,6 +223,13 @@ 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

@@ -62,6 +62,12 @@ OpenLayers.Control.ScaleLine = OpenLayers.Class(OpenLayers.Control, {
*/
eBottom:null,
/**
* APIProperty: geodesic
* {Boolean} Use geodesic measurement. Default is false.
*/
geodesic: false,
/**
* Constructor: OpenLayers.Control.ScaleLine
* Create a new scale line control.
@@ -83,9 +89,6 @@ 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";
@@ -160,6 +163,13 @@ OpenLayers.Control.ScaleLine = OpenLayers.Class(OpenLayers.Control, {
// 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;
}
// decide whether to use large or small scale units
var topUnits;
@@ -185,8 +195,8 @@ OpenLayers.Control.ScaleLine = OpenLayers.Class(OpenLayers.Control, {
bottomMax = bottomRounded / inches[curMapUnits] * inches[bottomUnits];
// and to pixel units
var topPx = topMax / res;
var bottomPx = bottomMax / res;
var topPx = topMax / res / geodesicRatio;
var bottomPx = bottomMax / res / geodesicRatio;
// now set the pixel widths
// and the values inside them
@@ -203,6 +213,26 @@ 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: this,
scope: null,
/**
* APIProperty: geometryTypes
@@ -178,16 +178,11 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Control.prototype.EVENT_TYPES
);
OpenLayers.Control.prototype.initialize.apply(this, [options]);
if(layers instanceof Array) {
this.layers = layers;
this.layer = new OpenLayers.Layer.Vector.RootContainer(
this.id + "_container", {
layers: layers
}
);
} else {
this.layer = layers;
if(this.scope === null) {
this.scope = this;
}
this.initLayer(layers);
var callbacks = {
click: this.clickFeature,
clickout: this.clickoutFeature
@@ -213,10 +208,34 @@ 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();
@@ -468,6 +487,13 @@ 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);
}
@@ -525,6 +551,11 @@ 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)) {
@@ -554,5 +585,28 @@ 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

@@ -0,0 +1,579 @@
/* 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

@@ -31,6 +31,14 @@ 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
@@ -39,11 +47,18 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
*/
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
* <layerUrl> will be considered.
* <layerUrls> will be considered.
*/
layers: null,
@@ -131,14 +146,20 @@ 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.
* 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.
*/
EVENT_TYPES: ["getfeatureinfo"],
EVENT_TYPES: ["beforegetfeatureinfo", "getfeatureinfo"],
/**
* Constructor: <OpenLayers.Control.WMSGetFeatureInfo>
@@ -164,7 +185,11 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
);
}
if (this.hover) {
if(this.drillDown === true) {
this.hover = false;
}
if(this.hover) {
this.handler = new OpenLayers.Handler.Hover(
this, {
'move': this.cancelHover,
@@ -174,8 +199,10 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
'delay': 250
}));
} else {
this.handler = new OpenLayers.Handler.Click(this,
{click: this.getInfoForClick}, this.handlerOptions.click || {});
var callbacks = {};
callbacks[this.clickCallback] = this.getInfoForClick;
this.handler = new OpenLayers.Handler.Click(
this, callbacks, this.handlerOptions.click || {});
}
},
@@ -216,6 +243,7 @@ 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");
@@ -230,6 +258,7 @@ 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});
},
@@ -251,9 +280,8 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
*/
findLayers: function() {
var layers = [];
var candidates = this.layers || this.map.layers;
var layers = [];
var layer, url;
for(var i=0, len=candidates.length; i<len; ++i) {
layer = candidates[i];
@@ -262,15 +290,14 @@ 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.url) {
if(this.drillDown === false && !this.url) {
this.url = url;
}
if(this.urlMatches(url)) {
if(this.drillDown === true || this.urlMatches(url)) {
layers.push(layer);
}
}
}
return layers;
},
@@ -299,6 +326,89 @@ 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
@@ -312,63 +422,69 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
* - *hover* {Boolean} true if we do the request for the hover handler
*/
request: function(clickPosition, options) {
options = options || {};
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, ""));
}
}
if(layers.length == 0) {
// Reset the cursor.
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
return;
}
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
};
options = options || {};
if(this.drillDown === false) {
var wmsOptions = this.buildWMSOptions(this.url, layers,
clickPosition, layers[0].params.FORMAT);
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);
}
}
},
/**
* 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");
}
},
/**
@@ -387,16 +503,18 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
doc = request.responseText;
}
var features = this.format.read(doc);
this.events.triggerEvent("getfeatureinfo", {
text: request.responseText,
features: features,
request: request,
xy: xy
});
// Reset the cursor.
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
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;
}
}
},
/**

View File

@@ -51,12 +51,13 @@ 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));
var bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat,
bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat,
maxXY.lon, maxXY.lat);
} else {
var pixWidth = Math.abs(position.right-position.left);
@@ -70,7 +71,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;
var bounds = new OpenLayers.Bounds(xmin, ymin, xmax, ymax);
bounds = new OpenLayers.Bounds(xmin, ymin, xmax, ymax);
}
// always zoom in/out
var lastZoom = this.map.getZoom();

View File

@@ -435,6 +435,14 @@ 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.
@@ -459,6 +467,11 @@ OpenLayers.Events = OpenLayers.Class({
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.
this.eventTypes = [];
@@ -481,6 +494,11 @@ 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;
@@ -532,16 +550,29 @@ OpenLayers.Events = OpenLayers.Class({
},
/**
* Method: on
* APIMethod: 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) {
@@ -623,16 +654,29 @@ OpenLayers.Events = OpenLayers.Class({
},
/**
* Method: un
* APIMethod: 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) {
@@ -773,8 +817,7 @@ OpenLayers.Events = OpenLayers.Class({
if (!this.includeXY) {
this.clearMouseCache();
} else if (!this.element.hasScrollEvent) {
OpenLayers.Event.observe(window, 'scroll',
OpenLayers.Function.bind(this.clearMouseCache, this));
OpenLayers.Event.observe(window, "scroll", this.clearMouseListener);
this.element.hasScrollEvent = true;
}

View File

@@ -90,6 +90,10 @@ 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

@@ -68,6 +68,13 @@ OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, {
*/
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
* {String} rendering intent currently being used
@@ -160,6 +167,27 @@ 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
* HACK - we need to decide if all vector features should be able to
@@ -332,6 +360,7 @@ 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".
@@ -349,7 +378,12 @@ 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