Compare commits

...

320 Commits

Author SHA1 Message Date
euzuro
de5a3c36f1 Tagging the x.y rcZ Release
git-svn-id: http://svn.openlayers.org/tags/openlayers/release-2.7-rc2@8013 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-12 17:26:18 +00:00
euzuro
f7f338e265 Batch merge for rc2 of 2.7. 'svn merge -r7967:HEAD from trunk (Closes #1733) (Closes #1489) (Closes #1639) (Closes #1718) (Closes #1723) (Closes #1732) (Closes #1616) (Closes #1722)
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.7@8012 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-12 17:24:20 +00:00
Paul Spencer
a43e98762c add missing semi-colons (jslint now clean on all lib/ code)
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.7@7975 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-07 14:02:25 +00:00
euzuro
904f0391bf Branching for 2.7 release... take two
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.7@7967 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-05 15:35:03 +00:00
euzuro
f935c599d1 Added a control for drawing geometries and returning basic metrics (length / area). Patch by tschaub, review by elemoine. (Closes #1241)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7965 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-05 15:07:59 +00:00
euzuro
c7b8a5bce6 Sketch handler updates. Patch by tschaub, review elemoine (Closes #1698)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7964 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-05 15:06:04 +00:00
Frédéric Junod
629f370b75 don't redeclare the format property in Protocol.HTTP. r=elemoine (Closes #1721)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7960 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-05 07:34:56 +00:00
Éric Lemoine
e6d51fcf49 add "refresh" event to Layer.Vector, r=tschaub (closes #1695)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7959 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-05 07:05:11 +00:00
Éric Lemoine
6d74b489bb code committed in [7952] (ticket #1719) is missing a key/value pair in Lang/en.js, my bad: I had in my working directory but forgot to include it in the patch
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7958 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-05 06:23:31 +00:00
Tim Schaub
656a829f82 Allowing for geometries whose bounds cannot be intersected. Thanks for the quick review Andreas. r=ahocevar (closes #1720)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7957 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 23:12:09 +00:00
euzuro
4ae2e45083 Fixing example to only do the conditional inclusion on ie6 and below and adding some explanatory comments in the example file and also in the actual controls themselves. No functional change to library (only to example file)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7956 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 22:05:05 +00:00
Tim Schaub
c066796698 Adding support to the gml parser for serializing OpenLayers.Bounds as gml:Box. This gives the filter format (and the sld format) the ability to write spatial filters (that have bounds as a value). r=me (closes #1543)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7955 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 21:44:52 +00:00
ahocevar
d046680c65 the renderer also needs a nodeTypeCompare method
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7954 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 21:12:09 +00:00
ahocevar
bbf739319c non-functional change: added missing stub method nodeTypeCompare
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7953 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 21:11:10 +00:00
Tim Schaub
89cc9f157f Adding OpenLayers.Filter.Spatial. Thanks to bartvde for the original patch. Thanks elemoine for adding the evaluate method and test. I'm putting this in so we can move on some other tickets. r=me (closes #1719)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7952 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 20:52:05 +00:00
Tim Schaub
c83403fa67 Space only, nothing to see here.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7951 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 20:44:10 +00:00
euzuro
5084ea6a91 Add new ZoomPanel and PanPanel, a step towards a more easily customizable look for OpenLayers. Work on this ticket was done by a slew of contributors, and reviews as well. Thanks especially to tschaub for the ie6 trick and concomittant non-alpha images. (Closes #1400).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7950 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 19:21:59 +00:00
crschmidt
d2ac6cacfd Add a KaMapCache Layer class. Similar to the Layer.TileCache class, this layer
allows access to a web-accessible pre-cached Ka-Map Layer. Patch from 
Pedro Simonetti (CLA on file). r=me, (Closes #1518)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7949 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 19:17:47 +00:00
euzuro
d19ec0da99 fix a somewhat broken FixedZoomLevels.js functionality -- the 'maxZoomLevels' property if set on a layer was not getting processed correctly. This patch fixes that issue, as well as adding a cole-slaw-sized blerb of comments explaining the rules of precedence wrt resolution setting for 3rd party layers (those who subclass FixedZoomLevels). Thanks to tschaub for poking me to clarify this previously messy territory, and for cr5 for kindly taking the time to review my patch. (Closes #1182)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7948 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 18:35:40 +00:00
euzuro
19bffb0092 Give VE its missing zoom-level (resolution). Thanks to TIM for finding this and pointing it out and thanks to cr5 for the quick review. (Closes #1181)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7947 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 16:57:56 +00:00
ahocevar
4255028c6a Bringing back the pre-r7652 behavior that allows changing the node type for features that have already been rendered. This is important when re-rendering a feature with a new style, e.g. when switching from externalGraphic to graphicName point symbolizers. r=elemoine (closes #1662)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7944 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 08:31:05 +00:00
euzuro
819dc62d09 fixing regression committed in r5280. applyDefaults() again allows for an undefined value as the 'from' parameter. thanks tim for report and review. (Closes #1716)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7943 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 02:19:41 +00:00
euzuro
4783dd5a45 add warning comment to wfs-t example. thanks for suggestion, o anonymous user. (Closes #1311)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7942 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-04 01:18:27 +00:00
Tim Schaub
d9e161f4d0 Allow layer.destroy to be called twice without failing for the vector layer. r=elemoine (closes #1697)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7941 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-03 19:16:29 +00:00
Tim Schaub
6277216053 Adding HTTP protocol. Give a vector layer the HTTP protocol to create, read, update, and delete features via HTTP. This can be subclassed by protocols that extend HTTP. Thanks for the collaboration (and great tests) on this elemoine - good working with you guys. r=elemoine,me (closes #1652)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7940 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-03 19:10:47 +00:00
ahocevar
c12cb25aee New vector rendering for better performance and less renderer specific limitations. r=elemoine (closes #1675, closes #1656, closes #1631, closes #1431, closes #1709)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7930 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-02 17:17:52 +00:00
Paul Spencer
ede7bef13c Adjust how the parameters are calculated for the GETVISIBLEMAPEXTENT call for overlays so that existing parameters are safely overwritten with the required parameters for this call. r=me (Closes #1647)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7928 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-02 15:46:35 +00:00
Paul Spencer
f8d3e41105 Tiled MapGuide layers require different base assumptions for DPI and inches per unit in order to report the correct coordinates. The example is updated with a clear explanation of how to make these changes per-application. r=me (Closes #1511)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7927 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-02 15:43:57 +00:00
ahocevar
9d1bcce4e5 Let's take care that background graphic nodes of features with backgroundGraphic style get removed properly when the style is changed to display: "none".
This solves the backgroundGraphic issue of #1709, the remaining issue with externalGraphic will be fixed by #1675.

Thanks jstern81 for the patch, and I am truly impressed by jstern81 finding the right spot in the codebase that needs to be fixed -- as an OpenLayers newcomer.

Tests added by myself. r=me. (references #1709)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7919 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-01 21:46:26 +00:00
Frédéric Junod
274cd26c5a Don't check this.locked twince. r=euzuro (Closes #1712)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7914 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-09-01 06:02:54 +00:00
euzuro
be8c90012e Fixing the sizing issues with the popups -- all this time, the 'size' parameter we were passing in to init a popup has been the *content* size, not the actual size of the popup. This confusion has stemmed from the fact that we weren't ever differentiating between the two. Now we are. Rename that parameter 'contentSize' in all the constructors. NOTE that this does not *break* API, it is merely renaming a variable. As such, no one should see any difference... other than the fact that autosized popups now stay their correct size when opened and closed repeatedly. Big thanks to jpulles for finding this bug and filing an accurate, informative, and detailed bug report. Thanks to ahocevar and crschmidt for reviewing. (Closes #1586)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7897 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-29 16:28:20 +00:00
ahocevar
d5bd6d59f2 use empty moveTo function to prevent tiles from actually being requested. (closes #1701)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7894 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-29 10:11:54 +00:00
ahocevar
8f1b84a8e1 To test real-life conditions, we cannot just use a bogus function to deactivate the control. (closes #1710)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7893 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-29 09:27:29 +00:00
euzuro
07ac8f322a bubbling up the 'closest' parameter to the higher-level map object api calls zoomToScale() and zoomToExtent(). Includes thorough tests. r=cr5 (Closes #1250)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7889 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-29 06:08:32 +00:00
euzuro
ec2b9b5289 improving the biceps of getStyle(). Now if you pass it a null object, it will not die. r=cr5 (Closes #1051)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7888 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-29 00:46:45 +00:00
euzuro
27526e6a0c Adding registerImageListener() function that sits around and waits until images load in our popups... and when they do, it calls updateSize() so that the popup is sized correctly. thanks for the sharp review cr5 (Closes #1469)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7887 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-28 22:05:46 +00:00
euzuro
3007b23621 Bubble out the code that handles the re-sizing of the popup into an APIMethod: updateSize(). Other change is that now instead of using the 'contentHTML' string property to autosize, we will now use the actual contentDiv's 'innerHTML' property. This is possible because in the setContentHTML() function, we switch around the order and set the conentDiv.innerHTML *before* calling updateSize(). Seemingly minor, this change actually does wonders towards distancing us from the horrendous idea that the 'contentHTML' property was in the first place. Now, if users go in and fudge with the contentDiv DOMElement directly, they can still benefit from the auto-sizing. In fact, 'contentHTML' can be totally ignored altogether. joy. All tests pass, including an eyeballing of the acceptance test examples/popupMatrix.html in ff2 and ie7. Mil gracias to cr5 for the speedy review (Closes #1708)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7886 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-28 20:04:17 +00:00
crschmidt
2d286b7ccc Clear bounds of geometries when reprojecting. Patch wwork by myself, tschaub,
ahocevar. r=ahocevar. (Closes #1658)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7885 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-28 18:41:00 +00:00
crschmidt
1b71180f14 fix reproj example
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7884 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-28 16:41:59 +00:00
Éric Lemoine
3dd6bdce66 bring changes to protocol base class, r=fredj (closes #1677)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7883 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-28 13:33:11 +00:00
Frédéric Junod
d77bf63360 add a requires on parent class, ND comments fixes
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7882 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-28 12:27:39 +00:00
ahocevar
59826983c6 made permalink control more configurable by adding an argParserClass property and separating the logic for generating the key-value pairs from the div and link generation. Original patch by tcoulter. r=euzuro,me (closes #1489)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7881 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-27 19:33:49 +00:00
ahocevar
2a521ffcb2 Made the Feature handler more robust to things that are related to changing layer order on the map, by registering an event handler that will bring the handler's layer back to the top of the layer stack in the DOM. Contains a manual test. r=elemoine (closes #1628)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7879 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-27 14:02:21 +00:00
Éric Lemoine
8e0876488b Add a moveend event to layer. By registering to that event (instead of that at
the map level) strategies need to check that the layer is in range and active
before fetching new features. r=ahocevar (closes #1678)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7874 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-27 06:27:22 +00:00
crschmidt
72bf882b62 Controls should (by definition within OL) stop downs (if they care) and allow
ups to propogate. The default behavior of the Feature handler broke this rule,
and as a result, some aspects of ragging a box control failed when letting
go over a feature. This corrects the behavior. r=ahocevar. (Closes #1293) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7873 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-26 23:35:31 +00:00
euzuro
17160f49e0 Add support in OL for right-click capturing, including dbl-right-clicks (for zooming out in navigation control). Thanks to David Martin for this nice patch and the great 8 foot austrian for his review (Closes #1359)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7872 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-26 23:27:04 +00:00
crschmidt
091d3cfbeb GeoRSS fails on large line/poly nodes in FF. Use concatChildNodes to get all
the text into one string before parsing. Includes manual test. r=ahocevar. 
(Closes #1614) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7871 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-26 23:24:44 +00:00
crschmidt
319c8f87ef Exceptions in Firefox are slow. (The costs of the lovely exception.stack,
most likely.) Don't depend on exceptions for parsing XML, then: instead, use
an if/else. 3x speed up of WMC parsing in FF. r=ahocevar (Closes #1642) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7870 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-26 23:11:03 +00:00
ahocevar
75b129191b rule.value2regex does now unescape double escape. Patch by tcoulter. r=me (closes #1453)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7866 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-26 18:03:41 +00:00
euzuro
0eadc40e27 Keep the 'loadstart' event from firing twice on the Layer.Text. r=elemoine, cr5 (Closes #1696)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7865 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-26 17:17:19 +00:00
ahocevar
00192b64ab Added support for different projections for main map and overview map. Patch by bartvde. Modifications to the original patch:
* caclulation of resolution factor no longer depends on proj4js,
 * created a member variable for the resolution factor and moved the calculation of the resolution factor to createMap(),
 * created acceptance test (tests/manual/overviewmap-projection.html).
r=me (closes #1620)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7864 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-26 14:54:48 +00:00
crschmidt
acb003453f Update calculateInRange: Only turn layers off if they have some scale-related
properties set directly in their creation options. By default, layers will 
be "always on", with an overridable "alwaysInRange" parameter.

To maintain the old behavior, set:
   OpenLayers.Layer.prototype.alwaysInRange = false;

r=euzuro
(Closes #987)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7863 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-26 14:27:36 +00:00
crschmidt
68f70f750b Add support for a Canvas renderer. This renderer will allow for some new
capabilties in OpenLayers Vector drawing, including: 
 * Vector support for iPhone, Safari 2.x series browsers
 * Improved performance of dragging the map with a large number of 
   geometries.

The Vector layer default renderer order is now SVG, VML, Canvas, so browsers
with Canvas support and no SVG or VML will be able to draw vectors.

The Canvas layer has a number of limitations: getFeatureFromEvent is much
slower than the other types of layer, and any change to any feature requires a
redraw of the entire canvas. Because Canvas is typically a pretty fast 
drawing implementation, the latter is less problematic than it might otherwise
be.

r=pagameba,fred, with glances from a couple other people.
(Closes #1512)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7862 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-26 14:22:59 +00:00
ahocevar
4fcd61f276 Clear point bounds after changing coordinates. Prevents strange behaviour of IE when doing getBounds(). r=elemoine (closes #1690)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7859 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-26 07:39:21 +00:00
euzuro
afecf46652 Small patch to allow an 'id' property to be custom-set on controls -- without being overrided by the default random id generator. Thanks to Stephen I for the bug report. r=elemoine (Closes #1687)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7829 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-22 13:23:16 +00:00
ahocevar
52a5173326 forgot to commit modified tests (references #1679)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7783 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-18 13:20:01 +00:00
ahocevar
5e9965a922 forgot to commit modified examples (references #1679)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7782 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-18 12:57:32 +00:00
ahocevar
8f45e0572e "disable z-indexing of elements in the Elements renderer by default". r=elemoine (closes #1679)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7781 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-18 12:53:06 +00:00
ahocevar
73eb0d5745 use t.eq instead of t.ok when comparing values
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7771 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-16 10:52:01 +00:00
Frédéric Junod
7a462b74ee Give the map a size to pass the tests on IE 7
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7714 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-08 14:39:17 +00:00
Frédéric Junod
f086ba17b4 keep the cursor style to 'move' if the cursor is above a feature. r=elemoine (closes #1673)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7713 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-08 13:34:59 +00:00
Éric Lemoine
3791712a10 maxZIndex becomes NULL when the last feature is removed, p=pvalsecc, r=me (closes #1670)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7712 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-08 12:23:59 +00:00
Frédéric Junod
0493525660 remove local scope variables from global namespace. (closes #1674)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7711 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-08 10:32:49 +00:00
Frédéric Junod
e0ac42ac5c Update copyright year, wrap long line, generate api doc, fix mailing list url. (closes #1618)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7710 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-08 07:09:14 +00:00
Éric Lemoine
d7ab2c0f60 Layer.Vector.removeMap must deactivate the strategies, r=fredj (closes #1649)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7708 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-05 13:59:12 +00:00
Frédéric Junod
39201a0427 Adding OpenLayers.Strategy.Fixed: A simple strategy that requests features once and never requests new data. r=elemoine, (Closes #1664)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7707 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-05 11:55:24 +00:00
Frédéric Junod
4be8c169d4 test Strategy.activate and Strategy.deactivate
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7706 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-05 11:44:36 +00:00
Frédéric Junod
18af32a5ac Remove JSDOC from CLASS_NAME property, (see #853)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7704 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-05 05:54:47 +00:00
Frédéric Junod
14119a6811 Fix a typo in Layer.Vector.destroy and add unit tests for protocol and strategies construct/destroy, r=crschmidt (closes #1659)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7703 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-05 05:39:11 +00:00
Frédéric Junod
a3ffb5734c OpenLayers.Strategy destroy() nullify options property. r=elemoine (closes #1657)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7690 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-04 12:25:47 +00:00
crschmidt
397de6fc6a "Format.GeoJSON does not parse features with null geometries", r=elemoine
(Closes #1145)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7689 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-04 10:38:01 +00:00
Éric Lemoine
21191ad0b9 if scales is set on the map, you cannot use minScale and maxScale on the layer, p=pgiraud, r=me,euzuro (closes #1199)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7688 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-04 09:20:23 +00:00
Frédéric Junod
9e83c720d9 Test if OpenLayers.Protocol::destroy() nullify options property
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7687 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-04 09:11:19 +00:00
crschmidt
91f3c5e652 Improve getRenderedDimensions to take into account a CSS class. Refactor some
popup code to take advantage of this, to provide a better hint to the
getRenderedDimensions call as to what is going on. Patch from sbenthall, r=me,
includes a manual acceptance test (only because the testing framework makes
these kinds of things hard). Manually confirmed to work with the sundials.html
example, tested with that and manual test in IE6, IE7, FF2-Win FF3-Mac FF2-Mac
Safari-Mac Opera-Win, and in all browsers it worked. (Hooray!) Nice one,
sbenthall. (Closes #1500)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7684 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-03 18:47:52 +00:00
crschmidt
cdd4c864ea Flipped a return value here; this should be 'true', not 'false'. (See #1655)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7683 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-03 12:24:18 +00:00
crschmidt
693e6d07e3 Fix for Feature handler uses getFeatureFromEvent on mousemove even without
hover callbacks; r=ahocevar (Closes #1655) 

This means that On the SelectFeature control hover can no longer be set on the
SelectFeature control after the control has been initialized: must be passed at
initialize time. Example has been updated. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7682 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-03 02:06:31 +00:00
ahocevar
f0e9c1c6a5 removed wms layer from externalGraphic test. Makes test faster.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7681 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-03 01:30:29 +00:00
ahocevar
8bd5eee49f simplified vector-features-performance test
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7680 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-03 00:30:30 +00:00
crschmidt
d437dec91c Since the Sundials is our primary KML + bubbles example, put in some naive
Javascript <script> injection protection, so that people are at least aware
of the issue. This will search for <script and if it exists, escape the content
so that it doesn't execute. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7679 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-02 21:56:25 +00:00
crschmidt
f1882f0efa "panTo should use tween if new center is in the current bounds + a ratio".
Add a bounds.scale method (takes a ratio and an optional center) and 
call it from the panTo to give a ratio we can pan inside of. Patch by
sbenthall, r=me,elemoine (Closes #1341) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7678 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-02 01:56:36 +00:00
crschmidt
61225ed98f Fixing an obvious bug in Ajax.js: when we upgraded Prototype, we missed
a pair -> extras, caught by 'falstaff'. (Closes #1559) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7677 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-02 01:44:26 +00:00
crschmidt
711d909a14 Update VE script location to new version.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7676 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 22:24:44 +00:00
crschmidt
64fc4fcb1b Patch from funky_c to move all alert()s in the library to a single
OpenLayers.Console.userError function. This allows for easy overriding of this
function for people who need to report errors at an application level (or
hiding these errors entirely), with the same default behavior as previous
releases. Patch from funky_c, r=me, (Closes #1651)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7675 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 22:21:50 +00:00
crschmidt
ba561a9fb5 Improve docs; explicitly mention that this transform is *in place*
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7674 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 22:09:20 +00:00
ahocevar
9588f25ce5 Stroke style of features can now be specified. Both SVG's
stroke-dasharray and VML's dashstyle properties are allowed in the new 
strokeDashstyle symbolizer property. For VML, which does not support 
custom dash styles, one of the 5 matching pre-defined dash styles will 
be guessed. The patch also adds support for the stroke-dasharray 
property in SLD. r=crschmidt (closes #1126)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7673 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 21:56:17 +00:00
ahocevar
7148b10123 do not ignore style.rotation if set to 0 any more. r=crschmidt (closes #1654)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7672 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 21:49:44 +00:00
ahocevar
197043d249 fixed event handling and rendering of graphicName symbols for Safari and Opera. r=crschmidt (closes #1653)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7671 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 21:35:35 +00:00
ahocevar
eddfa62c1f Use getAttributeNS instead of getAttribute. Non-functional change. (references #1650)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7670 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 21:12:56 +00:00
ahocevar
a59e7f0f4e fixed rendering but in FF3 when resizing graphicName symbols.
r=crschmidt (fixes #1650)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7669 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 18:43:31 +00:00
crschmidt
2b8cc7e0fd "WMC: queryable seems implemented but does not actually work", patch from
Bart, tests by me, r=me, (Closes #1447)  


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7668 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 18:30:55 +00:00
Paul Spencer
7f38f22d8f Refactor backBuffer tile code out of generic Tile base class into Tile.Image to make it nicer when subclassing Tile for other needs. (Closes #1645) r=elemoine.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7667 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 18:25:28 +00:00
crschmidt
e7ebdc8aa0 Non unique HTMLElement in Control, fix put together by sbenthall.
Tests pass, etc. (Closes #1396) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7666 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 18:21:56 +00:00
crschmidt
76170bf821 making the test div smaller so I don't have to scroll two things to run a
specific test. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7665 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 18:15:30 +00:00
crschmidt
232b635b12 replace all spaces with '', so that it matches in SVG + FFox
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7664 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 18:12:09 +00:00
euzuro
6f73b412c2 Get our VirtualEarth layer working again with the latest (6.1) version. Backwards compatible with earlier versions thanks to soft insistence of cr5. Thanks to funkyc for the co-sleuthing. r=cr5 (Closes #1540)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7660 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 15:34:50 +00:00
euzuro
558cd57e41 backing out patch for r7647 as it breaks framedcloud popups. (See #1586)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7656 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 05:06:30 +00:00
Paul Spencer
48e8a981d1 typo in comment.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7655 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 03:03:25 +00:00
Tim Schaub
f3283e9212 Adding gml specific attributes to feature in gml parsing. p=sbenthall r=me (closes #1328)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7654 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 01:30:39 +00:00
Tim Schaub
714b1d7363 Unrequire that which does not exist.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7653 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 00:35:02 +00:00
euzuro
8b98f5acc3 ordering <exclamation point/>. you can now gracefully z-order your vectors... and you can even 'yOrder' them and add background images, making for a nice 3dish look. be sure to check out the two new example html's: marker-shadow.html and ordering.html. Big thanks to tcoulter (funkyc) for a prolonged effort with this patch. It has come a long way and now what a beautiful finish. (Closes #1357)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7652 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-08-01 00:17:59 +00:00
Tim Schaub
d4a62c630a Adding a filter format for version 1.0.0 filter encoding. The sld parser extends itself to use readers and writers from the filter parser. r=me (closes #1605)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7651 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 23:34:19 +00:00
Tim Schaub
360d7412f0 Adding strategy and protocol base classes for better vector behavior. This just sets the common API for strategy and protocol. In general, a vector layer can have many strategies. A setLayer method gets called on each of these layers. When a layer is added to a map, any strategies on that layer get activated. When the layer is destroyed, any strategies get destroyed (this could be changed to deactivate for symmetry). A vector layer may also have a protocol. A protocol is typically constructed with a format. The layer doesn't need to know about the format. The protocol doesn't need to know about the layer. Strategies coordinate feature management for a layer. Specific strategies and protocols to follow. r=crschmidt (closes #1646)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7650 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 21:27:35 +00:00
ahocevar
5191dac459 Take css borders into account when drawing the box. This has to be done for every browser, except IE in quirks mode. r=crschmidt (closes 1593)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7649 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 21:21:10 +00:00
crschmidt
d3151ccb40 Updated Control.KeyboardDefaults tests, but not the Handler.Keyboard tests.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7648 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 20:49:59 +00:00
euzuro
c953579eb9 Fix for non auto-size popups that were progressively expanding each time they were opened. a little investigation showed us that there was some unfortunate ambiguity with the 'size' property, which was alternatively being used as 'size' and 'contentSize'. cheers to seb for an elegant solution r=cr5,me (Closes #1586)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7647 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 20:40:00 +00:00
Paul Spencer
a2905538d8 add anonymous username to url to prevent basic auth challenge when running tests. (Closes #1460) Update by madair, r=me
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7646 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 18:47:29 +00:00
ahocevar
19ac2bec2d added semicolon to fix single file build
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7645 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 17:47:27 +00:00
crschmidt
09b4073636 * Fixes to the Keyboard Handler to make it work better --
* drop keypress event (not used, registers as keydown in IE< which results
      in double events) 
    * return evt instead of evt.keyCode || evt.charCode, so apps can do
      whatever they like best
 * adjust ModifyFeature to new API
 * Adjust KeyboardDefaults to new API, and include a new set of keyCodes
    in switch statement to catch more cases
 * Include keyboard defaults test in list-tests.

Patch from tcoulter, work from Pedro Simonetti (See #1108), Paul Spencer,
myself. r=pagameba,me (Closes #1292)   


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7644 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 17:45:16 +00:00
ahocevar
3dcc30a24c added new graphicName symbolizer property, which allows to render well-known graphic symbols named "square", "cross", "x" and "triangle", in addition to the existing "circle". Thanks Tim for the tweaks and the example. r=tschaub,elemoine (closes #1398)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7634 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 17:02:10 +00:00
Tim Schaub
9bdd7bc77a Alphabetize test list.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7632 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 16:21:00 +00:00
crschmidt
03c7e5f742 Add simplified chinese translation from avlee. (Closes #1643)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7629 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 15:11:32 +00:00
Tim Schaub
66a4c6fb0e Caching array length instead of accessing it with each iteration. r=crschmidt (closes #1636)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7627 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 04:44:25 +00:00
crschmidt
89b10da8db Fix for WMC does not read/write metadataURLs.
This matches the style of other similar properties in the code, and has a
negligable (<5%) impact on parsing speed in Firefox/Safari. patch from
bartvde, (Closes #1452) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7626 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-31 00:00:27 +00:00
crschmidt
2d1e406e20 add a geometry intersection speed test
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7625 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 23:53:10 +00:00
crschmidt
0372a110f8 make link look clickable
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7624 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 23:08:41 +00:00
crschmidt
504e952081 Adding a WMC speed test
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7623 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 23:08:09 +00:00
euzuro
11f5cdd634 oops. forgot to reenable this test after some debugging. good thing i went tab hunting. (no functional change)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7622 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 22:51:47 +00:00
euzuro
e5c79b378d last bit of tabs. sorry this was so clunky, in the middle of another patch. (no functional change)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7621 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 22:49:21 +00:00
euzuro
3a5a649984 yet more tabs. no functional changes
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7620 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 22:47:00 +00:00
euzuro
c0d29035f4 more tabs. ech. (no functional changes)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7619 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 22:41:21 +00:00
euzuro
c3798b198c tab. (no functional difference)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7618 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 22:37:47 +00:00
euzuro
d28f7450b4 tabbing, semicolon
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7617 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 22:35:42 +00:00
Tim Schaub
6897c8ed4d Adding a beforefeatureselected event to the vector layer events. If a listener returns false, the feature is not selected. The modify feature control now listens for beforefeatureselected and triggers beforefeaturemodified. If a listener returns false, feature modification never begins. r=elemione,ahocevar (closes #1427)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7616 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 22:03:40 +00:00
crschmidt
61c528f3af Change getMousePosition to only be called automatically *if* the 'includeXY'
flag on the Events object is set to true. This ends up meaning that we save a
lot of unneccesary getMousePosition calls because (for example) the layer
doesn't need to include the .xy property. In addition, we add in speed
improvements via caching to the getMousePosition, courtesy the work from
pgiraud (which was worked on further by tcoulter) -- this results in
significantly improved getMousePosition performance improvements in 'real life'
situations that are more like the cases that people use OpenLayers, with a
higher number of containing divs (and also clearly demonstrate a gain in
performance even in the simple case.)

The end result is: 
 * In typical map movement over the map, (n / n+1) fewer calls to
   getMousePosition, where n is the number of active layers when dragging over
   the map.
 * In the simple case, 40% faster getMousePosition performance -- and in 
   more complex cases, significantly more performance improvements.

To drop the former improvement, which may affect some applications (as
described in the includeXY documentation) simply set:

  OpenLayers.Events.prototype.includeXY = true;

This will restore the 'every element has an xy property always' behavior
that was the case beore this patch. 

r=me,tschaub, work by pgiraud related to (See #1509), and (Closes #1459)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7615 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 21:23:19 +00:00
Éric Lemoine
c2c23cb3f3 modify feature control must use silent:true when removing/destroying vertices, p=me, r=crschmidt (closes #1562)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7614 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 20:26:13 +00:00
euzuro
eb417ff61c adding types to properties from the mousing improvements patch. No functional change, only documentation. (See #1509)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7612 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 18:40:23 +00:00
euzuro
5ac8bd6a89 fix broken register() on events r=tschaub (Closes #1502)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7610 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 17:10:04 +00:00
Tim Schaub
36d5f49f0d The Request functions now consider a request with null status as a sucessful request. This is relevant for the file 'protocol' where xhr status is never set. r=crschmidt (closes #1638)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7609 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 16:33:03 +00:00
crschmidt
bc06972aea patch for improved mousedragging. We were able to test this on my eeepc
and get a very obvious speedup in performance. This adds a configurable
'interval' to the dragpan control (and an interval to the 'drag' control,
defaulting to 0px). Patch put together by tcoulter. (Closes #1509) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7608 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 16:27:48 +00:00
crschmidt
7d3d615172 Fix for Inline KML styles extracted even though extractStyles is false,
from Edgemaster. r=me, tests=me, (Closes #1576)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7607 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 14:53:24 +00:00
pgiraud
b5c10debb1 Modified example short desc.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7606 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 13:18:29 +00:00
crschmidt
0185df1548 create an OSM based Sundials example
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7605 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 12:58:21 +00:00
Tim Schaub
9d72a9bdce more less troublesome ie naming
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7604 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 04:10:50 +00:00
Tim Schaub
15a787c5ba test name for ie better
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7603 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 04:08:19 +00:00
crschmidt
0eae149071 Commit Dutch translation, from Bart (thx) (Closes #1425)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7602 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 03:45:31 +00:00
Tim Schaub
309877a48c Adding a featureadded event to the draw feature control event types. First tests ever for the draw feature control. Thanks sbenthall for the patch. r=me (closes #1508)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7601 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 03:41:22 +00:00
euzuro
b837fea7a2 small test fix to properly display message
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7600 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 02:28:25 +00:00
crschmidt
2d301f456b "use different server when IMAGE_RELOAD_ATTEMPTS > 1 && layer.url is an array".
Patch from brentp. (Closes #1291)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7599 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 02:02:36 +00:00
ahocevar
d41b6afec4 set center and baselayer in test_box, so we have the correct environment to do the actual test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7598 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 01:19:21 +00:00
crschmidt
8c59d55658 Redraw control.panel when toggle controls are activated. Patch by
sbenthall (yay), r=me, (Closes #895) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7597 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 00:40:32 +00:00
euzuro
0b58117c06 zoomToMaxExtent() and getMaxExtent() should be smarter if a 'restrictedExtent' property is set on the map. (Closes #1134)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7596 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 00:36:26 +00:00
Tim Schaub
27ce7fe099 Removing phantom array.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7595 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 00:35:13 +00:00
euzuro
94c264da1d make the zIndex of the map div 0 (unless otherwise specified by user). this fixes zindexing issues in FF3. (Closes #1635)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7594 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-30 00:15:34 +00:00
crschmidt
7736e12d33 Support for moving vector features a given number of pixels, or to a given lon/lat, using a move() method. Patch from sbenthall. (Closes #1326)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7593 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-29 23:30:32 +00:00
crschmidt
2ed6483121 Add mapguide docs metadata
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7592 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-29 23:28:31 +00:00
crschmidt
4fe8f349e5 Add Edgemaster to the doc/authors.txt file (Sorry!)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7591 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-29 21:02:39 +00:00
crschmidt
54482a0a2e Add GPX-parsing format, courtesy Edgemaster. (Closes #1272)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7590 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-29 21:00:02 +00:00
Tim Schaub
a88ad8dc50 Adding a box property to the SelectFeature control for selecting all features within a box. p=pgiraud, r=me,crschmidt (closes #1071)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7589 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-29 18:20:19 +00:00
Éric Lemoine
6c07bc7ff1 new RegularPolygon features can be invisible, p=me, r=crschmidt (closes #1577)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7588 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-29 18:13:08 +00:00
ahocevar
cab3f90411 sorry, had committed wrong versions of SVG.js and VML.js. Fixed now.(references #1157)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7587 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-29 15:25:56 +00:00
ahocevar
a0b8a41d5d made coordsize positive for vector renderers; seems to fixe some strange behavior in the vml renderer, and brings a performance gain by using this.size instead of calculating the size from extent and resolution every time. r=euzuro (closes #1157)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7586 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-29 15:12:48 +00:00
euzuro
6f2818252c reverting accidental commit from r7584
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7585 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-29 14:57:01 +00:00
euzuro
2fb730674a patch to make sure main openlayers map div has neither padding nor margin. done via css thanks to tim's fabulous new class manip patch. r=cr5 (Closes #1179)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7584 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-29 14:52:48 +00:00
Tim Schaub
357d65955a Adding functions to manage dom element class names. Use OpenLayers.Element.hasClass, addClass, removeClass, toggleClass for css class name management. r=pagameba,me (closes #1607)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7579 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-28 21:16:39 +00:00
crschmidt
3ba5bb22f2 Confirmed with Tim Coulter that forcing the reflow here leads to a cleaner
refresh on FF2-based browsers. FF3 seems unaffected either way, as does Safari.

(Closes #1390)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7578 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-28 21:10:57 +00:00
crschmidt
5e8b9284a5 MultiMap's API seems to have all-but-disappeared from where we were using it
in the past; the only reference I can find is a' call us and get a quote' 
number. For now, just removing the tests from run-tests until we figure out
what to do.  


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7577 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-28 20:47:08 +00:00
euzuro
300697db04 Fixes the issue where a container div around the map is setting the text-align to something other than 'left'. for openlayers to work, the text-align for the viewport *must* be set to 'left', so we specify that in the default style.css. (Closes #1116)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7576 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-28 20:40:28 +00:00
ahocevar
a885313336 don't set the cursor to "inherit" in the VML renderer. r=pgiraud (closes #1624)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7554 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-21 14:37:44 +00:00
pgiraud
7c23659f24 handlers test are not reflecting the reality, we now simulate a click, move then click \n
that way geometry bounds are cleared, and the tests don't fail in IE6 anymore (See #1602), r=ahocevar,crschmidt (Closes #1623)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7552 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-21 13:57:07 +00:00
ahocevar
da1490dbe6 "Vector features won't draw in IE if features are very far outside the visible extent". r=elemoine (closes #1602)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7546 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-18 12:24:46 +00:00
pgiraud
eac4ff0c84 we forgot to take Geometry.Collection into account when erasing geometries, r=elemoine (Closes #1621)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7542 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-18 07:18:27 +00:00
Éric Lemoine
67a97a3f07 ND comment fix, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7540 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-17 19:23:22 +00:00
pgiraud
79552513ea the number of tests were wrong while launched in IE6, r=tschaub (Closes #1520)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7538 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-17 15:23:51 +00:00
pgiraud
98dc4001f4 removed extra comma (IE complains), no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7536 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-17 14:35:15 +00:00
pgiraud
bcf870a201 add a specific text-align css rule so that we don't have weird behavior of vector features in IE, r=elemoine,pagameba (Closes #1610)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7534 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-17 13:21:51 +00:00
Paul Spencer
eb06b8769b Closes #1617. Update docs to reflect correct property name for marker icon url, (thanks to Thomas Petazzoni for pointing this out). r=pagameba.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7498 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-13 11:54:25 +00:00
Éric Lemoine
896994fb22 fixing tests/Lang.html, p=fvanderbiest, r=me (closes #1601)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7493 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-11 19:32:38 +00:00
pgiraud
cf0f651442 typo, strokeRadius doesn't exist, it's meant to be strokeWidth
no functionnal change

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7487 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-11 11:44:10 +00:00
Tim Schaub
737fd7682a Correcting doc bug for elements renderer. Thanks zarn.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7478 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-08 14:58:43 +00:00
crschmidt
bd2de628d3 not sure if this is right, but adding in a link to the metadata about
each entry. This seems to fix the issue reported earlier, that the links
in the example list are broken.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7477 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-08 12:47:30 +00:00
Tim Schaub
49084f8045 Adding Traditional Chinese dictionary from Jian Ding Chen (timchen119). r=me (closes #1609)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7475 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-07 22:29:30 +00:00
Tim Schaub
ad5b0ef0a4 Build configurations with include sections don't need exclude sections.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7474 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-07 22:23:32 +00:00
Tim Schaub
746892e9d9 Looking a little harder for ElementTree.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7473 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-07 20:39:37 +00:00
Tim Schaub
d30cad92dc Adding a few example descriptions, removing a redundant example.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7472 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-07 16:49:17 +00:00
Tim Schaub
44613c8c49 Unused function.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7471 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-07 14:34:07 +00:00
Tim Schaub
514e4f8fa1 Adding title, id, updated, and author elements for valid atom.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7470 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-07 14:32:55 +00:00
Tim Schaub
c240ddc1b3 No additional markup in title or shortdesc please.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7469 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-07 13:44:56 +00:00
Éric Lemoine
5e36c6e107 getChildValue() on GeoRSS format is slow, p=edgemaster, r=me,crschmidt (closes #1600)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7468 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-07 07:02:27 +00:00
Tim Schaub
0d2b2dd893 Googlebot doesn't seem to like these relative urls.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7463 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-07-03 20:48:46 +00:00
Tim Schaub
8329df7c46 French dictionary entries from François Van Der Biest. Thanks for the contribution. r=me (closes #1601)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7460 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-27 16:08:33 +00:00
crschmidt
7af0cd563e getFullRequestString is used for getfeatureinfo a lot. Make it an API function.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7459 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-27 14:46:53 +00:00
crschmidt
70276af0d1 mini dotfile generator. Not pretty, but sort of works.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7458 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-27 05:19:48 +00:00
crschmidt
656da076a1 Add OpenAerialMap TMS usage example to spherical mercator layer, since it's
been requested three times today from different places (!)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7457 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-26 19:58:34 +00:00
ahocevar
8df1e4074a made example work in IE
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7456 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-26 19:34:52 +00:00
Tim Schaub
2d86212155 Patching Test.AnotherWay to use importNode in html_eq. r=crschmidt (closes #1376)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7452 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-25 20:40:44 +00:00
Tim Schaub
8773d98834 Adding OL.String.isNumeric method to test for numeric strings. r=crschmidt (closes #1441)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7451 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-25 20:37:29 +00:00
crschmidt
351b3b756b Minor doc update to clarify that mergeNewParams handles reloading the tiles.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7450 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-25 14:14:55 +00:00
ahocevar
23aeac7697 modified georss-flickr example to make use of Layer.GML with format option instead of adding the features manually after parsing them using Format.GeoRSS.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7448 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-25 08:32:19 +00:00
Tim Schaub
2fdee6eabd Adding an example of StyleMap use.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7447 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-24 19:13:47 +00:00
Tim Schaub
2ce26c4251 excuse the typo
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7435 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-23 18:31:07 +00:00
Tim Schaub
f7a798d810 Looks like google doesn't like the relative link with a nested sitemap.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7434 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-23 18:29:42 +00:00
Frédéric Junod
f8bf59445c Use css sprites technique to simplify the NavigationHistory controls. r=tschaub. (Closes #1555)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7422 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-23 06:56:58 +00:00
crschmidt
8f778d8a0c minor doc changes to describe that format conflicts with
featureClass/vectorMode:false.  


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7417 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-21 14:37:14 +00:00
crschmidt
b8d81e7917 Expand on a patch by Edgemaster to support non-XML vector formats via the
current XML layer. This patch rearranges the reading of the document from XML
so that it is done later on, building on the work in #1575. It also adds tests
for the two cases that aren't currently tested: 

 * Vector Mode with non-XML format
 * non-vectormode with XML DOM passed in

Tests continue to pass, confirmed via manual inspection as well as the tests.

(Closes #1575) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7416 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-21 14:23:33 +00:00
crschmidt
45b87bc02d SRS sent with WFS requests should match projection of requested extents.
(Closes #1537)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7415 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-21 13:27:16 +00:00
crschmidt
2d66f80b16 Previous commit was courtesy Paul Smith; adding to authors.txt.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7414 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-21 13:09:56 +00:00
crschmidt
e4ada9ea2f WKT Format reprojects geometrycollection components twice. Fixed by anonymous
contributor. (Closes #1554) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7413 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-21 13:09:23 +00:00
Tim Schaub
96aa44f516 Adding dictionary for norwegian bokmål. Thanks for the contribution bobkare. r=me (closes #1598)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7398 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-20 17:18:06 +00:00
Tim Schaub
868b6055b3 Invoking the trivial change clause, removing an extra word from the getLayerWarning in the English dictionary. Thanks bobkare for the catch.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7397 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-20 16:59:28 +00:00
crschmidt
6135c8daab several minor coding standards changes. no functional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7396 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-20 11:56:17 +00:00
ahocevar
6d37e8bdf0 change the default cursor for vector features from "" to "inherit" because FF3 complains about "". r=pgiraud (closes #1595)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7395 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-20 09:22:39 +00:00
crschmidt
1827ace4cd "GeoRSS layer triggers loadstart event twice", from Bart. Includes tests.
(Closes #1580)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7387 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-19 22:08:10 +00:00
crschmidt
c2b892acb9 Committed in wrong directory; this was meant to go to the sandbox. Reverting with
'svn merge -r 7381:7380 .'


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7382 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-19 18:45:22 +00:00
crschmidt
b78e26e9f0 break out post-rendering into seperate function to be defined in page. This
removes the tie between the LayerSwitcher and Ext that I had in my first
commit. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7381 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-19 18:44:25 +00:00
ahocevar
9724b0a214 "Draw bug in OpenLayers.Handler.Box with firefox". Now always set style.left and style.top, so lost events won't result in an incorrect box any more. r=me (closes #1579)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7375 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-18 09:33:55 +00:00
pgiraud
4340867918 add a map getUnits method, r=ahocevar (Closes 1591)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7374 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-18 08:57:02 +00:00
Tim Schaub
5f42b862ba WFS layer requires WFS tile.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7362 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-16 21:04:43 +00:00
Tim Schaub
569397a063 comment change only - since this breaks our doc building, removing the suggestion
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7353 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-12 19:06:39 +00:00
Tim Schaub
830f1e0cf7 ajax requires xhr
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7346 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-10 23:33:50 +00:00
Tim Schaub
a98aacedd2 Adding px units where appropriate in style properties. Thanks Wally Atkins for the original patch. r=me (closes #1582)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7341 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-10 20:39:03 +00:00
Tim Schaub
25af1e45cc Including the change in tests that satisfied IE. (see #1565)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7340 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-10 20:25:08 +00:00
Tim Schaub
8a7522fe68 For now, we will point the requires directive at the XMLHttpRequest.js script. (closes #1581)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7339 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-10 15:52:56 +00:00
Tim Schaub
480bc04cf8 excluding dictionaries from builds
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7338 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-10 15:39:23 +00:00
Éric Lemoine
507183aa87 add missing @require's
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7337 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-10 13:37:08 +00:00
Éric Lemoine
558866d190 there are missing @requires for the new XHR, patch from pgiraud, r=me (closes #1581)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7336 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-10 13:00:49 +00:00
Tim Schaub
3c70e78e47 Adding cross-browser XMLHttpRequest functionality and convenience methods around it in the OpenLayers.Request namespace. Deprecating OpenLayers.Ajax.Request. Full support sync/async requests using all HTTP verbs now. r=elemoine (closes #1565)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7335 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-09 19:51:38 +00:00
Tim Schaub
c3ca41b3be The text format conditionally sets values for feature.style.graphicXOffset and graphicYOffset. If these are not defined in parsing, we confirm that using the non-identity operator with undefined. Later, it might make sense to confirm these values are actually numeric (see #1441). This keeps an icon.offset from inadvertently getting created with NaN values later on. r=elemoine (closes #1571)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7334 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-09 19:11:03 +00:00
Tim Schaub
de6ce111c9 Adding support for TextSymbolizer writing in the SLD format. Thanks to Bart for the original patch. This provides basic expression handling for text labels. Read support later. r=ahocevar (closes #1542)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7333 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-09 17:18:35 +00:00
Tim Schaub
bed7f208ab Fixing Util.getRenderedDimensions so it assigns units to positional values. Thanks Wally for the report. r=euzuro (closes #1570)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7329 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-07 15:17:10 +00:00
ahocevar
aa486090f1 Implemented rotation of externalGraphic vector point features. r=tschaub (closes #1433)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7324 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-06 18:42:44 +00:00
Tim Schaub
6670fb6cfd Adding Italian dictionary. r=me (closes #1573)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7322 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-06 16:11:10 +00:00
Tim Schaub
8f593e332c adding quotes for clarity in failure messages
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7321 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-06 07:09:55 +00:00
Tim Schaub
ae52f20fc9 Adding Brazilian Portuguese dictionary from Pedro Simonetti. r=pspencer,me (closes #1519)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7312 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-05 20:48:04 +00:00
Tim Schaub
74f4338fe0 Adding a bit of flexibility to extend and applyDefaults. First argument can now be undefined. r=pspencer,elemoine (closes #1564)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7311 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-05 20:37:40 +00:00
Tim Schaub
0ecb973e1c making the map big enough for the layer switcher
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7309 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-05 15:48:24 +00:00
Tim Schaub
c10347fa87 correcting the test count and not running the test for inline-block where alpha hack doesn't apply (closes #1520)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7308 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-06-05 15:45:03 +00:00
crschmidt
66a19c70ef Fix for GMaps layers to display in correct position when they were originally
loaded as the not default layer, or the map is resized while the gmaps layer is
hidden. Patch put together by Edgemaster (thanks), (Closes #830)  


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7300 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-31 17:19:48 +00:00
crschmidt
57237e8a58 Fix for "Util.modifyAlphaImageDiv makes hidden elements reappear in IE6.".
Patch by jwpage. (Closes #1520) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7299 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-31 17:11:24 +00:00
crschmidt
87f26c231e Use the maxExtent of the layer in Grid layers instead of the maxExtent of the
map (since the two can differ). Patch from kleptog. (Closes #1552)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7298 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-31 16:56:41 +00:00
Tim Schaub
dd4f923c8d adding Swedish dictionary from nilsw. (closes #1523)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7296 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-31 00:10:22 +00:00
Schuyler Erle
cd5c316eba Permalink requires ArgParser. Arg!
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7290 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-30 09:16:39 +00:00
Éric Lemoine
7699922bc2 add featureremoved-type events to Layer.Vector, r=fredj (closes #1535)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7277 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-27 07:56:29 +00:00
Éric Lemoine
6553f9895a Layer.Vector should destroy itself before its parent, r=fredj (closes #1536)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7276 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-27 07:53:48 +00:00
Éric Lemoine
7f8c5d0c13 geometry-less vector features aren't cloneable, r=pspencer (closes #1557)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7252 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-22 13:42:23 +00:00
euzuro
069a72b5e7 add feature to markers layer, not to image layer. thanks to stephen w. for spotting this.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7236 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-21 13:23:30 +00:00
Frédéric Junod
d40f372742 Simplify olControlEditingToolbar styles by regrouping common attributes, r=crschmidt (closes #1388)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7228 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-20 14:07:01 +00:00
pgiraud
815e55888a context can now be given as argument in StyleMap.addUniqueValueRules()
this, for example, allows user to access to properties that are not part of the feature attributes.
r=elemoine (closes #1548)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7216 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-19 13:34:35 +00:00
Éric Lemoine
34ff282397 ND changes in the modify feature control. Thanks ahocevar for catching the erroneous comment in handleKeypress. No fonctional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7213 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-17 20:11:45 +00:00
crschmidt
0978e6cfa7 Fix mistake in documentation: idx -> delta. Reported by aboudreault on IRC,
no functional change.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7190 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-15 14:14:32 +00:00
pgiraud
078deb2ffe exit the panTo method if the new center is the same as the current one, r=crschmidt (closes #1507)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7174 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-14 08:11:01 +00:00
pgiraud
5e3afa79f5 doc typo, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7173 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-14 06:45:44 +00:00
Tim Schaub
6474539aad moving css for save img to default style.css
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7164 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-13 21:40:14 +00:00
Éric Lemoine
e02e7504c5 MousePosition: numDigits inconsistency, reported by kthy, patch by kthy, additional test by me, r=me (closes #1544)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7163 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-13 20:52:01 +00:00
Éric Lemoine
bc56ec9afa fix typo in modify feature test name (non-functional change)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7162 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-13 20:48:24 +00:00
ahocevar
45485246b8 Divide/multiply PointSymbolizer's Size by 2 on read/write to match OpenLayers symbolizer's pointRadius. r=elemoine (closes #1545)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7160 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-13 20:26:14 +00:00
Éric Lemoine
35743801dc for some reason, the html document was included twice
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7159 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-13 19:51:58 +00:00
crschmidt
7934ebd82a Add note for users accidentally viewing source in the frame to tell them "go
read the source to the example, *not* this source." 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7154 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-13 18:56:25 +00:00
pgiraud
c5c4f26b92 doc typo, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7148 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-13 11:30:42 +00:00
Frédéric Junod
8572cdadf3 Fix typo in shortdesc
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7145 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-13 06:28:55 +00:00
crschmidt
b1a2122619 Minor fixes to marker documentation. r=me, (Closes #1532)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7138 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-11 18:36:21 +00:00
Tim Schaub
8cf0266a1f no post on other proxy, I give up
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7137 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-10 05:43:28 +00:00
Tim Schaub
92c224f1fa and a couple new images
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7136 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-10 05:35:10 +00:00
Tim Schaub
1aab3aa3d2 a bit of style and the more generous proxy
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7135 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-10 05:20:59 +00:00
crschmidt
181efd8ed4 allow for use of sigma.openplans.org through proxy
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7134 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-10 02:11:48 +00:00
Tim Schaub
a387cbba51 say it isn't so
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7133 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 23:42:15 +00:00
Tim Schaub
607ff5d0d8 a horrible, yet apparently working, wfs-t example
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7132 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 23:25:46 +00:00
Tim Schaub
78edef0699 desperately outdated
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7131 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 22:12:15 +00:00
crschmidt
0768d5a558 fix proxy URL
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7130 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 21:59:25 +00:00
Tim Schaub
d4e879df1c using remote wfs
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7129 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 21:52:02 +00:00
Tim Schaub
3fdead4fb2 sort examples by modified time and add atom:updated element
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7128 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 20:29:07 +00:00
Tim Schaub
bf06c9b305 the example parser now also kicks out a basic atom feed, example list page links to this feed
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7127 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 19:20:06 +00:00
Tim Schaub
dea578b7fc exclude example-list.html from list of examples - this is getting fragile
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7126 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 17:01:48 +00:00
Tim Schaub
92c092c598 keep filter at top, parse query
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7125 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 15:02:31 +00:00
crschmidt
447eaf2936 add smarter tool for updating the dev dir on OL.org in a better way. Specifically:
* Check whether the reision has changed
 * if it has:
   * rebuild the examples.js
   * Rebuild the singlefile, copy it
   * Change all the examples to use the singlefile
   * Record the most recent rev 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7122 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 03:35:43 +00:00
crschmidt
60d9d17c6a add example
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7121 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 03:31:42 +00:00
crschmidt
440bd042df no longer uses 2.82 (which doesn't work smoothly with 2.6 anyway)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7120 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-09 02:45:42 +00:00
Tim Schaub
9cf5153163 updating example list with new jugl style and giving jugl a license
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7119 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-08 22:10:49 +00:00
Tim Schaub
4b99350be1 exampleparser.py now produces examples/example-list.js which is used by examples/example-list.html
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7111 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-08 17:49:03 +00:00
Tim Schaub
0340bf0a4e small map big bar
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7100 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-08 09:29:13 +00:00
Tim Schaub
c4ed9a708b since the examples.html is broken with the new examples.js structure and I don't know when or how often the magic update occurs, I'm creating an examples2.js until I can talk to the magician
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7099 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-08 09:03:43 +00:00
Tim Schaub
c6d8d6d559 sort by words matched then by frequency
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7098 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-08 08:56:38 +00:00
Tim Schaub
8eee248117 create word index from examples and use it to filter example list
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7097 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-08 08:27:54 +00:00
Tim Schaub
c350fd6810 giving examples some style
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7095 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-08 08:15:07 +00:00
Tim Schaub
c36ac497dd doc/examples.html update
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7092 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-07 23:50:26 +00:00
Frédéric Junod
3f63622c36 Change build.sh to build.py in build/README.txt. Reported by jwpage. (Closes #1538)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7065 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-06 05:36:35 +00:00
Éric Lemoine
9190e24bcd Cannot modify a feature (linestring) that have two points at the same position, r=me, thanks pvalsecc for the patch and the detailed justification of this patch. (closes #1533)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7061 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-05 06:55:07 +00:00
Éric Lemoine
8a6d16e0dc zoomend event isn't described in the ND comments (non-functional change)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7060 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-04 11:48:20 +00:00
Éric Lemoine
03e952bed2 add unit tests related to the beforefeatureadded, featureadded, and featuresadded events
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7051 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-05-02 14:50:14 +00:00
Éric Lemoine
ce76180dae better ND comments, related to #1419 which I'm going to close
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7039 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-30 19:02:36 +00:00
ahocevar
5da18353c6 More detailled comment for Rule.symbolizer. Non-functional change (references #1526)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7024 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-28 20:48:35 +00:00
ahocevar
0af3b4ef1b added an additional test to show that the example given by tschaub for #1526 works without modifications (references #1526)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7023 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-28 19:01:10 +00:00
crschmidt
7a61e3c7e5 add dependancies to SLD format. (Closes #1530)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7022 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-28 12:56:55 +00:00
crschmidt
89231f1691 Layer.GeoRSS should store the title and description attributes on the
created OpenLayers.Feature object for later access by applications. 
Patch, including tests, written by Ian Mayo, r=me. (Closes #1485)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7015 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-27 05:14:50 +00:00
crschmidt
dd92f8c730 Map depends on tweening.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7014 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-27 04:46:00 +00:00
crschmidt
52ae402ebf Fix commas in Click example thanks to helpful patch from Pedro Simonetti.
(Closes #1525)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6997 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-23 03:27:00 +00:00
crschmidt
cb3897948a Add vector layer to attribution example, to demonstrate explicitly that
sometimes the 'options' hash for a layer is only the second arg, instead
of the third or fourth.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6987 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-21 17:19:31 +00:00
crschmidt
3553e2a41e Fix to docs (no functional change)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6980 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-20 12:41:49 +00:00
crschmidt
ecd291cb01 Add getDataExtent to Vector Layer. Patch from rupert, tests by me, r=me
(Closes #1369)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6947 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-16 01:56:21 +00:00
crschmidt
029e76d965 Fix to Layer.Text to allow iconOffset of 0,0 from Edgemaster, r=me (Closes
#1467)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6946 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-16 01:30:40 +00:00
Frédéric Junod
7598e0de43 Fix the 'relativePosition' values enumeration. Docs only. (Closes #1510)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6911 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-15 06:49:12 +00:00
Tim Schaub
5e634d27e1 Another doc tweak.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6901 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-14 21:28:52 +00:00
Tim Schaub
ff63bc1460 Doc typo.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6900 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-14 21:26:02 +00:00
Tim Schaub
b8478b0ef3 SLD requires rule and filters. This could be made a requirement for OpenLayers.Style, but I'll put it here for now. (see #1514)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6895 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-14 17:35:30 +00:00
Tim Schaub
bed262fec4 Modifying the addUniqueValueRules method to use filter subclass. r=crschmidt (closes #1492)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6834 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-09 17:10:45 +00:00
Tim Schaub
209f8f68f8 Fixing links in documentation. Other Natural Docs changes. (closes #1504)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6833 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-09 16:52:08 +00:00
crschmidt
ffab22ba19 2.6 introduced a regression that maps could not be created when the Object
prototype is extended. Although OpenLayers is not designed to work when this
fundamental violation of Javascript is in place, we can at least not fail
so miserably in this case: this gets us back to a similar level of 
functionality as we had in 2.5. This was brought up by a user working on 
a viamichelin layer, which apparently extends the object prototype (bad!),
and fixed in conjuction with tschaub. r=pgiraud,tschaub (Pullup #1502)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6832 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-09 16:06:23 +00:00
Tim Schaub
cadc54cc4e Fixing panning for odd-sized viewports (broken in r6492). This makes map.getViewPortPxFromLonLat return fractional pixel values. To get integer pixel values, use map.getPixelFromLonLat. A better solution may be possible in the future. r=crschmidt (closes #1503)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6831 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-09 15:54:01 +00:00
Tim Schaub
d2079fb927 Updating layer opacity example with url for USGS wmsconnector.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6830 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-09 13:57:48 +00:00
Tim Schaub
67b796d88b Dividing base types into namespaces (docs only). (see #1504)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6829 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-09 12:33:26 +00:00
crschmidt
ac181918a2 these should not be API properties. The only API Propety should be
getLonLatFromPixel: these are internal methods, nto designed to be used
by users.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6828 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-09 10:58:22 +00:00
ahocevar
ada641d866 Changed StyleMap constructor so that all render intents will be set if only one Style object or symbolizer hash is passed. This is the first patch attached to #1498, which got slightly more votes thaan the second one. r=crschmidt,tschaub (pullup #1498)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6827 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-09 09:12:09 +00:00
crschmidt
830b640d4a Add xml_eq to auto tester
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6826 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-09 02:18:47 +00:00
Tim Schaub
a56e11c1ed Opera doesn't need the sniffing, so neither do I. (see #1501)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6824 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-08 05:11:10 +00:00
Tim Schaub
cc100ad6ea Taking advantage of the xml_eq test method. (closes #1501)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6823 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-08 05:04:30 +00:00
Tim Schaub
4b88c16e10 Correcting dependencies for the SLD format. (see #1492)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6822 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-08 04:37:36 +00:00
Tim Schaub
2db5c4ea83 Removing the Rule directory. (see #1492)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6821 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-08 04:34:35 +00:00
Paul Spencer
dc69fc5360 Closes #1490. Add comment to make it clear that callers of createPopup must not call destroy on returned popups but rather use the feature.destroyPopup method.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6820 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-08 02:04:28 +00:00
Tim Schaub
1091e34c0b With dramatic flourish, I'm modifying 21 files with 1033 insertions and 815 deletions between release candidates. This moves all rule subclasses to a more natural home as filter subclasses. Also adds tests for SLD write and corrects a handful of issues there. Apologies to all who lose sleep over this sort of thing. r=ahocevar,crschmidt (closes #1492)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6818 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-08 00:13:45 +00:00
Paul Spencer
d7bbcab4df spelling mistake in comment.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6810 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-07 18:38:13 +00:00
ahocevar
7251cb438f fixed typo: replaced styleVirtual with virtualStyle, so it matches the API property. r=crschmidt (pullup #1495)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6802 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-07 08:07:25 +00:00
crschmidt
53fb443819 Replace the regular expression used in Format.JSON with one which is longer,
but apparently more friendly to braindead browsers. This allows Safari 3.1
to parse long JSON strings  (>26k), which was not possible with the previous
regex. r=euzuro (Pullup #1493)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6801 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-07 04:22:35 +00:00
euzuro
e84f3d6181 fix issue where we try to createblocks without a proper this.relativePosition. Robustness++. (Pullup #1479)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6800 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-07 04:09:46 +00:00
crschmidt
1b269f06f8 2.6 accidentally broke behavior when clicking on the panzoombar. Thanks to Linda Rawson's report of this issue, this is now fixed, by moving the Math.floor call to a different part of the code. r=euzuro (Pullup #1486)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6799 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-07 04:08:33 +00:00
ahocevar
07b72def92 removing duplicated html
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6797 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-06 17:07:03 +00:00
crschmidt
797c57586a The FramedCloud popup throws an error if you attempt to call setContentHTML
before you add the popup to the map. To prevent this, don't call construct
or updateBlocks if relativePosition is null, to prevent this error message.
r=elemoine, (Pullup #1479)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6765 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-02 14:08:01 +00:00
ahocevar
f95f280dc7 changed vml namespace prefix from "v" to "olv" to avoid conflicts with other libraries that use vml. r=pgiraud,crschmidt. (Pullup #1477)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6764 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-02 13:03:23 +00:00
Éric Lemoine
72be27ac1b FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative prototype
object" when calling hawOwnProperty if the source object is an instance of
window.Event. r=crschmidt (closes #1480) (Pullup #1480)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6763 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-02 11:53:20 +00:00
crschmidt
67aca311a9 need to check if we have a center set or permalink won't work.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6754 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-01 13:27:29 +00:00
ahocevar
d94e408084 now also committed the removal of the imageSrc property definition in Popup.FramedCloud. avlee's original patch is perfectly sane. Sorry for the confusion. Thanks elemoine for the hint. (references #1475)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6751 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-01 07:18:26 +00:00
ahocevar
5fbfb504f4 Set the imageSrc bevore the super class is initialized in Popup.FramedCloud. Thanks avlee. r=elemeoine,me (closes #1475)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6750 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2008-04-01 07:08:07 +00:00
401 changed files with 22901 additions and 4378 deletions

View File

@@ -69,7 +69,7 @@ Group: OpenLayers {
File: Control (no auto-title, OpenLayers/Control.js)
File: ArgParser (no auto-title, OpenLayers/Control/ArgParser.js)
File: Attribution (no auto-title, OpenLayers/Control/Attribution.js)
File: Control.Button (no auto-title, OpenLayers/Control/Button.js)
File: Button (no auto-title, OpenLayers/Control/Button.js)
File: DragFeature (no auto-title, OpenLayers/Control/DragFeature.js)
File: DragPan (no auto-title, OpenLayers/Control/DragPan.js)
File: DrawFeature (no auto-title, OpenLayers/Control/DrawFeature.js)
@@ -104,6 +104,14 @@ Group: OpenLayers {
File: WFS (no auto-title, OpenLayers/Feature/WFS.js)
} # Group: Feature
Group: Filter {
File: Filter (no auto-title, OpenLayers/Filter.js)
File: Comparison (no auto-title, OpenLayers/Filter/Comparison.js)
File: FeatureId (no auto-title, OpenLayers/Filter/FeatureId.js)
File: Logical (no auto-title, OpenLayers/Filter/Logical.js)
} # Group: Filter
Group: Format {
File: Format (no auto-title, OpenLayers/Format.js)
@@ -113,10 +121,18 @@ Group: OpenLayers {
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)
Group: SLD {
File: SLD (no auto-title, OpenLayers/Format/SLD.js)
File: v1 (no auto-title, OpenLayers/Format/SLD/v1.js)
File: v1_0_0 (no auto-title, OpenLayers/Format/SLD/v1_0_0.js)
} # Group: SLD
File: Text (no auto-title, OpenLayers/Format/Text.js)
File: WFS (no auto-title, OpenLayers/Format/WFS.js)
File: WKT (no auto-title, OpenLayers/Format/WKT.js)
File: XML (no auto-title, OpenLayers/Format/XML.js)
Group: WMC {
@@ -126,7 +142,6 @@ Group: OpenLayers {
File: v1_1_0 (no auto-title, OpenLayers/Format/WMC/v1_1_0.js)
} # Group: WMC
File: XML (no auto-title, OpenLayers/Format/XML.js)
} # Group: Format
Group: Geometry {
@@ -142,7 +157,6 @@ Group: OpenLayers {
File: Point (no auto-title, OpenLayers/Geometry/Point.js)
File: Polygon (no auto-title, OpenLayers/Geometry/Polygon.js)
File: Rectangle (no auto-title, OpenLayers/Geometry/Rectangle.js)
File: Surface (no auto-title, OpenLayers/Geometry/Surface.js)
} # Group: Geometry
Group: Handler {
@@ -166,6 +180,7 @@ Group: OpenLayers {
Group: Lang {
File: Lang (no auto-title, OpenLayers/Lang.js)
File: Lang["cs-CZ"] (OpenLayers/Lang/cs-CZ.js)
File: Lang["de"] (no auto-title, OpenLayers/Lang/de.js)
File: Lang["en"] (no auto-title, OpenLayers/Lang/en.js)
File: Lang["en-CA"] (no auto-title, OpenLayers/Lang/en-CA.js)
@@ -217,6 +232,8 @@ Group: OpenLayers {
File: Popup (no auto-title, OpenLayers/Popup.js)
File: Anchored (no auto-title, OpenLayers/Popup/Anchored.js)
File: AnchoredBubble (no auto-title, OpenLayers/Popup/AnchoredBubble.js)
File: Framed (OpenLayers/Popup/Framed.js)
File: FramedCloud (OpenLayers/Popup/FramedCloud.js)
} # Group: Popup
File: Projection (no auto-title, OpenLayers/Projection.js)
@@ -229,14 +246,7 @@ Group: OpenLayers {
File: VML (no auto-title, OpenLayers/Renderer/VML.js)
} # Group: Renderer
Group: Rule {
File: Rule (no auto-title, OpenLayers/Rule.js)
File: Comparison (no auto-title, OpenLayers/Rule/Comparison.js)
File: FeatureId (no auto-title, OpenLayers/Rule/FeatureId.js)
File: Logical (no auto-title, OpenLayers/Rule/Logical.js)
} # Group: Rule
File: Style (no auto-title, OpenLayers/Style.js)
File: StyleMap (no auto-title, OpenLayers/StyleMap.js)

View File

@@ -4,7 +4,7 @@
* Build:
cd build
./build.sh
./build.py
cd ..
* Upload the result to the server: e.g.

View File

@@ -13,7 +13,14 @@ Rico/Corner.js
[exclude]
Firebug/firebug.js
Firebug/firebugx.js
OpenLayers/Lang/cs-CZ.js
OpenLayers/Lang/de.js
OpenLayers/Lang/en-CA.js
OpenLayers/Lang/fr.js
OpenLayers/Lang/cs-CZ.js
OpenLayers/Lang/it.js
OpenLayers/Lang/nb.js
OpenLayers/Lang/nl.js
OpenLayers/Lang/pt-BR.js
OpenLayers/Lang/sv-SE.js
OpenLayers/Lang/zh-TW.js
OpenLayers/Lang/zh-CN.js

View File

@@ -46,9 +46,16 @@ OpenLayers/Renderer/Elements.js
OpenLayers/Renderer/SVG.js
OpenLayers/Renderer/VML.js
OpenLayers/Renderer.js
OpenLayers/Lang/cs-CZ.js
OpenLayers/Lang/de.js
OpenLayers/Lang/en-CA.js
OpenLayers/Lang/fr.js
OpenLayers/Lang/cs-CZ.js
OpenLayers/Lang/it.js
OpenLayers/Lang/nb.js
OpenLayers/Lang/nl.js
OpenLayers/Lang/pt-BR.js
OpenLayers/Lang/sv-SE.js
OpenLayers/Lang/zh-TW.js
OpenLayers/Lang/zh-CN.js

View File

@@ -43,3 +43,50 @@
*
**/
/**
* Contains XMLHttpRequest.js <http://code.google.com/p/xmlhttprequest/>
* Copyright 2007 Sergey Ilinsky (http://www.ilinsky.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*/
/**
* Contains portions of Gears <http://code.google.com/apis/gears/>
*
* Copyright 2007, Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of Google Inc. nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Sets up google.gears.*, which is *the only* supported way to access Gears.
*
* Circumvent this file at your own risk!
*
* In the future, Gears may automatically define google.gears.* without this
* file. Gears may use these objects to transparently fix bugs and compatibility
* issues. Applications that use the code below will continue to work seamlessly
* when that happens.
*/

View File

@@ -19,10 +19,5 @@ OpenLayers/Tile.js
OpenLayers/Tile/Image.js
[exclude]
Firebug/firebug.js
Firebug/firebugx.js
OpenLayers/Lang/de.js
OpenLayers/Lang/en-CA.js
OpenLayers/Lang/fr.js
OpenLayers/Lang/cs-CZ.js

View File

@@ -1,74 +0,0 @@
/**
* Jugl.js -- JavaScript Template Attribute Language
* This code is not yet licensed for release or distribution.
*
* Copyright 2007 Tim Schaub
*/
/**
* Contains portions of OpenLayers.js -- OpenLayers Map Viewer Library
*
* Copyright 2005-2006 MetaCarta, Inc., released under a modified BSD license.
* Please see http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* for the full text of the license.
*/
/**
* Contains portions of Prototype.js:
*
* Prototype JavaScript framework, version 1.4.0
* (c) 2005 Sam Stephenson <sam@conio.net>
*
* Prototype is freely distributable under the terms of an MIT-style license.
* For details, see the Prototype web site: http://prototype.conio.net/
*/
(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl={singleFile:true};window[uri]=Jugl;})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var singleFile=(typeof window[uri]=="object"&&window[uri].singleFile);var Jugl={prefix:"jugl",namespaceURI:"http://namespace.jugl.org/",scriptName:(!singleFile)?"lib/Jugl.js":"Jugl.js",getScriptLocation:function(){var scriptLocation="";var scriptName=Jugl.scriptName;var scripts=document.getElementsByTagName('script');for(var i=0;i<scripts.length;i++){var src=scripts[i].getAttribute('src');if(src){var index=src.lastIndexOf(scriptName);if((index>-1)&&(index+scriptName.length==src.length)){scriptLocation=src.slice(0,-scriptName.length);break;}}}
return scriptLocation;}};if(!singleFile){var jsfiles=new Array("Jugl/Util.js","Jugl/Class.js","Jugl/Async.js","Jugl/Node.js","Jugl/Attribute.js","Jugl/Console.js","Jugl/Template.js");var allScriptTags="";var host=Jugl.getScriptLocation()+"lib/";for(var i=0;i<jsfiles.length;i++){if(/MSIE/.test(navigator.userAgent)||/Safari/.test(navigator.userAgent)){var currentScriptTag="<script src='"+host+jsfiles[i]+"'></script>";allScriptTags+=currentScriptTag;}else{var s=document.createElement("script");s.src=host+jsfiles[i];var h=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;h.appendChild(s);}}
if(allScriptTags){document.write(allScriptTags);}}
window[uri]=Jugl;})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Class=function(){var Class=function(){this.initialize.apply(this,arguments);}
var extended={};var parent;for(var i=0;i<arguments.length;++i){if(typeof arguments[i]=="function"){parent=arguments[i].prototype;}else{parent=arguments[i];}
Jugl.Util.extend(extended,parent);}
Class.prototype=extended;return Class;};})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Util=new Object();Jugl.Util.extend=function(destination,source){for(property in source){destination[property]=source[property];}
return destination;};Jugl.Util.indexOf=function(array,obj){for(var i=0;i<array.length;i++){if(array[i]==obj)return i;}
return-1;};Jugl.Util.bind=function(method,object){var args=[];for(var i=2;i<arguments.length;++i){args.push(arguments[i]);}
return function(){for(var i=0;i<arguments.length;++i){args.push(arguments[i]);}
return method.apply(object,args);}};})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){}};(function(){if(window.console){var scripts=document.getElementsByTagName("script");for(var i=0;i<scripts.length;++i){if(scripts[i].src.indexOf("firebug.js")!=-1){Jugl.Util.extend(Jugl.Console,console);break;}}}})();})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Attribute=Jugl.Class({node:null,element:null,type:null,nodeValue:null,template:null,initialize:function(node,element,type){this.node=node;this.element=element;this.type=type;this.nodeValue=element.nodeValue;this.nodeName=element.nodeName;this.template=node.template;},splitAttributeValue:function(value){value=(value!=null)?value:this.nodeValue;var matches=this.template.regExes.trimSpace.exec(value);var items;if(matches.length==3){items=[matches[1],matches[2]];}
return items;},getAttributeValues:function(){var trimmed=this.nodeValue.replace(/[\t\n]/g,"").replace(/;\s*$/,"");var tabbed=trimmed.replace(/;;/g,"\t");var newlined=tabbed.split(";").join("\n");return newlined.replace(/\t/g,";").split(/\n/g);},removeSelf:function(){this.node.removeAttributeNode(this);},process:function(){return this.processAttribute[this.type].apply(this,[]);},evalInScope:function(str){var expression="with(this.node.scope){"+str+"}";return eval(expression);},processAttribute:{"define":function(){var values=this.getAttributeValues();var pair;for(var i=0;i<values.length;++i){pair=this.splitAttributeValue(values[i]);this.node.scope[pair[0]]=this.evalInScope(pair[1]);}
this.removeSelf();return true;},"condition":function(){var proceed;try{proceed=!!(this.evalInScope(this.nodeValue));}catch(err){var message=err.name+": "+err.message+"\n";message+="attribute: "+this.nodeName;Jugl.Console.error(message);Jugl.Console.dirxml(this.node.element);Jugl.Console.log(this.node.scope);}
this.removeSelf();if(!proceed){this.node.removeSelf();}
return proceed;},"repeat":function(){var pair=this.splitAttributeValue();var key=pair[0];var list=this.evalInScope(pair[1]);this.removeSelf();if(!(list instanceof Array)){var items=new Array();for(var p in list){items.push(p);}
list=items;}
var node;var previousSibling=this.node;var length=list.length;for(var i=0;i<length;++i){node=this.node.clone();node.scope[key]=list[i];node.scope.repeat[key]={index:i,number:i+1,even:!(i%2),odd:!!(i%2),start:(i==0),end:(i==length-1),length:length};previousSibling.insertAfter(node);node.process();previousSibling=node;}
this.node.removeSelf();return false;},"content":function(){var str;try{str=this.evalInScope(this.nodeValue);}catch(err){Jugl.Console.error("Failed to eval in node scope: "+
this.nodeValue);throw err;}
this.removeSelf();var child=new Jugl.Node(this.template,document.createTextNode(str));this.node.removeChildNodes();this.node.appendChild(child);return true;},"replace":function(){var str;try{str=this.evalInScope(this.nodeValue);}catch(err){Jugl.Console.error("Failed to eval in node scope: "+
this.nodeValue);throw err;}
this.removeSelf();var replacement=new Jugl.Node(this.template,document.createTextNode(str));this.node.insertBefore(replacement);this.node.removeSelf();return true;},"attributes":function(){var values=this.getAttributeValues();var pair,name,value;for(var i=0;i<values.length;++i){pair=this.splitAttributeValue(values[i]);name=pair[0];value=this.evalInScope(pair[1]);if(value!==false){this.node.setAttribute(name,value);}}
this.removeSelf();return true;},"omit-tag":function(){var omit;try{omit=((this.nodeValue=="")||!!(this.evalInScope(this.nodeValue)));}catch(err){Jugl.Console.error("Failed to eval in node scope: "+
this.nodeValue);throw err;}
this.removeSelf();if(omit){var children=this.node.getChildNodes();var child;for(var i=0;i<children.length;++i){this.node.insertBefore(children[i]);}
this.node.removeSelf();}}},CLASS_NAME:"Jugl.Attribute"});})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Template=Jugl.Class({element:null,usingNS:false,xhtmlns:"http://www.w3.org/1999/xhtml",xmldom:null,regExes:null,loaded:false,loading:false,initialize:function(element,options){if(typeof(element)=="string"){element=document.getElementById(element);}
if(element){this.element=element;this.loaded=true;}
this.regExes={trimSpace:(/^\s*(\w+)\s+(.*?)\s*$/)};if(window.ActiveXObject){this.xmldom=new ActiveXObject("Microsoft.XMLDOM");}},process:function(context,clone,toString){if(this.element.getAttributeNodeNS){if(this.element.getAttributeNodeNS(Jugl.xhtmlns,Jugl.prefix)){this.usingNS=true;}}
var node=new Jugl.Node(this,this.element);if(clone){node=node.clone();}
if(context){node.scope=context;}
try{node.process();}catch(err){Jugl.Console.error("Failed to process "+
this.element+" node");}
var data;if(toString){if(node.element.innerHTML){data=node.element.innerHTML;}else{if(this.xmldom){data=node.element.xml;}else{var serializer=new XMLSerializer();data=serializer.serializeToString(node.element);}}}else{data=node.element;}
return data;},load:function(url){this.loading=true;var setElement=function(request){var doc=request.responseXML;this.element=doc.documentElement;this.loading=false;this.loaded=true;this.onLoad();}
Jugl.Async.loadUrl(url,setElement,this);},onLoad:function(){},CLASS_NAME:"Jugl.Template"});})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Node=Jugl.Class({template:null,element:null,scope:null,initialize:function(template,element){this.template=template;this.element=element;this.scope=new Object();this.scope.repeat=new Object();},clone:function(){var element=this.element.cloneNode(true);var node=new Jugl.Node(this.template,element);Jugl.Util.extend(node.scope,this.scope);return node;},getAttribute:function(localName){var element;if(this.element.nodeType==1){if(this.template.usingNS){element=this.element.getAttributeNodeNS(Jugl.namespaceURI,localName);}else{element=this.element.getAttributeNode(Jugl.prefix+":"+
localName);}
if(element&&!element.specified){element=false;}}
var attribute;if(element){attribute=new Jugl.Attribute(this,element,localName);}else{attribute=element;}
return attribute;},setAttribute:function(name,value){this.element.setAttribute(name,value);},removeAttributeNode:function(attribute){this.element.removeAttributeNode(attribute.element);},getChildNodes:function(){var children=[];var node,scope;for(var i=0;i<this.element.childNodes.length;++i){node=new Jugl.Node(this.template,this.element.childNodes[i]);node.scope=Jugl.Util.extend({},this.scope);children.push(node);}
return children;},removeChildNodes:function(){while(this.element.hasChildNodes()){this.element.removeChild(this.element.firstChild);}},removeChild:function(node){this.element.removeChild(node.element);return node;},removeSelf:function(){this.element.parentNode.removeChild(this.element);},appendChild:function(node){this.element.appendChild(node.element);},insertAfter:function(node){var parent=this.element.parentNode;var sibling=this.element.nextSibling;if(sibling){parent.insertBefore(node.element,sibling);}else{parent.appendChild(node.element);}},insertBefore:function(node){var parent=this.element.parentNode;parent.insertBefore(node.element,this.element);},process:function(){var attribute;var keepProcessing=true;var series=["define","condition","repeat"];for(var i=0;i<series.length;++i){attribute=this.getAttribute(series[i]);if(attribute){try{keepProcessing=attribute.process();}catch(err){Jugl.Console.error("Failed to process "+
series[i]+" attribute");throw err;}
if(!keepProcessing){return;}}}
var content=this.getAttribute("content");if(content){try{content.process();}catch(err){Jugl.Console.error("Failed to process content attribute");throw err;}}else{var replace=this.getAttribute("replace");if(replace){try{replace.process();}catch(err){Jugl.Console.error("Failed to process replace attribute");throw err;}}}
var attributes=this.getAttribute("attributes");if(attributes){try{attributes.process();}catch(err){Jugl.Console.error("Failed to process attributes attribute");throw err;}}
if(!content&&!replace){this.processChildNodes();}
var omit=this.getAttribute("omit-tag");if(omit){try{omit.process();}catch(err){Jugl.Console.error("Failed to process omit-tag attribute");throw err;}}},processChildNodes:function(){var element,child;var children=this.getChildNodes();for(var i=0;i<children.length;++i){try{children[i].process();}catch(err){Jugl.Console.error("Failed to process "+
children[i]+" node");throw err;}}},CLASS_NAME:"Jugl.Node"});})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Async={loadTemplate:function(url,onComplete,caller){var createTemplate=function(request){var doc=request.responseXML;var template=new Jugl.Template(doc.documentElement);var complete=Jugl.Util.bind(onComplete,caller);complete(template);}
Jugl.Async.loadUrl(url,createTemplate);},loadUrl:function(url,onComplete,caller){var complete=(caller)?Jugl.Util.bind(onComplete,caller):onComplete;var request=Jugl.Async.createXMLHttpRequest();request.open("GET",url);request.onreadystatechange=function(){if(request.readyState==4){complete(request);}}
request.send(null);},createXMLHttpRequest:function(){if(typeof XMLHttpRequest!="undefined"){return new XMLHttpRequest();}else if(typeof ActiveXObject!="undefined"){return new ActiveXObject("Microsoft.XMLHTTP");}else{throw new Error("XMLHttpRequest not supported");}}};})();

View File

@@ -22,11 +22,14 @@ Gregers Rygg
Tim Schaub
Christopher Schmidt
Cameron Shorter
Pedro Simonetti
Paul Spencer
Paul Smith
Glen Stampoultzis
James Stembridge
Erik Uzureau
Ivan Willig
Thomas Wood
Bill Woodall
Steve Woodbridge

View File

@@ -1,55 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html>
<head>
<title>OL Docs</title>
<style type="text/css">
html, body {margin: 0;padding: 0.5em 1em;font: 0.9em Verdana, Arial, sans serif;}
.exampleContainer{width:90%; padding:5px; border-bottom:1px solid grey; }
.exampleNumber{display:inline; font-weight:bold; color:#333; }
.exampleTitle{display:inline; font-weight:bold; color:#333; }
.exampleName{display:inline; color:#333; }
.exampleDescription{color:#222; padding:3px; font-size:1.2em; }
.exampleClasses{font-size:.7em; color:grey;display:none;}
</style>
<script type="text/javascript" src="./Jugl.js"></script>
<script type="text/javascript" src="examples.js"></script>
<script type="text/javascript">
// import
var uri = "http://jugl.tschaub.net/trunk/lib/Jugl.js";
var Jugl = window[uri];
// this part does the actual template processing
window.onload = function() {
var template = new Jugl.Template("basic");
template.process();
}
</script>
</head>
<body>
<div id="basic" style="margin: 0 auto;">
<div class="exampleContainer" jugl:repeat="example examples">
<div class="exampleNumber" jugl:content="repeat.example.number">
Example # goes here
</div>
<div class="exampleTitle" jugl:content="example.title">
Title goes here
</div>
<div class="exampleName">
<a jugl:content="example.example"
jugl:attributes="href example.link">
Example Filename and Link
</a>
</div>
<div class="exampleDescription">
<span jugl:content="example.shortdesc">
Short Description goes here
</span>
</div>
<div class="exampleClasses" >
<span jugl:content="example.classes">
Related Classes go here
</span>
</div>
</div>
</div>
</body>
</html>

View File

@@ -69,7 +69,7 @@ Group: OpenLayers {
File: Control (no auto-title, OpenLayers/Control.js)
File: ArgParser (no auto-title, OpenLayers/Control/ArgParser.js)
File: Attribution (no auto-title, OpenLayers/Control/Attribution.js)
File: Control.Button (no auto-title, OpenLayers/Control/Button.js)
File: Button (no auto-title, OpenLayers/Control/Button.js)
File: DragFeature (no auto-title, OpenLayers/Control/DragFeature.js)
File: DragPan (no auto-title, OpenLayers/Control/DragPan.js)
File: DrawFeature (no auto-title, OpenLayers/Control/DrawFeature.js)
@@ -104,6 +104,14 @@ Group: OpenLayers {
File: WFS (no auto-title, OpenLayers/Feature/WFS.js)
} # Group: Feature
Group: Filter {
File: Filter (no auto-title, OpenLayers/Filter.js)
File: Comparison (no auto-title, OpenLayers/Filter/Comparison.js)
File: FeatureId (no auto-title, OpenLayers/Filter/FeatureId.js)
File: Logical (no auto-title, OpenLayers/Filter/Logical.js)
} # Group: Filter
Group: Format {
File: Format (no auto-title, OpenLayers/Format.js)
@@ -113,10 +121,18 @@ Group: OpenLayers {
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)
Group: SLD {
File: SLD (no auto-title, OpenLayers/Format/SLD.js)
File: v1 (no auto-title, OpenLayers/Format/SLD/v1.js)
File: v1_0_0 (no auto-title, OpenLayers/Format/SLD/v1_0_0.js)
} # Group: SLD
File: Text (no auto-title, OpenLayers/Format/Text.js)
File: WFS (no auto-title, OpenLayers/Format/WFS.js)
File: WKT (no auto-title, OpenLayers/Format/WKT.js)
File: XML (no auto-title, OpenLayers/Format/XML.js)
Group: WMC {
@@ -126,7 +142,6 @@ Group: OpenLayers {
File: v1_1_0 (no auto-title, OpenLayers/Format/WMC/v1_1_0.js)
} # Group: WMC
File: XML (no auto-title, OpenLayers/Format/XML.js)
} # Group: Format
Group: Geometry {
@@ -142,7 +157,6 @@ Group: OpenLayers {
File: Point (no auto-title, OpenLayers/Geometry/Point.js)
File: Polygon (no auto-title, OpenLayers/Geometry/Polygon.js)
File: Rectangle (no auto-title, OpenLayers/Geometry/Rectangle.js)
File: Surface (no auto-title, OpenLayers/Geometry/Surface.js)
} # Group: Geometry
Group: Handler {
@@ -166,6 +180,7 @@ Group: OpenLayers {
Group: Lang {
File: Lang (no auto-title, OpenLayers/Lang.js)
File: Lang["cs-CZ"] (OpenLayers/Lang/cs-CZ.js)
File: Lang["de"] (no auto-title, OpenLayers/Lang/de.js)
File: Lang["en"] (no auto-title, OpenLayers/Lang/en.js)
File: Lang["en-CA"] (no auto-title, OpenLayers/Lang/en-CA.js)
@@ -217,6 +232,8 @@ Group: OpenLayers {
File: Popup (no auto-title, OpenLayers/Popup.js)
File: Anchored (no auto-title, OpenLayers/Popup/Anchored.js)
File: AnchoredBubble (no auto-title, OpenLayers/Popup/AnchoredBubble.js)
File: Framed (OpenLayers/Popup/Framed.js)
File: FramedCloud (OpenLayers/Popup/FramedCloud.js)
} # Group: Popup
File: Projection (no auto-title, OpenLayers/Projection.js)
@@ -229,14 +246,7 @@ Group: OpenLayers {
File: VML (no auto-title, OpenLayers/Renderer/VML.js)
} # Group: Renderer
Group: Rule {
File: Rule (no auto-title, OpenLayers/Rule.js)
File: Comparison (no auto-title, OpenLayers/Rule/Comparison.js)
File: FeatureId (no auto-title, OpenLayers/Rule/FeatureId.js)
File: Logical (no auto-title, OpenLayers/Rule/Logical.js)
} # Group: Rule
File: Style (no auto-title, OpenLayers/Style.js)
File: StyleMap (no auto-title, OpenLayers/StyleMap.js)

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers GML Parser</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
function parseData(req) {

84
examples/Jugl.js Normal file
View File

@@ -0,0 +1,84 @@
/**
* Jugl.js -- JavaScript Template Library
*
* Copyright 2007 Tim Schaub
* Released under the MIT license. Please see
* http://svn.tschaub.net/jugl/trunk/license.txt for the full license.
*/
(function(){var Jugl={prefix:"jugl",namespaceURI:"http://namespace.jugl.org/"};Jugl.Array={indexOf:function(array,obj){for(var i=0;i<array.length;i++){if(array[i]==obj)return i;}
return-1;}};Jugl.Function={bind:function(method,object){var args=[];for(var i=2;i<arguments.length;++i){args.push(arguments[i]);}
return function(){for(var i=0;i<arguments.length;++i){args.push(arguments[i]);}
return method.apply(object,args);}}};Jugl.Node={appendChild:function(parent,child){if(typeof(parent)=="string"){var obj=document.getElementById(parent);if(!obj){throw Error("Element id not found: "+parent);}
parent=obj;}
if(typeof(child)=="string"){var obj=document.getElementById(child);if(!obj){throw Error("Element id not found: "+child);}
child=obj;}
if(child.namespaceURI&&child.xml){var wrapper=document.createElement('div');wrapper.innerHTML=child.xml;var children=wrapper.childNodes;for(var i=0;i<children.length;++i){parent.appendChild(children[i]);}}else{if(parent.ownerDocument&&parent.ownerDocument.importNode){child=parent.ownerDocument.importNode(child,true);}
parent.appendChild(child);}
return child;}};Jugl.Object={extend:function(destination,source){destination=destination||{};source=source||{};for(property in source){destination[property]=source[property];}
return destination;},applyDefaults:function(destination,source){destination=destination||{};source=source||{};for(property in source){if(destination[property]===undefined){destination[property]=source[property];}}
return destination;}};Jugl.Request={loadTemplate:function(url,onComplete,caller){var createTemplate=function(request){var doc,template;try{doc=request.responseXML;template=new Jugl.Template(doc.documentElement);}catch(invalidXML){try{doc=document.createElement("div");doc.innerHTML=request.responseText;template=new Jugl.Template(doc.firstChild);}catch(invalidHTML){var msg="Can't make HTML out of response: "+
request.responseText;Jugl.Console.error(msg);throw invalidHTML;}}
var complete=Jugl.Function.bind(onComplete,caller);complete(template);}
Jugl.Request.loadUrl(url,createTemplate);},loadUrl:function(url,onComplete,caller){var complete=(caller)?Jugl.Function.bind(onComplete,caller):onComplete;var request=Jugl.Request.createXMLHttpRequest();request.open("GET",url);request.onreadystatechange=function(){if(request.readyState==4){complete(request);}}
request.send(null);},createXMLHttpRequest:function(){if(typeof XMLHttpRequest!="undefined"){return new XMLHttpRequest();}else if(typeof ActiveXObject!="undefined"){return new ActiveXObject("Microsoft.XMLHTTP");}else{throw new Error("XMLHttpRequest not supported");}}};Jugl.Class=function(){var Class=function(){if(this===Jugl){var msg="Create an instance of a Jugl "+"class with the new keyword";throw Error(msg);}
this.initialize.apply(this,arguments);}
var extended={toString:function(){return"["+this.CLASS_NAME+"]";}};var parent;for(var i=0;i<arguments.length;++i){if(typeof arguments[i]=="function"){parent=arguments[i].prototype;}else{parent=arguments[i];}
Jugl.Object.extend(extended,parent);}
Class.prototype=extended;return Class;};Jugl.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){}};(function(){if(window.console){var scripts=document.getElementsByTagName("script");for(var i=0;i<scripts.length;++i){if(scripts[i].src.indexOf("firebug.js")!=-1){Jugl.Object.extend(Jugl.Console,console);break;}}}})();Jugl.Attribute=Jugl.Class({element:null,node:null,type:null,nodeValue:null,template:null,initialize:function(element,node,type){this.element=element;this.node=node;this.type=type;this.nodeValue=node.nodeValue;this.nodeName=node.nodeName;this.template=element.template;},splitAttributeValue:function(value){value=(value!=null)?value:this.nodeValue;var matches=this.template.regExes.trimSpace.exec(value);var items;if(matches&&matches.length==3){items=[matches[1],matches[2]];}
return items;},splitExpressionPrefix:function(){var items=this.splitAttributeValue();if(!items||(items[0]!='structure'&&items[0]!='text')){items=[null,this.nodeValue];}
return items;},getAttributeValues:function(){var trimmed=this.nodeValue.replace(/[\t\n]/g,"").replace(/;\s*$/,"");var tabbed=trimmed.replace(/;;/g,"\t");var newlined=tabbed.split(";").join("\n");return newlined.replace(/\t/g,";").split(/\n/g);},removeSelf:function(){this.element.removeAttributeNode(this);},process:function(){return this.processAttribute[this.type].apply(this,[]);},evalInScope:function(str){var expression="with(this.element.scope){"+str+"}";return eval(expression);},processAttribute:{"define":function(){var values=this.getAttributeValues();var pair;for(var i=0;i<values.length;++i){pair=this.splitAttributeValue(values[i]);this.element.scope[pair[0]]=this.evalInScope(pair[1]);}
this.removeSelf();return true;},"condition":function(){var proceed;try{proceed=!!(this.evalInScope(this.nodeValue));}catch(err){var message=err.name+": "+err.message+"\n"+"attribute: "+this.nodeName;Jugl.Console.error(message);throw err;}
this.removeSelf();if(!proceed){this.element.removeSelf();}
return proceed;},"repeat":function(){var pair=this.splitAttributeValue();var key=pair[0];var list=this.evalInScope(pair[1]);this.removeSelf();if(!(list instanceof Array)){var items=new Array();for(var p in list){items.push(p);}
list=items;}
var element;var previousSibling=this.element;var length=list.length;for(var i=0;i<length;++i){element=this.element.clone();element.scope[key]=list[i];element.scope.repeat[key]={index:i,number:i+1,even:!(i%2),odd:!!(i%2),start:(i==0),end:(i==length-1),length:length};previousSibling.insertAfter(element);element.process();previousSibling=element;}
this.element.removeSelf();return false;},"content":function(){var pair=this.splitExpressionPrefix();var str;try{str=this.evalInScope(pair[1]);}catch(err){Jugl.Console.error("Failed to eval in element scope: "+
pair[1]);throw err;}
this.removeSelf();if(pair[0]=='structure'){try{this.element.node.innerHTML=str;}catch(err){var wrapper=document.createElement('div');var msg;try{wrapper.innerHTML=str;}catch(invalidHTML){msg="Can't transform string into valid HTML : "+
str;Jugl.Console.error(msg);throw invalidHTML;}
if(this.element.node.xml&&this.template.xmldom){while(this.element.node.firstChild){this.element.node.removeChild(this.element.node.firstChild);}
this.template.xmldom.loadXML(wrapper.outerHTML);var children=this.template.xmldom.firstChild.childNodes;try{for(var i=0;i<children.length;++i){this.element.node.appendChild(children[i]);}}catch(invalidXML){msg="Can't transform string into valid XHTML : "+
str;Jugl.Console.error(msg);throw invalidXML;}}else{try{this.element.node.innerHTML=wrapper.innerHTML;}catch(invalidXML){msg="Can't transform string into valid XHTML : "+
str;Jugl.Console.error(msg);throw invalidXML;}}}}else{var text;if(this.element.node.xml&&this.template.xmldom){text=this.template.xmldom.createTextNode(str);}else{text=document.createTextNode(str);}
var child=new Jugl.Element(this.template,text);this.element.removeChildNodes();this.element.appendChild(child);}
return true;},"replace":function(){var pair=this.splitExpressionPrefix();var str;try{str=this.evalInScope(pair[1]);}catch(err){Jugl.Console.error("Failed to eval in element scope: "+
pair[1]);throw err;}
this.removeSelf();if(pair[0]=='structure'){var wrapper=document.createElement('div');try{wrapper.innerHTML=str;}catch(err){msg="Can't transform string into valid HTML : "+
str;Jugl.Console.error(msg);throw err;}
if(this.element.node.xml&&this.template.xmldom){try{this.template.xmldom.loadXML(wrapper.outerHTML);}catch(err){msg="Can't transform string into valid XML : "+
str;Jugl.Console.error(msg);throw err;}
wrapper=this.template.xmldom.firstChild;}
while(wrapper.firstChild){var child=wrapper.removeChild(wrapper.firstChild);if(this.element.node.ownerDocument&&this.element.node.ownerDocument.importNode){if(child.ownerDocument!=this.element.node.ownerDocument){child=this.element.node.ownerDocument.importNode(child,true);}}
this.element.node.parentNode.insertBefore(child,this.element.node);}}else{var text;if(this.element.node.xml&&this.template.xmldom){text=this.template.xmldom.createTextNode(str);}else{text=document.createTextNode(str);}
var replacement=new Jugl.Element(this.template,text);this.element.insertBefore(replacement);}
this.element.removeSelf();return true;},"attributes":function(){var values=this.getAttributeValues();var pair,name,value;for(var i=0;i<values.length;++i){pair=this.splitAttributeValue(values[i]);name=pair[0];value=this.evalInScope(pair[1]);if(value!==false){this.element.setAttribute(name,value);}}
this.removeSelf();return true;},"omit-tag":function(){var omit;try{omit=((this.nodeValue=="")||!!(this.evalInScope(this.nodeValue)));}catch(err){Jugl.Console.error("Failed to eval in element scope: "+
this.nodeValue);throw err;}
this.removeSelf();if(omit){var children=this.element.getChildNodes();var child;for(var i=0;i<children.length;++i){this.element.insertBefore(children[i]);}
this.element.removeSelf();}},"reflow":function(){var reflow;try{reflow=((this.nodeValue=="")||!!(this.evalInScope(this.nodeValue)));}catch(err){Jugl.Console.error("Failed to eval in element scope: "+
this.nodeValue);throw err;}
this.removeSelf();if(reflow){if(this.element.node.outerHTML){this.element.node.outerHTML=this.element.node.outerHTML;}else{this.element.node.innerHTML=this.element.node.innerHTML;}}}},CLASS_NAME:"Jugl.Attribute"});Jugl.Element=Jugl.Class({template:null,node:null,scope:null,initialize:function(template,node){this.template=template;this.node=node;this.scope=new Object();this.scope.repeat=new Object();},clone:function(){var node=this.node.cloneNode(true);node.removeAttribute("id");var element=new Jugl.Element(this.template,node);Jugl.Object.extend(element.scope,this.scope);return element;},getAttribute:function(localName){var node;if(this.node.nodeType==1){if(this.template.usingNS){node=this.node.getAttributeNodeNS(Jugl.namespaceURI,localName);}else{node=this.node.getAttributeNode(Jugl.prefix+":"+
localName);}
if(node&&!node.specified){node=false;}}
var attribute;if(node){attribute=new Jugl.Attribute(this,node,localName);}else{attribute=node;}
return attribute;},setAttribute:function(name,value){this.node.setAttribute(name,value);},removeAttributeNode:function(attribute){this.node.removeAttributeNode(attribute.node);},getChildNodes:function(){var numNodes=this.node.childNodes.length;var children=new Array(numNodes);var node,scope;for(var i=0;i<numNodes;++i){node=new Jugl.Element(this.template,this.node.childNodes[i]);node.scope=Jugl.Object.extend({},this.scope);children[i]=node;}
return children;},removeChildNodes:function(){while(this.node.hasChildNodes()){this.node.removeChild(this.node.firstChild);}},removeChild:function(element){this.node.removeChild(element.node);return node;},removeSelf:function(){this.node.parentNode.removeChild(this.node);},importNode:function(element){if(this.node.ownerDocument&&this.node.ownerDocument.importNode){if(element.node.ownerDocument!=this.node.ownerDocument){element.node=this.node.ownerDocument.importNode(element.node,true);}}},appendChild:function(element){this.importNode(element);this.node.appendChild(element.node);},insertAfter:function(element){this.importNode(element);var parent=this.node.parentNode;var sibling=this.node.nextSibling;if(sibling){parent.insertBefore(element.node,sibling);}else{parent.appendChild(element.node);}},insertBefore:function(element){this.importNode(element);var parent=this.node.parentNode;parent.insertBefore(element.node,this.node);},process:function(){var attribute;var keepProcessing=true;var series=["define","condition","repeat"];for(var i=0;i<series.length;++i){attribute=this.getAttribute(series[i]);if(attribute){try{keepProcessing=attribute.process();}catch(err){Jugl.Console.error("Failed to process "+
series[i]+" attribute");throw err;}
if(!keepProcessing){return;}}}
var content=this.getAttribute("content");if(content){try{content.process();}catch(err){Jugl.Console.error("Failed to process content attribute");throw err;}}else{var replace=this.getAttribute("replace");if(replace){try{replace.process();}catch(err){Jugl.Console.error("Failed to process replace attribute");throw err;}}}
var attributes=this.getAttribute("attributes");if(attributes){try{attributes.process();}catch(err){Jugl.Console.error("Failed to process attributes attribute");throw err;}}
if(!content&&!replace){this.processChildNodes();}
var omit=this.getAttribute("omit-tag");if(omit){try{omit.process();}catch(err){Jugl.Console.error("Failed to process omit-tag attribute");throw err;}}
var reflow=this.getAttribute("reflow");if(reflow){try{reflow.process();}catch(err){Jugl.Console.error("Failed to process reflow attribute");throw err;}}},processChildNodes:function(){var children=this.getChildNodes();for(var i=0;i<children.length;++i){try{children[i].process();}catch(err){Jugl.Console.error("Failed to process child node: "+i);throw err;}}},CLASS_NAME:"Jugl.Element"});Jugl.Template=Jugl.Class({node:null,usingNS:false,xhtmlns:"http://www.w3.org/1999/xhtml",xmldom:window.ActiveXObject?new ActiveXObject("Microsoft.XMLDOM"):null,regExes:{trimSpace:(/^\s*(\w+)\s+(.*?)\s*$/)},loaded:false,loading:false,initialize:function(config){if(typeof config=="string"||(config&&config.nodeType==1)){config={node:config};}
config=config||{};if(typeof(config.node)=="string"){config.node=document.getElementById(config.node);if(!config.node){throw Error("Element id not found: "+config.node);}}
if(config.node){this.node=config.node;this.loaded=true;}else if(config.url){this.load({url:config.url,callback:config.callback,scope:config.scope});}},process:function(config){if(config&&!config.context&&!config.clone&&!config.string&&!config.parent){config={context:config}}
config=Jugl.Object.applyDefaults(config,{context:null,clone:false,string:false});if(this.node.getAttributeNodeNS){if(this.node.getAttributeNodeNS(Jugl.xhtmlns,Jugl.prefix)){this.usingNS=true;}}
var element=new Jugl.Element(this,this.node);if(config.clone){element=element.clone();}
if(config.context){element.scope=config.context;}
try{element.process();}catch(err){Jugl.Console.error("Failed to process "+
this.node.nodeName+" node");throw err;}
var data;if(config.string){if(element.node.innerHTML){data=element.node.innerHTML;}else{if(this.xmldom){data=element.node.xml;}else{var serializer=new XMLSerializer();data=serializer.serializeToString(element.node);}}}else{data=element.node;if(config.parent){if(config.clone){data=Jugl.Node.appendChild(config.parent,element.node);}else{this.appendTo(config.parent);}}}
return data;},load:function(config){if(typeof config=="string"){config={url:config};}
config=config||{};this.loading=true;var setNode=function(template){this.node=template.node;this.loading=false;this.loaded=true;if(config.callback){config.callback.apply(config.scope,[template]);}}
Jugl.Request.loadTemplate(config.url,setNode,this);},appendTo:function(parent){this.node=Jugl.Node.appendChild(parent,this.node);return this;},CLASS_NAME:"Jugl.Template"});window["http://jugl.tschaub.net/trunk/lib/Jugl.js"]=Jugl;})();

View File

@@ -1,6 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers KML Parser Example</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
function parseData(req) {

View File

@@ -2,13 +2,8 @@
<head>
<title>OpenLayers Accessible 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: 512px;
height: 512px;
border: 1px solid #eee;
}
table {
border: 1 px solid white;
padding: 0;
@@ -90,7 +85,7 @@
pan <em>w</em>est
</a>
</td>
<td id="map"></td>
<td id="map" class="smallmap"></td>
<td>
<a href="javascript: void map.pan(map.getSize().w / 4, 0);"
accesskey="e">

View File

@@ -2,18 +2,7 @@
<head>
<title>Animated Panning of the Map via map.panTo</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 256px;
border: 1px solid black;
}
#map2 {
width: 512px;
height: 256px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer, running = false;
@@ -86,7 +75,7 @@
<h1 id="title">map.panTo Example</h1>
<div id="tags">map.panTo</div>
<div id="shortdesc">Show animated panning effects in the map</div>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>This is an example of transition effects. If the new random center is in the current extent, the map will pan smoothly. <br />
The random selection will continue until you press it again. Additionally, you can single click in the map to pan smoothly
@@ -94,7 +83,7 @@
</p>
</div>
<button onclick="setCenterInterval()">Start/stop random recenter</button>
<div id="map2"></div>
<div id="map2" class="smallmap"></div>
<div>
<p>To turn off Animated Panning, create a map with an panMethod set to
null. </p>

670
examples/animator.js Normal file
View File

@@ -0,0 +1,670 @@
/*
Animator.js 1.1.9
This library is released under the BSD license:
Copyright (c) 2006, Bernard Sumption. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer. Redistributions in binary
form must reproduce the above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or other materials
provided with the distribution. Neither the name BernieCode nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
*/
// Applies a sequence of numbers between 0 and 1 to a number of subjects
// construct - see setOptions for parameters
function Animator(options) {
this.setOptions(options);
var _this = this;
this.timerDelegate = function(){_this.onTimerEvent()};
this.subjects = [];
this.target = 0;
this.state = 0;
this.lastTime = null;
};
Animator.prototype = {
// apply defaults
setOptions: function(options) {
this.options = Animator.applyDefaults({
interval: 20, // time between animation frames
duration: 400, // length of animation
onComplete: function(){},
onStep: function(){},
transition: Animator.tx.easeInOut
}, options);
},
// animate from the current state to provided value
seekTo: function(to) {
this.seekFromTo(this.state, to);
},
// animate from the current state to provided value
seekFromTo: function(from, to) {
this.target = Math.max(0, Math.min(1, to));
this.state = Math.max(0, Math.min(1, from));
this.lastTime = new Date().getTime();
if (!this.intervalId) {
this.intervalId = window.setInterval(this.timerDelegate, this.options.interval);
}
},
// animate from the current state to provided value
jumpTo: function(to) {
this.target = this.state = Math.max(0, Math.min(1, to));
this.propagate();
},
// seek to the opposite of the current target
toggle: function() {
this.seekTo(1 - this.target);
},
// add a function or an object with a method setState(state) that will be called with a number
// between 0 and 1 on each frame of the animation
addSubject: function(subject) {
this.subjects[this.subjects.length] = subject;
return this;
},
// remove all subjects
clearSubjects: function() {
this.subjects = [];
},
// forward the current state to the animation subjects
propagate: function() {
var value = this.options.transition(this.state);
for (var i=0; i<this.subjects.length; i++) {
if (this.subjects[i].setState) {
this.subjects[i].setState(value);
} else {
this.subjects[i](value);
}
}
},
// called once per frame to update the current state
onTimerEvent: function() {
var now = new Date().getTime();
var timePassed = now - this.lastTime;
this.lastTime = now;
var movement = (timePassed / this.options.duration) * (this.state < this.target ? 1 : -1);
if (Math.abs(movement) >= Math.abs(this.state - this.target)) {
this.state = this.target;
} else {
this.state += movement;
}
try {
this.propagate();
} finally {
this.options.onStep.call(this);
if (this.target == this.state) {
window.clearInterval(this.intervalId);
this.intervalId = null;
this.options.onComplete.call(this);
}
}
},
// shortcuts
play: function() {this.seekFromTo(0, 1)},
reverse: function() {this.seekFromTo(1, 0)},
// return a string describing this Animator, for debugging
inspect: function() {
var str = "#<Animator:\n";
for (var i=0; i<this.subjects.length; i++) {
str += this.subjects[i].inspect();
}
str += ">";
return str;
}
}
// merge the properties of two objects
Animator.applyDefaults = function(defaults, prefs) {
prefs = prefs || {};
var prop, result = {};
for (prop in defaults) result[prop] = prefs[prop] !== undefined ? prefs[prop] : defaults[prop];
return result;
}
// make an array from any object
Animator.makeArray = function(o) {
if (o == null) return [];
if (!o.length) return [o];
var result = [];
for (var i=0; i<o.length; i++) result[i] = o[i];
return result;
}
// convert a dash-delimited-property to a camelCaseProperty (c/o Prototype, thanks Sam!)
Animator.camelize = function(string) {
var oStringList = string.split('-');
if (oStringList.length == 1) return oStringList[0];
var camelizedString = string.indexOf('-') == 0
? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1)
: oStringList[0];
for (var i = 1, len = oStringList.length; i < len; i++) {
var s = oStringList[i];
camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
}
return camelizedString;
}
// syntactic sugar for creating CSSStyleSubjects
Animator.apply = function(el, style, options) {
if (style instanceof Array) {
return new Animator(options).addSubject(new CSSStyleSubject(el, style[0], style[1]));
}
return new Animator(options).addSubject(new CSSStyleSubject(el, style));
}
// make a transition function that gradually accelerates. pass a=1 for smooth
// gravitational acceleration, higher values for an exaggerated effect
Animator.makeEaseIn = function(a) {
return function(state) {
return Math.pow(state, a*2);
}
}
// as makeEaseIn but for deceleration
Animator.makeEaseOut = function(a) {
return function(state) {
return 1 - Math.pow(1 - state, a*2);
}
}
// make a transition function that, like an object with momentum being attracted to a point,
// goes past the target then returns
Animator.makeElastic = function(bounces) {
return function(state) {
state = Animator.tx.easeInOut(state);
return ((1-Math.cos(state * Math.PI * bounces)) * (1 - state)) + state;
}
}
// make an Attack Decay Sustain Release envelope that starts and finishes on the same level
//
Animator.makeADSR = function(attackEnd, decayEnd, sustainEnd, sustainLevel) {
if (sustainLevel == null) sustainLevel = 0.5;
return function(state) {
if (state < attackEnd) {
return state / attackEnd;
}
if (state < decayEnd) {
return 1 - ((state - attackEnd) / (decayEnd - attackEnd) * (1 - sustainLevel));
}
if (state < sustainEnd) {
return sustainLevel;
}
return sustainLevel * (1 - ((state - sustainEnd) / (1 - sustainEnd)));
}
}
// make a transition function that, like a ball falling to floor, reaches the target and/
// bounces back again
Animator.makeBounce = function(bounces) {
var fn = Animator.makeElastic(bounces);
return function(state) {
state = fn(state);
return state <= 1 ? state : 2-state;
}
}
// pre-made transition functions to use with the 'transition' option
Animator.tx = {
easeInOut: function(pos){
return ((-Math.cos(pos*Math.PI)/2) + 0.5);
},
linear: function(x) {
return x;
},
easeIn: Animator.makeEaseIn(1.5),
easeOut: Animator.makeEaseOut(1.5),
strongEaseIn: Animator.makeEaseIn(2.5),
strongEaseOut: Animator.makeEaseOut(2.5),
elastic: Animator.makeElastic(1),
veryElastic: Animator.makeElastic(3),
bouncy: Animator.makeBounce(1),
veryBouncy: Animator.makeBounce(3)
}
// animates a pixel-based style property between two integer values
function NumericalStyleSubject(els, property, from, to, units) {
this.els = Animator.makeArray(els);
if (property == 'opacity' && window.ActiveXObject) {
this.property = 'filter';
} else {
this.property = Animator.camelize(property);
}
this.from = parseFloat(from);
this.to = parseFloat(to);
this.units = units != null ? units : 'px';
}
NumericalStyleSubject.prototype = {
setState: function(state) {
var style = this.getStyle(state);
var visibility = (this.property == 'opacity' && state == 0) ? 'hidden' : '';
var j=0;
for (var i=0; i<this.els.length; i++) {
try {
this.els[i].style[this.property] = style;
} catch (e) {
// ignore fontWeight - intermediate numerical values cause exeptions in firefox
if (this.property != 'fontWeight') throw e;
}
if (j++ > 20) return;
}
},
getStyle: function(state) {
state = this.from + ((this.to - this.from) * state);
if (this.property == 'filter') return "alpha(opacity=" + Math.round(state*100) + ")";
if (this.property == 'opacity') return state;
return Math.round(state) + this.units;
},
inspect: function() {
return "\t" + this.property + "(" + this.from + this.units + " to " + this.to + this.units + ")\n";
}
}
// animates a colour based style property between two hex values
function ColorStyleSubject(els, property, from, to) {
this.els = Animator.makeArray(els);
this.property = Animator.camelize(property);
this.to = this.expandColor(to);
this.from = this.expandColor(from);
this.origFrom = from;
this.origTo = to;
}
ColorStyleSubject.prototype = {
// parse "#FFFF00" to [256, 256, 0]
expandColor: function(color) {
var hexColor, red, green, blue;
hexColor = ColorStyleSubject.parseColor(color);
if (hexColor) {
red = parseInt(hexColor.slice(1, 3), 16);
green = parseInt(hexColor.slice(3, 5), 16);
blue = parseInt(hexColor.slice(5, 7), 16);
return [red,green,blue]
}
if (window.DEBUG) {
alert("Invalid colour: '" + color + "'");
}
},
getValueForState: function(color, state) {
return Math.round(this.from[color] + ((this.to[color] - this.from[color]) * state));
},
setState: function(state) {
var color = '#'
+ ColorStyleSubject.toColorPart(this.getValueForState(0, state))
+ ColorStyleSubject.toColorPart(this.getValueForState(1, state))
+ ColorStyleSubject.toColorPart(this.getValueForState(2, state));
for (var i=0; i<this.els.length; i++) {
this.els[i].style[this.property] = color;
}
},
inspect: function() {
return "\t" + this.property + "(" + this.origFrom + " to " + this.origTo + ")\n";
}
}
// return a properly formatted 6-digit hex colour spec, or false
ColorStyleSubject.parseColor = function(string) {
var color = '#', match;
if(match = ColorStyleSubject.parseColor.rgbRe.exec(string)) {
var part;
for (var i=1; i<=3; i++) {
part = Math.max(0, Math.min(255, parseInt(match[i])));
color += ColorStyleSubject.toColorPart(part);
}
return color;
}
if (match = ColorStyleSubject.parseColor.hexRe.exec(string)) {
if(match[1].length == 3) {
for (var i=0; i<3; i++) {
color += match[1].charAt(i) + match[1].charAt(i);
}
return color;
}
return '#' + match[1];
}
return false;
}
// convert a number to a 2 digit hex string
ColorStyleSubject.toColorPart = function(number) {
if (number > 255) number = 255;
var digits = number.toString(16);
if (number < 16) return '0' + digits;
return digits;
}
ColorStyleSubject.parseColor.rgbRe = /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i;
ColorStyleSubject.parseColor.hexRe = /^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
// Animates discrete styles, i.e. ones that do not scale but have discrete values
// that can't be interpolated
function DiscreteStyleSubject(els, property, from, to, threshold) {
this.els = Animator.makeArray(els);
this.property = Animator.camelize(property);
this.from = from;
this.to = to;
this.threshold = threshold || 0.5;
}
DiscreteStyleSubject.prototype = {
setState: function(state) {
var j=0;
for (var i=0; i<this.els.length; i++) {
this.els[i].style[this.property] = state <= this.threshold ? this.from : this.to;
}
},
inspect: function() {
return "\t" + this.property + "(" + this.from + " to " + this.to + " @ " + this.threshold + ")\n";
}
}
// animates between two styles defined using CSS.
// if style1 and style2 are present, animate between them, if only style1
// is present, animate between the element's current style and style1
function CSSStyleSubject(els, style1, style2) {
els = Animator.makeArray(els);
this.subjects = [];
if (els.length == 0) return;
var prop, toStyle, fromStyle;
if (style2) {
fromStyle = this.parseStyle(style1, els[0]);
toStyle = this.parseStyle(style2, els[0]);
} else {
toStyle = this.parseStyle(style1, els[0]);
fromStyle = {};
for (prop in toStyle) {
fromStyle[prop] = CSSStyleSubject.getStyle(els[0], prop);
}
}
// remove unchanging properties
var prop;
for (prop in fromStyle) {
if (fromStyle[prop] == toStyle[prop]) {
delete fromStyle[prop];
delete toStyle[prop];
}
}
// discover the type (numerical or colour) of each style
var prop, units, match, type, from, to;
for (prop in fromStyle) {
var fromProp = String(fromStyle[prop]);
var toProp = String(toStyle[prop]);
if (toStyle[prop] == null) {
if (window.DEBUG) alert("No to style provided for '" + prop + '"');
continue;
}
if (from = ColorStyleSubject.parseColor(fromProp)) {
to = ColorStyleSubject.parseColor(toProp);
type = ColorStyleSubject;
} else if (fromProp.match(CSSStyleSubject.numericalRe)
&& toProp.match(CSSStyleSubject.numericalRe)) {
from = parseFloat(fromProp);
to = parseFloat(toProp);
type = NumericalStyleSubject;
match = CSSStyleSubject.numericalRe.exec(fromProp);
var reResult = CSSStyleSubject.numericalRe.exec(toProp);
if (match[1] != null) {
units = match[1];
} else if (reResult[1] != null) {
units = reResult[1];
} else {
units = reResult;
}
} else if (fromProp.match(CSSStyleSubject.discreteRe)
&& toProp.match(CSSStyleSubject.discreteRe)) {
from = fromProp;
to = toProp;
type = DiscreteStyleSubject;
units = 0; // hack - how to get an animator option down to here
} else {
if (window.DEBUG) {
alert("Unrecognised format for value of "
+ prop + ": '" + fromStyle[prop] + "'");
}
continue;
}
this.subjects[this.subjects.length] = new type(els, prop, from, to, units);
}
}
CSSStyleSubject.prototype = {
// parses "width: 400px; color: #FFBB2E" to {width: "400px", color: "#FFBB2E"}
parseStyle: function(style, el) {
var rtn = {};
// if style is a rule set
if (style.indexOf(":") != -1) {
var styles = style.split(";");
for (var i=0; i<styles.length; i++) {
var parts = CSSStyleSubject.ruleRe.exec(styles[i]);
if (parts) {
rtn[parts[1]] = parts[2];
}
}
}
// else assume style is a class name
else {
var prop, value, oldClass;
oldClass = el.className;
el.className = style;
for (var i=0; i<CSSStyleSubject.cssProperties.length; i++) {
prop = CSSStyleSubject.cssProperties[i];
value = CSSStyleSubject.getStyle(el, prop);
if (value != null) {
rtn[prop] = value;
}
}
el.className = oldClass;
}
return rtn;
},
setState: function(state) {
for (var i=0; i<this.subjects.length; i++) {
this.subjects[i].setState(state);
}
},
inspect: function() {
var str = "";
for (var i=0; i<this.subjects.length; i++) {
str += this.subjects[i].inspect();
}
return str;
}
}
// get the current value of a css property,
CSSStyleSubject.getStyle = function(el, property){
var style;
if(document.defaultView && document.defaultView.getComputedStyle){
style = document.defaultView.getComputedStyle(el, "").getPropertyValue(property);
if (style) {
return style;
}
}
property = Animator.camelize(property);
if(el.currentStyle){
style = el.currentStyle[property];
}
return style || el.style[property]
}
CSSStyleSubject.ruleRe = /^\s*([a-zA-Z\-]+)\s*:\s*(\S(.+\S)?)\s*$/;
CSSStyleSubject.numericalRe = /^-?\d+(?:\.\d+)?(%|[a-zA-Z]{2})?$/;
CSSStyleSubject.discreteRe = /^\w+$/;
// required because the style object of elements isn't enumerable in Safari
/*
CSSStyleSubject.cssProperties = ['background-color','border','border-color','border-spacing',
'border-style','border-top','border-right','border-bottom','border-left','border-top-color',
'border-right-color','border-bottom-color','border-left-color','border-top-width','border-right-width',
'border-bottom-width','border-left-width','border-width','bottom','color','font-size','font-size-adjust',
'font-stretch','font-style','height','left','letter-spacing','line-height','margin','margin-top',
'margin-right','margin-bottom','margin-left','marker-offset','max-height','max-width','min-height',
'min-width','orphans','outline','outline-color','outline-style','outline-width','overflow','padding',
'padding-top','padding-right','padding-bottom','padding-left','quotes','right','size','text-indent',
'top','width','word-spacing','z-index','opacity','outline-offset'];*/
CSSStyleSubject.cssProperties = ['azimuth','background','background-attachment','background-color','background-image','background-position','background-repeat','border-collapse','border-color','border-spacing','border-style','border-top','border-top-color','border-right-color','border-bottom-color','border-left-color','border-top-style','border-right-style','border-bottom-style','border-left-style','border-top-width','border-right-width','border-bottom-width','border-left-width','border-width','bottom','clear','clip','color','content','cursor','direction','display','elevation','empty-cells','css-float','font','font-family','font-size','font-size-adjust','font-stretch','font-style','font-variant','font-weight','height','left','letter-spacing','line-height','list-style','list-style-image','list-style-position','list-style-type','margin','margin-top','margin-right','margin-bottom','margin-left','max-height','max-width','min-height','min-width','orphans','outline','outline-color','outline-style','outline-width','overflow','padding','padding-top','padding-right','padding-bottom','padding-left','pause','position','right','size','table-layout','text-align','text-decoration','text-indent','text-shadow','text-transform','top','vertical-align','visibility','white-space','width','word-spacing','z-index','opacity','outline-offset','overflow-x','overflow-y'];
// chains several Animator objects together
function AnimatorChain(animators, options) {
this.animators = animators;
this.setOptions(options);
for (var i=0; i<this.animators.length; i++) {
this.listenTo(this.animators[i]);
}
this.forwards = false;
this.current = 0;
}
AnimatorChain.prototype = {
// apply defaults
setOptions: function(options) {
this.options = Animator.applyDefaults({
// by default, each call to AnimatorChain.play() calls jumpTo(0) of each animator
// before playing, which can cause flickering if you have multiple animators all
// targeting the same element. Set this to false to avoid this.
resetOnPlay: true
}, options);
},
// play each animator in turn
play: function() {
this.forwards = true;
this.current = -1;
if (this.options.resetOnPlay) {
for (var i=0; i<this.animators.length; i++) {
this.animators[i].jumpTo(0);
}
}
this.advance();
},
// play all animators backwards
reverse: function() {
this.forwards = false;
this.current = this.animators.length;
if (this.options.resetOnPlay) {
for (var i=0; i<this.animators.length; i++) {
this.animators[i].jumpTo(1);
}
}
this.advance();
},
// if we have just play()'d, then call reverse(), and vice versa
toggle: function() {
if (this.forwards) {
this.seekTo(0);
} else {
this.seekTo(1);
}
},
// internal: install an event listener on an animator's onComplete option
// to trigger the next animator
listenTo: function(animator) {
var oldOnComplete = animator.options.onComplete;
var _this = this;
animator.options.onComplete = function() {
if (oldOnComplete) oldOnComplete.call(animator);
_this.advance();
}
},
// play the next animator
advance: function() {
if (this.forwards) {
if (this.animators[this.current + 1] == null) return;
this.current++;
this.animators[this.current].play();
} else {
if (this.animators[this.current - 1] == null) return;
this.current--;
this.animators[this.current].reverse();
}
},
// this function is provided for drop-in compatibility with Animator objects,
// but only accepts 0 and 1 as target values
seekTo: function(target) {
if (target <= 0) {
this.forwards = false;
this.animators[this.current].seekTo(0);
} else {
this.forwards = true;
this.animators[this.current].seekTo(1);
}
}
}
// an Accordion is a class that creates and controls a number of Animators. An array of elements is passed in,
// and for each element an Animator and a activator button is created. When an Animator's activator button is
// clicked, the Animator and all before it seek to 0, and all Animators after it seek to 1. This can be used to
// create the classic Accordion effect, hence the name.
// see setOptions for arguments
function Accordion(options) {
this.setOptions(options);
var selected = this.options.initialSection, current;
if (this.options.rememberance) {
current = document.location.hash.substring(1);
}
this.rememberanceTexts = [];
this.ans = [];
var _this = this;
for (var i=0; i<this.options.sections.length; i++) {
var el = this.options.sections[i];
var an = new Animator(this.options.animatorOptions);
var from = this.options.from + (this.options.shift * i);
var to = this.options.to + (this.options.shift * i);
an.addSubject(new NumericalStyleSubject(el, this.options.property, from, to, this.options.units));
an.jumpTo(0);
var activator = this.options.getActivator(el);
activator.index = i;
activator.onclick = function(){_this.show(this.index)};
this.ans[this.ans.length] = an;
this.rememberanceTexts[i] = activator.innerHTML.replace(/\s/g, "");
if (this.rememberanceTexts[i] === current) {
selected = i;
}
}
this.show(selected);
}
Accordion.prototype = {
// apply defaults
setOptions: function(options) {
this.options = Object.extend({
// REQUIRED: an array of elements to use as the accordion sections
sections: null,
// a function that locates an activator button element given a section element.
// by default it takes a button id from the section's "activator" attibute
getActivator: function(el) {return document.getElementById(el.getAttribute("activator"))},
// shifts each animator's range, for example with options {from:0,to:100,shift:20}
// the animators' ranges will be 0-100, 20-120, 40-140 etc.
shift: 0,
// the first page to show
initialSection: 0,
// if set to true, document.location.hash will be used to preserve the open section across page reloads
rememberance: true,
// constructor arguments to the Animator objects
animatorOptions: {}
}, options || {});
},
show: function(section) {
for (var i=0; i<this.ans.length; i++) {
this.ans[i].seekTo(i > section ? 1 : 0);
}
if (this.options.rememberance) {
document.location.hash = this.rememberanceTexts[section];
}
}
}

View File

@@ -2,15 +2,9 @@
<head>
<title>OpenLayers Attribution Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init(){
@@ -24,7 +18,11 @@
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"},{attribution:"Provided by Telascience"});
map.addLayers([ol_wms, jpl_wms]);
var vector = new OpenLayers.Layer.Vector("Simple Geometry",
{attribution:"Vector Attibution in 2nd arg"});
map.addLayers([ol_wms, jpl_wms, vector]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.Attribution());
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
@@ -36,18 +34,21 @@
<h1 id="title">Attribution Example</h1>
<div id="tags">
copyright watermark logo attribution
</div>
<p id="shortdesc">
Shows the use of the attribution layer option on a number of layer types.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
This is an example of how to add an attribution block to the OpenLayers window. In order to use an
attribution block, an attribution parameter must be set in each layer that requires attribution. In
addition, an attribution control must be added to the map.
addition, an attribution control must be added to the map, though one is added to all OpenLayers Maps by default.
Be aware that this is a layer *option*: the options hash goes in
different places depending on the layer type you are using.
</div>
</body>
</html>

View File

@@ -3,13 +3,8 @@
<title>OpenLayers Base Layers 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: 512;
height: 512px;
border: 1px solid black;
background-color: blue;
}
#controls
{
width: 512px;
@@ -21,7 +16,7 @@
<!-- Localhost key -->
<!-- <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>-->
<script type="text/javascript" src="http://clients.multimap.com/API/maps/1.1/metacarta_04"></script>
<script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script>
<script src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>
<script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
@@ -89,7 +84,7 @@
</p>
<div id="controls">
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div style="background-color:green" onclick="add()"> click to add a marker to the map</div>
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>

View File

@@ -0,0 +1,49 @@
<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("GML", {
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "gml/polygon.xml",
format: new OpenLayers.Format.GML()
}),
});
map.addLayers([wms, layer]);
map.zoomToExtent(new OpenLayers.Bounds(
-3.92, 44.34, 4.87, 49.55
));
}
</script>
</head>
<body onload="init()">
<h1 id="title">Vector Behavior Example (Fixed/HTTP/GML)</h1>
<p id="shortdesc">
Vector layer with a Fixed strategy, HTTP protocol, and GML format.
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
The vector layer shown uses the Fixed strategy, the HTTP protocol,
and the GML format.
The Fixed strategy is a simple strategy that fetches features once
and never re-requests new data.
The HTTP protocol makes requests using HTTP verbs. It should be
constructed with a url that corresponds to a collection of features
(a resource on some server).
The GML format is used to serialize features.
</div>
</body>
</html>

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers Boxes Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var box_extents = [
@@ -53,7 +47,7 @@
Demonstrate marker and box type annotations on a map.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers Boxes Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var box_extents = [
@@ -52,7 +46,7 @@
Demonstrate marker and box type annotations on a map.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>

View File

@@ -0,0 +1,89 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers 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">
// making this a global variable so that it is accessible for
// debugging/inspecting in Firebug
var map = null;
function init(){
//set title name to include Browser Detection
// this is the only way to test the functionality
// of the getBrowserName() function
//
var header = OpenLayers.Util.getElement("browserHeader");
header.innerHTML = "(browser: ";
var browserCode = OpenLayers.Util.getBrowserName();
switch (browserCode) {
case "opera":
browserName = "Opera";
break;
case "msie":
browserName = "Internet Explorer";
break;
case "safari":
browserName = "Safari";
break;
case "firefox":
browserName = "FireFox";
break;
case "mozilla":
browserName = "Mozilla";
break;
default:
browserName = "detection error"
break;
}
header.innerHTML += browserName + ")";
map = new OpenLayers.Map('map');
var options = {
resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101]
};
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'},
options);
var options2 = {
resolutions: [0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101]
};
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"}, options2);
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
"prov_bound,fedlimit,rail,road,popplace",
transparent: "true", format: "image/png"},
{minResolution: 0.17578125,
maxResolution: 0.703125});
map.addLayers([ol_wms, jpl_wms, dm_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<h1 id="title" style="display:inline;">Example Showing Browser Name</h1>
<h3 id="browserHeader" style="display:inline;"></h3>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate a simple map that shows the browser name.
</p>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers Buffer Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 0;
@@ -45,7 +39,7 @@
This example shows the use of the buffer layer option for any layer that inherits from OpenLayers.Layer.Grid.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
Use the buffer property to control how many tiles are included

View File

@@ -3,6 +3,7 @@
<title>OpenLayers Click Handler 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: 340px;
@@ -161,7 +162,7 @@
This example shows the use of the click handler.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<p>
The click handler can be used to gain more flexibility over handling
click events. The handler can be constructed with options to handle

View File

@@ -3,16 +3,10 @@
<title>OpenLayers Click Event Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
defaultHandlerOptions: {
'single': true,
'double': false,
@@ -30,7 +24,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
);
this.handler = new OpenLayers.Handler.Click(
this, {
'click': this.trigger,
'click': this.trigger
}, this.handlerOptions
);
},
@@ -39,7 +33,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
var lonlat = map.getLonLatFromViewPortPx(e.xy);
alert("You clicked near " + lonlat.lat + " N, " +
+ lonlat.lon + " E");
},
}
});
var map;
@@ -78,7 +72,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
Using the Click handler allows you to (for example) catch clicks without catching double clicks, something that standard browser events don't do for you. (Try double clicking: you'll zoom in, whereas using the browser click event, you would just get two alerts.) This example click control shows you how to use it.

View File

@@ -3,28 +3,27 @@
<title>OpenLayers Map Controls Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<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', { controls: [] });
map = new OpenLayers.Map('map', {
controls: [
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.MouseToolbar(),
new OpenLayers.Control.LayerSwitcher({'ascending':false}),
new OpenLayers.Control.Permalink(),
new OpenLayers.Control.ScaleLine(),
new OpenLayers.Control.Permalink('permalink'),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.OverviewMap(),
new OpenLayers.Control.KeyboardDefaults()
],
numZoomLevels: 6
});
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.MouseToolbar());
map.addControl(new OpenLayers.Control.LayerSwitcher({'ascending':false}));
map.addControl(new OpenLayers.Control.Permalink());
map.addControl(new OpenLayers.Control.ScaleLine());
map.addControl(new OpenLayers.Control.Permalink('permalink'));
map.addControl(new OpenLayers.Control.MousePosition());
map.addControl(new OpenLayers.Control.OverviewMap());
map.addControl(new OpenLayers.Control.KeyboardDefaults());
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
@@ -57,7 +56,7 @@
</p>
<a style="float:right" href="" id="permalink">Permalink</a>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers Custom Control Point Examle</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
@@ -54,7 +48,7 @@
Demonstrate the addition of a point reporting control to the OpenLayers window.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="bounds"></div>
<div id="docs"></div>

View File

@@ -2,13 +2,7 @@
<head>
<title>Custom Control Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
@@ -58,7 +52,7 @@
Demonstrate the addition of a draggable rectangle to the OpenLayers window.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>

View File

@@ -3,12 +3,8 @@
<title>Custom Style 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: 512px;
height: 512px;
border: 1px solid gray;
}
p {
width: 500px;
}
@@ -47,7 +43,7 @@
Demonstrate changing CSS styles on controls in the OpenLayers window.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>If you care to modify the style of any OpenLayers element, include

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Debug Example</title>
<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">

View File

@@ -4,12 +4,7 @@
<script src="../lib/OpenLayers.js"></script>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width:512px;
height:521px;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<h1 id="title">Double Set Center Example</h1>
@@ -20,7 +15,7 @@
Demonstrate the behavior of two calls to set the center after instatiating the layer object.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');

View File

@@ -3,12 +3,8 @@
<title>Drag Feature 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: 512px;
height: 512px;
border: 1px solid gray;
}
#controls {
width: 512px;
}
@@ -72,7 +68,7 @@
Demonstrates point, line and polygon creation and editing.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="controls">
<ul id="controlToggle">

View File

@@ -3,12 +3,8 @@
<title>Draw Feature 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: 512px;
height: 512px;
border: 1px solid gray;
}
#controlToggle li {
list-style: none;
}
@@ -74,7 +70,7 @@
Demonstrate on-screen digitizing tools for point, line, and polygon creation.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<ul id="controlToggle">
<li>

View File

@@ -2,6 +2,7 @@
<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" />
<style type="text/css">
.olControlEditingToolbar {
float:left;
@@ -9,11 +10,6 @@
height: 30px;
width: 150px;
}
#map {
width: 512px;
height: 256px;
border: 1px solid gray;
}
</style>
<script src="../lib/Firebug/firebug.js"></script>
<script src="../lib/OpenLayers.js"></script>
@@ -45,8 +41,11 @@
</script>
</head>
<body onload="init()">
<h3>OpenLayers EditingToolbar Outside Viewport</h3>
<div id="map"></div>
<h1 id="title">OpenLayers EditingToolbar Outside Viewport</h1>
<p id="shortdesc">
Display an editing toolbar panel outside the map viewport.
</p>
<div id="map" class="smallmap"></div>
<div id="panel" class="olControlEditingToolbar"></div>
</body>
</html>

View File

@@ -4,13 +4,7 @@
<title>OpenLayers Editing Toolbar Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script src="../lib/Firebug/debug.js"></script>
<script type="text/javascript">
@@ -20,15 +14,17 @@
var map, layer;
function init(){
map = new OpenLayers.Map( 'map', { controls: [] } );
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
vlayer = new OpenLayers.Layer.Vector( "Editable" );
map.addLayer(vlayer);
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.EditingToolbar(vlayer));
map = new OpenLayers.Map( 'map', {
controls: [
new OpenLayers.Control.PanZoom(),
new OpenLayers.Control.EditingToolbar(vlayer)
]
});
map.addLayers([layer, vlayer]);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
}
@@ -44,7 +40,7 @@
</p>
<div id="panel"></div>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>

View File

@@ -1,12 +1,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Event Handling</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 256px;
border: 1px solid gray;
}
#panel {
margin: 5px;
height: 30px;
@@ -146,7 +142,7 @@
Demonstrating various styles of event handling in OpenLayers.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="panel"></div>
<textarea id="output"></textarea>
<div id="docs"></div>

239
examples/example-list.html Normal file
View File

@@ -0,0 +1,239 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html>
<head>
<!-- This is the example list source: if you are trying to look at the
source of an example, YOU ARE IN THE WRONG PLACE. If you want to view
the source of just one example, you can typically choose
"This Frame -> View source" when right clicking on the exmaple. If not,
choose to open the example in a new window (via the context menu
click on the link), and view source from there. -->
<title>OpenLayers Examples</title>
<link rel="alternate" href="example-list.xml" type="application/atom+xml" />
<link rel="stylesheet" href="style.css" type="text/css" />
<style type="text/css">
html, body {
height: 100%;
overflow: hidden;
margin: 0;
padding: 0;
line-height: 1.25em;
}
.ex_container{
border-bottom: 1px solid #cccccc;
}
.ex_container a {
text-decoration: none;
padding: 5px 1em;
display: block;
}
.ex_container a:hover {
background-color: #eeeeee;
}
.ex_title{
display: inline;
font-weight: bold;
color: #333;
}
.ex_filename {
font-weight: normal;
font-size: 0.8em;
color: #ccc
}
.ex_description{
color: #222;
padding: 3px;
}
.ex_classes{
font-size: .7em;
color: grey;
display: none;
}
#toc {
width: 30%;
height: 100%;
}
#filter {
top: 0px;
height: 50px;
padding: 10px 1em 10px 1em;
}
#examples {
border-top: 1px solid #cccccc;
position: absolute;
width: 30%;
top: 70px;
bottom: 0px;
overflow: auto;
list-style: none;
margin: 0;
padding: 0;
}
#examples ul {
list-style: none;
margin: 0;
padding: 0;
}
#examples ul li {
display: block;
margin: 0;
padding: 0;
}
#exwin {
position: absolute;
top: 0;
left: 30%;
width: 70%;
height: 100%;
border: none;
border-left: 1px solid #cccccc;
margin: 0;
}
</style>
<script type="text/javascript" src="Jugl.js"></script>
<script type="text/javascript" src="example-list.js"></script>
<script type="text/javascript">
// import
var Jugl = window["http://jugl.tschaub.net/trunk/lib/Jugl.js"];
var template, target;
function listExamples(examples) {
target.innerHTML = "";
var node = template.process({
context: {examples: examples},
clone: true,
parent: target
});
document.getElementById("count").innerHTML = "(" + examples.length + ")";
}
var timerId;
function inputChange() {
if(timerId) {
window.clearTimeout(timerId);
}
var text = this.value;
timerId = window.setTimeout(function() {
filterList(text);
}, 500);
}
function filterList(text) {
var examples;
if(text.length < 2) {
examples = info.examples;
} else {
var words = text.split(/\W+/);
var scores = {};
for(var i=0; i<words.length; ++i) {
var word = words[i].toLowerCase()
var dict = info.index[word];
if(dict) {
for(exIndex in dict) {
var count = dict[exIndex];
if(scores[exIndex]) {
if(scores[exIndex][word]) {
scores[exIndex][word] += count;
} else {
scores[exIndex][word] = count;
}
} else {
scores[exIndex] = {};
scores[exIndex][word] = count;
}
}
}
}
examples = [];
for(var j in scores) {
var ex = info.examples[j];
ex.score = scores[j];
examples.push(ex);
}
// sort examples by first by number of words matched, then
// by word frequency
examples.sort(function(a, b) {
var cmp;
var aWords = 0, bWords = 0;
var aScore = 0, bScore = 0;
for(var i in a.score) {
aScore += a.score[i];
aWords += 1;
}
for(var j in b.score) {
bScore += b.score[j];
bWords += 1;
}
if(aWords == bWords) {
cmp = bScore - aScore;
} else {
cmp = bWords - aWords;
}
return cmp;
});
}
listExamples(examples);
}
function showAll() {
document.getElementById("keywords").value = "";
listExamples(info.examples);
}
function parseQuery() {
var params = {};
var list = window.location.search.substring(1).split("&");
for(var i=0; i<list.length; ++i) {
var pair = list[i].split("=");
if(pair.length == 2) {
params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
}
}
if(params["q"]) {
var input = document.getElementById("keywords");
input.value = params["q"];
inputChange.call(input);
}
}
window.onload = function() {
template = new Jugl.Template("template");
target = document.getElementById("examples");
listExamples(info.examples);
document.getElementById("exwin").src = "../examples/example.html";
document.getElementById("keywords").onkeyup = inputChange
parseQuery();
};
</script>
</head>
<body>
<div id="toc">
<div id="filter">
<p>
<label for="keywords">Filter by keywords</label><br />
<input type="text" id="keywords" />
<span id="count"></span><br />
<a href="javascript:void showAll();">show all</a>
</p>
</div>
<div id="examples"></div>
</div>
<iframe id="exwin" name="exwin" frameborder="0"></iframe>
<div style="display: none;">
<ul id="template">
<li class="ex_container" jugl:repeat="example examples">
<a jugl:attributes="href example.link" target="exwin">
<h5 class="ex_title">
<span jugl:replace="example.title">title</span><br />
<span class="ex_filename" jugl:content="'(' + example.example + ')'">filename</span>
</h5>
<div class="ex_description" jugl:content="example.shortdesc">
Short Description goes here
</div>
<p class="ex_classes" jugl:content="example.classes">
Related Classes go here
</p>
</a>
</li>
</ul>
</div>
</body>
</html>

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
// making this a global variable so that it is accessible for
@@ -17,79 +11,46 @@
function init(){
//set title name to include Browser Detection
// this is the only way to test the functionality
// of the getBrowserName() function
//
var header = OpenLayers.Util.getElement("browserHeader");
header.innerHTML = "(browser: ";
var browserCode = OpenLayers.Util.getBrowserName();
switch (browserCode) {
case "opera":
browserName = "Opera";
break;
case "msie":
browserName = "Internet Explorer";
break;
case "safari":
browserName = "Safari";
break;
case "firefox":
browserName = "FireFox";
break;
case "mozilla":
browserName = "Mozilla";
break;
default:
browserName = "detection error"
break;
}
header.innerHTML += browserName + ")";
map = new OpenLayers.Map('map');
var options = {
resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101]
};
var ol_wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{layers: 'basic'}
);
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'},
options);
var options2 = {
resolutions: [0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101]
};
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
var jpl_wms = new OpenLayers.Layer.WMS(
"NASA Global Mosaic",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"}, options2);
{layers: "landsat7"}
);
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
var dm_wms = new OpenLayers.Layer.WMS(
"DM Solutions Demo",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
{
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});
{
minResolution: 0.17578125,
maxResolution: 0.703125
}
);
map.addLayers([ol_wms, jpl_wms, dm_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<h1 id="title" style="display:inline;">OpenLayers Example</h1>
<h3 id="browserHeader" style="display:inline;"></h3>
<h1 id="title">OpenLayers Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate a simple map with an overlay that includes layer switching controls.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,13 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 256px;
border: 1px solid gray;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
@@ -51,7 +45,7 @@
Shows the use of a map with fractional (or non-discrete) zoom levels.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<input type="checkbox" name="fractional"
id="fractional" checked="checked" onclick="update(this)" />
<label for="fractional">Fractional Zoom</label>

View File

@@ -1,19 +1,21 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Full Screen 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">
body {
margin: 0;
}
#map {
width: 100%;
height: 100%;
border: 1px solid black;
}
#text {
position: absolute;
bottom: 0px;
left:0px;
bottom: 1em;
left: 1em;
width: 512px;
}
</style>

View File

@@ -1,52 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Full Screen Example 2</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 100%;
height: 100%;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init(){
map = new OpenLayers.Map('map');
var options = {numZoomLevels: 3};
var docImage = new OpenLayers.Layer.Image(
'Full Screen',
'fullscreen.jpg',
new OpenLayers.Bounds(-156, -90, 156, 90),
new OpenLayers.Size(1121, 650),
options);
map.addLayers([docImage]);
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<div id="map"></div>
<div id="text">
<h1 id="title">Full Screen Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate a map that fill the entire browser window.
</p>
<div id="docs">
This example uses CSS to define the dimensions of the map element in order to fill the screen.
When the user resizes the window, the map size changes correspondingly. No scroll bars!
</div>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

View File

@@ -1,13 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
@@ -62,6 +56,7 @@
</script>
</head>
<body onload="init()">
<div id="map"></div>
<h1 id="title">GeoJSON Example</h1>
<div id="map" class="smallmap"></div>
</body>
</html>

View File

@@ -1,13 +1,8 @@
<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" />
<style type="text/css">
#map {
width: 800px;
height: 400px;
border: 1px solid black;
}
.olPopupContent {
font-size: smaller;
}
@@ -31,28 +26,48 @@
// the thumbail attribute of the rss item
style = new OpenLayers.Style({externalGraphic: "${thumbnail}"});
// make the thumbnails larger when we select them
selectStyle = new OpenLayers.Style({pointRadius: 35});
// create a rule with a point symbolizer that will make the thumbnail
// larger if the title of the rss item conatins "powder"
var rule = new OpenLayers.Rule.Comparison({
type: OpenLayers.Rule.Comparison.LIKE,
// larger if the title of the rss item contains "powder"
var rule = new OpenLayers.Rule({
symbolizer: {pointRadius: 30},
filter: new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.LIKE,
property: "title",
value: "*powder*",
symbolizer: {"Point": {pointRadius: 30}}});
rule.value2regex("*");
value: "*powder*"
})
});
rule.filter.value2regex("*");
// If the above rule does not apply, use a smaller pointRadius.
var elseRule = new OpenLayers.Rule({
elseFilter: true,
symbolizer: {"Point": {pointRadius: 20}}});
symbolizer: {pointRadius: 20}
});
style.addRules([rule, elseRule]);
markerLayer = new OpenLayers.Layer.Vector("", {styleMap: new OpenLayers.StyleMap({
// Create a GML layer with GeoRSS format and a style map.
markerLayer = new OpenLayers.Layer.GML("Some images from Flickr",
"xml/georss-flickr.xml", {
format: OpenLayers.Format.GeoRSS,
formatOptions: {
// adds the thumbnail attribute to the feature
createFeatureFromItem: function(item) {
var feature = OpenLayers.Format.GeoRSS.prototype
.createFeatureFromItem.apply(this, arguments);
feature.attributes.thumbnail =
this.getElementsByTagNameNS(
item, "*", "thumbnail")[0].getAttribute("url");
return feature;
}
},
// Giving the style map keys for "default" and "select"
// rendering intent, to make the image larger when selected
styleMap: new OpenLayers.StyleMap({
"default": style,
"select": selectStyle})});
"select": new OpenLayers.Style({pointRadius: 35})
})
});
map.addLayer(markerLayer);
// control that will show a popup when clicking on a thumbnail
@@ -74,36 +89,12 @@
map.addControl(popupControl);
popupControl.activate();
OpenLayers.loadURL("xml/georss-flickr.xml", null, window, afterload);
}
function afterload(req) {
// extended version of OpenLayers.Format.GeoRSS.createFeatureFromItem;
// adds the thumbnail attribute to the feature
function createFeatureFromItem(item) {
var feature = OpenLayers.Format.GeoRSS.prototype
.createFeatureFromItem.apply(this, arguments);
feature.attributes.thumbnail =
this.getElementsByTagNameNS(
item, "*", "thumbnail")[0].getAttribute("url");
return feature;
}
var store = new OpenLayers.Format.GeoRSS({
createFeatureFromItem: createFeatureFromItem});
rss = store.read(req.responseText);
markerLayer.setName("Some images from Flickr");
markerLayer.addFeatures(rss);
}
</script>
</head>
<body onload="init()">
<h1>GeoRSS from Flickr in OpenLayers</h1>
<h1 id="title">GeoRSS from Flickr in OpenLayers</h1>
<p>The displayed GeoRSS feed has a <tt>&lt;media:thumbnail/&gt;</tt> property for each item. An extended <tt>createFeatureFromItem()</tt> function is used to add this attribute to the attributes hash of each feature read in by <tt>OpenLayers.Format.GeoRSS</tt>. The example is configured with a style to render each item with its thumbnail image. Also, to show how rules work, we defined a rule that if the title of an rss item contains "powder", it will be rendered larger than the others.</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
</body>
</html>

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers GeoRSS Marker Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
@@ -38,7 +32,7 @@
Demonstrate loading a GeoRSS feed using the GeoRSS parser.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>

View File

@@ -1,58 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers GeoRSS Serialize Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid gray;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, drawControl, g;
function serialize(feature) {
feature.attributes = {};
var name = prompt("Title for feature?");
feature.attributes['title'] = name;
var data = g.write(feature.layer.features);
OpenLayers.Util.getElement("gml").value = data;
}
function init(){
g = new OpenLayers.Format.GeoRSS();
map = new OpenLayers.Map('map');
var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
var pointLayer = new OpenLayers.Layer.Vector("Point Layer");
pointLayer.onFeatureInsert = serialize;
map.addLayers([wmsLayer, pointLayer]);
map.addControl(new OpenLayers.Control.EditingToolbar(pointLayer));
map.addControl(new OpenLayers.Control.MousePosition());
map.setCenter(new OpenLayers.LonLat(0, 0), 3);
}
</script>
</head>
<body onload="init()">
<h1 id="title">Draw Point Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate serialization of features in a Vector layer to GeoRSS.
</p>
<div style="float:right;width:50%">
<textarea id="gml" style="width:100%" rows="30"></textarea>
</div>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers GeoRSS Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
@@ -41,7 +35,7 @@
Display a couple of locally cached georss feeds on an a basemap.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>This demo uses the OpenLayers GeoRSS parser, which supports GeoRSS Simple and W3C GeoRSS. Only points are

View File

@@ -3,6 +3,7 @@
<title>OpenLayers Feature Info Example</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" />
<style type="text/css">
ul, li { padding-left: 0px; margin-left: 0px; }
</style>
@@ -24,7 +25,7 @@
<div id="nodeList">
</div>
</div>
<div id="map" style="width:512px; height:512px"></div>
<div id="map" class="smallmap"></div>
<script defer="defer" type="text/javascript">
OpenLayers.ProxyHost = "/dev/examples/proxy.cgi?url=";

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers GML Layer Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
@@ -35,7 +29,7 @@
Loads locally stored GML vector data on a basemap. Includes GML example file.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>

View File

@@ -1,97 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers GML Serialization Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 350px;
border: 1px solid gray;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, drawControl, g;
function serialize(feature) {
feature.attributes = {};
var name = prompt("Name for feature?");
feature.attributes['name'] = name;
var data = g.write(feature.layer.features);
OpenLayers.Util.getElement("gml").value = data;
}
function init(){
g = new OpenLayers.Format.GML();
map = new OpenLayers.Map('map');
var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
var pointLayer = new OpenLayers.Layer.Vector("Point Layer");
pointLayer.onFeatureInsert = serialize;
map.addLayers([wmsLayer, pointLayer]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.MousePosition());
drawControls = {
point: new OpenLayers.Control.DrawFeature(pointLayer,
OpenLayers.Handler.Point),
line: new OpenLayers.Control.DrawFeature(pointLayer,
OpenLayers.Handler.Path)
};
for(var key in drawControls) {
map.addControl(drawControls[key]);
}
map.setCenter(new OpenLayers.LonLat(0, 0), 3);
}
function toggleControl(element) {
for(key in drawControls) {
var control = drawControls[key];
if(element.value == key && element.checked) {
control.activate();
} else {
control.deactivate();
}
}
}
</script>
</head>
<body onload="init()">
<h1 id="title">GML Serialization Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate the serialization of features drawn in the OpenLayers window.
</p>
<div style="float:right">
<ul id="controlToggle">
<li>
<input type="radio" name="type" value="none" id="noneToggle"
onclick="toggleControl(this);" checked="checked" />
<label for="noneToggle">navigate</label>
</li>
<li>
<input type="radio" name="type" value="point" id="pointToggle" onclick="toggleControl(this);" />
<label for="pointToggle">draw point</label>
</li>
<li>
<input type="radio" name="type" value="line" id="lineToggle" onclick="toggleControl(this);" />
<label for="lineToggle">draw line</label>
</li>
</ul>
<p>Check the box to draw points. Uncheck to navigate normally.</p>
<textarea id="gml" cols="80" rows="30"></textarea>
</div>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -2,14 +2,7 @@
<head>
<title>OpenLayers Google with Overlay Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
<script src="../lib/OpenLayers.js"></script>
@@ -38,7 +31,6 @@
map.setCenter(new OpenLayers.LonLat(10.205188,48.857593), 5);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
map.addControl( new OpenLayers.Control.PanZoomBar() );
}
</script>
</head>
@@ -51,7 +43,7 @@
Demonstrate a Google basemap used with boundary overlay layer.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
An overlay in a Geographic projection can be stretched to somewhat

View File

@@ -2,14 +2,7 @@
<head>
<title>OpenLayers Google Layer Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
<script src="../lib/OpenLayers.js"></script>
@@ -52,7 +45,7 @@
Demonstrate use of the various types of Google layers.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
For best performance, you must be using a version of the Google Maps

View File

@@ -0,0 +1,83 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Graphic Names</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');
// list of well-known graphic names
var graphics = ["star", "cross", "x", "square", "triangle", "circle"];
// Create one feature for each well known graphic.
// Give features a type attribute with the graphic name.
var num = graphics.length;
var slot = map.maxExtent.getWidth() / num;
var features = Array(num);
for(var i=0; i<graphics.length; ++i) {
lon = map.maxExtent.left + (i * slot) + (slot / 2);
features[i] = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(
map.maxExtent.left + (i * slot) + (slot / 2), 0
), {
type: graphics[i]
}
);
}
// Create a style map for painting the features.
// The graphicName property of the symbolizer is evaluated using
// the type attribute on each feature (set above).
var styles = new OpenLayers.StyleMap({
"default": {
graphicName: "${type}",
pointRadius: 10,
strokeColor: "fuchsia",
strokeWidth: 2,
fillColor: "lime",
fillOpacity: 0.6
},
"select": {
pointRadius: 20,
fillOpacity: 1
}
});
// Create a vector layer and give it your style map.
var layer = new OpenLayers.Layer.Vector(
"Graphics", {styleMap: styles, isBaseLayer: true}
);
layer.addFeatures(features);
map.addLayer(layer);
// Create a select feature control and add it to the map.
var select = new OpenLayers.Control.SelectFeature(layer, {hover: true});
map.addControl(select);
select.activate();
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
}
</script>
</head>
<body onload="init()">
<h1 id="title">Named Graphics Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Shows how to use well-known graphic names.
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
OpenLayers supports well-known names for a few graphics. You can use
the names "star", "cross", "x", "square", "triangle", and "circle" as
the value for the graphicName property of a symbolizer.
</div>
</body>
</html>

View File

@@ -2,12 +2,8 @@
<head>
<title>OpenLayers Gutter 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: 521px;
height: 512px;
border: 1px solid gray;
}
p.caption {
width: 512px;
}
@@ -43,7 +39,7 @@
Demonstrates map tiling artifacts, and OpenLayer's facility for correcting this distortion.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
<p class="caption">

View File

@@ -2,7 +2,7 @@
<head>
<title>OpenLayers Hover Handler 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: 340px;
@@ -149,7 +149,7 @@
This example shows the use of the hover handler.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<p>
The hover handler is to be used to emulate mouseovers on
objects on the map that aren't DOM elements. For example

View File

@@ -2,15 +2,11 @@
<head>
<title>OpenLayers Image Layer 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">
p {
p.caption {
width: 512px;
}
#map {
width: 512px;
height: 512px;
border: 1px solid gray;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
@@ -46,10 +42,10 @@
Demonstrate a single non-tiled image as a selectable base layer.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
<p class="caption">
The "City Lights" layer above is created from a single web accessible
image. If you construct it without any resolution related options,
the layer will be given a single resolution based on the extent/size.

View File

@@ -2,6 +2,7 @@
<head>
<title>Geometry Intersections</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">
html, body {
margin: 0;
@@ -159,8 +160,11 @@
</head>
<body onload="init()">
<div id="leftcol">
<h2>OpenLayers Geometry Intersection Example</h2>
<div id="map"></div>
<h1 id="title">OpenLayers Geometry Intersection Example</h1>
<p id="shortdesc">
Use of geometry.intersects method for testing geometry intersections.
</p>
<div id="map" class="smallmap"></div>
<div id="input">
<textarea id="text"></textarea>
<input type="button" value="add feature" onclick="deserialize();" />

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers KaMap Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
@@ -38,7 +32,7 @@
Demonstrate a tiled kamap layer as the base map, which can be pre-cached for higher performance.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>

View File

@@ -1,13 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
@@ -41,7 +35,7 @@
Demonstrates loading and displaying a KML file on top of a basemap.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>

View File

@@ -2,15 +2,11 @@
<head>
<title>OpenLayers Layer Opacity 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">
body {
font-family: sans-serif;
}
#map {
width: 512px;
height: 512px;
border: 1px solid lightgray;
}
p {
width: 512px;
}
@@ -49,23 +45,20 @@
}
function init(){
var options = {
projection: "EPSG:26912",
units: 'm',
maxExtent: new OpenLayers.Bounds(455402, 4967657, 473295, 4984095),
maxResolution: 'auto',
maxZoomLevel: 8
maxExtent: new OpenLayers.Bounds(-110.994, 45.885, -110.950, 45.929),
maxResolution: "auto"
};
map = new OpenLayers.Map('map', options);
var drg = new OpenLayers.Layer.WMS("Topo Maps",
"http://terraservice.net/ogcmap.ashx",
{layers: "DRG"});
shade = new OpenLayers.Layer.WMS("Shaded Relief",
"http://ims.cr.usgs.gov/servlet19/com.esri.wms.Esrimap/USGS_EDC_Elev_NED_3",
"http://gisdata.usgs.gov/wmsconnector/com.esri.wms.Esrimap?ServiceName=USGS_EDC_Elev_NED_3",
{layers: "HR-NED.IMAGE", reaspect: "false", transparent: 'true'},
{isBaseLayer: false, opacity: 0.3});
map.addLayers([drg, shade]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(464348.5,4975876), 1);
map.zoomToMaxExtent();
}
</script>
</head>
@@ -78,7 +71,7 @@
Demonstrate a change in the opacity for an overlay layer.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>

View File

@@ -2,12 +2,8 @@
<head>
<title>OpenLayers Layer Load Monitoring 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: 512px;
height: 512px;
border: 1px solid black;
}
#controls {
float: left;
text-align: right;

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers Layer Switcher Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
@@ -50,8 +44,8 @@
Demonstrates the use of the LayerSwitcher outside of the OpenLayers window.
</p>
<div id="layerswitcher" style="float:right; width: 20em;"></div>
<div id="map"></div>
<div id="layerswitcher"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>This demonstrates use of the LayerSwitcher outside the map div. It also shows use
of the displayInLayerSwitcher option on the Layer to cause it to not display in the

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers Basic Single WMS Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
@@ -29,7 +23,7 @@
<div id="shortdesc">Show a Simple Map</div>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
This example shows a very simple layout with minimal controls. This example uses a single WMS base layer.

View File

@@ -1,5 +1,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers MapGuide Layer 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: 400px;
@@ -18,14 +21,24 @@
<script type="text/javascript">
var map, layer;
var url = "http://demo01.dmsolutions.ca/mapguide/mapagent/mapagent.fcgi";
var url = "http://demo01.dmsolutions.ca/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&";
//you can use this URL when MapGuide OS is installed locally
//var url = "/mapguide/mapagent/mapagent.fcgi";
//Adjust the scale assumptions for MapGuide layers
//Tiled layers MUST use a DPI value of 96, untiled layers can use a
//different DPI value which will be passed to the server as a parameter.
//Tiled and untiled layers must adjust the OL INCHES_PER_UNIT values
//for any degree-based projections.
var metersPerUnit = 111319.4908; //value returned from mapguide
var inPerUnit = OpenLayers.INCHES_PER_UNIT.m * metersPerUnit;
OpenLayers.INCHES_PER_UNIT["dd"] = inPerUnit;
OpenLayers.INCHES_PER_UNIT["degrees"] = inPerUnit;
OpenLayers.DOTS_PER_INCH = 96;
//tiled version
function initTiled(){
OpenLayers.DOTS_PER_INCH = 96;
var extent = new OpenLayers.Bounds(-3631568.75,-1293815.5,4491139.5833333321,4937122);
var tempScales = [50000000,23207944.16806,10772173.45016,5000000,2320794.41681,1077217.34502,500000,232079.44168,107721.7345,50000];
var mapOptions = {
@@ -52,7 +65,6 @@
//un-tiled version
function initUntiled() {
OpenLayers.DOTS_PER_INCH = 96;
var extent = new OpenLayers.Bounds(-87.865114442365922,43.665065564837931,-87.595394059497067,43.823852564430069);
var mapOptions = {
maxExtent: extent,
@@ -94,6 +106,14 @@
var params = {
mapName: 'Sheboygan',
session: '0b8cb80e-0000-1000-8003-0017a4e6ff5d_en_C0A802AD0AFC0AFB0AFA',
mapName: 'Sheboygan',
session: '0b8cb80e-0000-1000-8003-0017a4e6ff5d_en_C0A802AD0AFC0AFB0AFA',
version: '2.0.0',
selectioncolor: '0xFF0000',
behavior: 7
};
layer = new OpenLayers.Layer.MapGuide( "MapGuide OS Overlay layer", url, params, options );
map.addLayer(layer);
@@ -103,8 +123,17 @@
</script>
</head>
<body onload="initUntiled(); initTiled()">
<h1 id="title">MapGuide Layer Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Demonstrates how to create MapGuide tiled and untiled layers.
</p>
<p>If prompted for a password, username is Anonymous and an empty password</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="map2"></div>
</body>
</html>

View File

@@ -2,13 +2,7 @@
<head>
<title>MapServer Layer</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
@@ -33,7 +27,7 @@
<div id="title">MapServer Layer</div>
<div id="tags"></div>
<div id="shortdesc">Shows MapServer Layer</div>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
This is an example of using a MapServer Layer with a gutter parameter. The gutter parameter is used to try to limit the edge effects between tiles.
</div>

View File

@@ -2,6 +2,7 @@
<head>
<title>MapServer Single Tile Mode</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: 100%;
@@ -26,7 +27,7 @@
<div id="title">MapServer Single Tile Mode</div>
<div id="tags"></div>
<div id="shortdesc">Shows single tile MapServer Layer</div>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
This shows an example of using a MapServer Layer in single tile mode. Single tile mode can be useful when pulling data from dynamic sources.
</div>

141
examples/marker-shadow.html Normal file
View File

@@ -0,0 +1,141 @@
<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" />
<style type="text/css">
.smallmap {
width: 300px;
}
.docs {
padding: 0px 5px;
}
td {
vertical-align: top;
}
</style>
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
<script type="text/javascript">
var SHADOW_Z_INDEX = 10;
var MARKER_Z_INDEX = 11;
var DIAMETER = 200;
var NUMBER_OF_FEATURES = 15;
var map, layer;
function init() {
map = new OpenLayers.Map("map");
layer = new OpenLayers.Layer.Vector(
"Marker Drop Shadows",
{
styleMap: new OpenLayers.StyleMap({
// Set the external graphic and background graphic images.
externalGraphic: "../img/marker-gold.png",
backgroundGraphic: "./marker_shadow.png",
// Makes sure the background graphic is placed correctly relative
// to the external graphic.
backgroundXOffset: 0,
backgroundYOffset: -7,
// Set the z-indexes of both graphics to make sure the background
// graphics stay in the background (shadows on top of markers looks
// odd; let's not do that).
graphicZIndex: MARKER_Z_INDEX,
backgroundGraphicZIndex: SHADOW_Z_INDEX,
pointRadius: 10
}),
isBaseLayer: true,
rendererOptions: {yOrdering: true}
}
);
map.addLayers([layer]);
// Add a drag feature control to move features around.
var dragFeature = new OpenLayers.Control.DragFeature(layer);
map.addControl(dragFeature);
dragFeature.activate();
map.zoomToMaxExtent();
drawFeatures();
}
function drawFeatures() {
layer.removeFeatures(layer.features);
// Create features at random around the center.
var center = map.getViewPortPxFromLonLat(map.getCenter());
// Add the ordering features. These are the gold ones that all have the same z-index
// and succomb to y-ordering.
var features = [];
for (var index = 0; index < NUMBER_OF_FEATURES; index++) {
// Calculate a random x/y. Subtract half the diameter to make some
// features negative.
var x = (parseInt(Math.random() * DIAMETER)) - (DIAMETER / 2);
var y = (parseInt(Math.random() * DIAMETER)) - (DIAMETER / 2);
var pixel = new OpenLayers.Pixel(center.x + x, center.y + y);
var lonLat = map.getLonLatFromViewPortPx(pixel);
features.push(
new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
)
);
}
layer.addFeatures(features);
}
</script>
</head>
<body onload="init()">
<h1 id="title">Marker Shadows using Background Graphics/Z-Indexes</h1>
<div id="tags">
</div>
<p id="shortdesc">
This example shows off marker shadows using background graphics and z-indexes. Move the features around to show the shadows' interaction.
</p>
<br>
<table>
<tr>
<td>
<div id="map" class="smallmap"></div>
</td>
<td>
<div class="docs">
The features in this map were generated at random. Each of these features have a <i>backgroundGraphic</i> property set in the style map to add a shadow image. Note that the background graphics are not duplicated features with a different style.
<br><br>
The shadows were set to have a different z-index than the markers themselves, using the <i>backgroundGraphicZIndex</i> property. This makes sure all shadows stay behind the markers, keeping a clean look. The shadows were also placed nicely relative to the external graphic using the <i>backgroundXOffset</i> and <i>backgroundYOffset</i> property.
<br><br>
Y-ordering on the layer is enabled. See the <a href="./ordering.html">ordering example</a>.
</div>
</td>
</tr>
<tr>
<td>
<button onclick="drawFeatures()">Redraw Features</button>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -2,13 +2,7 @@
<head>
<title>Resize a Marker</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
@@ -48,7 +42,7 @@
<div id="title">Resize a Marker</div>
<div id="tags"></div>
<div id="shortdesc">Dynamically resize a marker</div>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
This example shows how to create a OpenLayers.Layer.Markers layer, add an icon, put it into a marker, and add the marker to the layer. Once the marker has been added it is possible to use setSize() on the icon in order to resize the marker.
</div>

BIN
examples/marker_shadow.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

View File

@@ -2,13 +2,7 @@
<head>
<title>Markers Layer Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
@@ -51,7 +45,7 @@
<div id="title">Markers Layer Example</div>
<div id="tags"></div>
<div id="shortdesc">Show markers layer with different markers</div>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
This is an example of an OpenLayers.Layers.Markers layer that shows some examples of adding markers. Also demonstrated is registering a mousedown effect on a marker.
</div>

View File

@@ -2,13 +2,7 @@
<head>
<title>Using a Layer.Text to display markers</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
@@ -35,6 +29,6 @@
The Layer.Text class reads a Tab seperated values file and displays it as markers on
the map.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
</body>
</html>

184
examples/measure.html Normal file
View File

@@ -0,0 +1,184 @@
<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" />
<style type="text/css">
#controlToggle li {
list-style: none;
}
p {
width: 512px;
}
#options {
position: relative;
width: 512px;
}
#output {
float: right;
}
</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');
var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
map.addLayers([wmsLayer]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.MousePosition());
// style the sketch fancy
sketchSymbolizers = {
"Point": {
pointRadius: 4,
graphicName: "square",
fillColor: "white",
fillOpacity: 1,
strokeWidth: 1,
strokeOpacity: 1,
strokeColor: "#333333"
},
"Line": {
strokeWidth: 3,
strokeOpacity: 1,
strokeColor: "#666666",
strokeDashstyle: "dash"
},
"Polygon": {
strokeWidth: 2,
strokeOpacity: 1,
strokeColor: "#666666",
fillColor: "white",
fillOpacity: 0.3
}
};
var style = new OpenLayers.Style();
style.addRules([
new OpenLayers.Rule({symbolizer: this.sketchSymbolizers})
]);
var styleMap = new OpenLayers.StyleMap({"default": style});
var options = {
handlerOptions: {
style: "default", // this forces default render intent
layerOptions: {styleMap: styleMap},
persist: true
}
};
measureControls = {
line: new OpenLayers.Control.Measure(
OpenLayers.Handler.Path, options
),
polygon: new OpenLayers.Control.Measure(
OpenLayers.Handler.Polygon, options
)
};
var control;
for(var key in measureControls) {
control = measureControls[key];
control.events.on({
"measure": handleMeasurements,
"measurepartial": handleMeasurements
});
map.addControl(control);
}
map.setCenter(new OpenLayers.LonLat(0, 0), 3);
document.getElementById('noneToggle').checked = true;
}
function calcVincenty(geometry) {
/**
* Note: this function assumes geographic coordinates and
* will fail otherwise. OpenLayers.Util.distVincenty takes
* two objects representing points with geographic coordinates
* and returns the geodesic distance between them (shortest
* distance between the two points on an ellipsoid) in *kilometers*.
*
* It is important to realize that the segments drawn on the map
* are *not* geodesics (or "great circle" segments). This means
* that in general, the measure returned by this function
* will not represent the length of segments drawn on the map.
*/
var dist = 0;
for (var i = 1; i < geometry.components.length; i++) {
var first = geometry.components[i-1];
var second = geometry.components[i];
dist += OpenLayers.Util.distVincenty(
{lon: first.x, lat: first.y},
{lon: second.x, lat: second.y}
);
}
return dist;
}
function handleMeasurements(event) {
var geometry = event.geometry;
var units = event.units;
var order = event.order;
var measure = event.measure;
var element = document.getElementById('output');
var out = "";
if(order == 1) {
out += "measure: " + measure.toFixed(3) + " " + units;
if (map.getProjection() == "EPSG:4326") {
out += "<br /> Great Circle Distance: " +
calcVincenty(geometry).toFixed(3) + " km *";
}
} else {
out += "measure: " + measure.toFixed(3) + " " + units + "<sup>2</" + "sup>";
}
element.innerHTML = out;
}
function toggleControl(element) {
for(key in measureControls) {
var control = measureControls[key];
if(element.value == key && element.checked) {
control.activate();
} else {
control.deactivate();
}
}
}
</script>
</head>
<body onload="init()">
<h1 id="title">OpenLayers Measure Example</h1>
<p id="shortdesc">
Demonstrates the measure control to measure distances and areas.
</p>
<div id="map" class="smallmap"></div>
<div id="options">
<div id="output">
</div>
<ul id="controlToggle">
<li>
<input type="radio" name="type" value="none" id="noneToggle"
onclick="toggleControl(this);" checked="checked" />
<label for="noneToggle">navigate</label>
</li>
<li>
<input type="radio" name="type" value="line" id="lineToggle" onclick="toggleControl(this);" />
<label for="lineToggle">measure distance</label>
</li>
<li>
<input type="radio" name="type" value="polygon" id="polygonToggle" onclick="toggleControl(this);" />
<label for="polygonToggle">measure area</label>
</li>
</ul>
<p>* Note that the geometries drawn are planar geometries and the
metrics returned by the measure control are planar measures. The
"great circle" distance does not necessarily represent the length
of the segments drawn on the map. Instead, it is a geodesic metric that
represents the cumulative shortest path between all vertices in the
geometry were they projected onto a sphere.</p>
</div>
</body>
</html>

View File

@@ -2,6 +2,7 @@
<head>
<title>MultiMap</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: 100%;
@@ -52,7 +53,7 @@
<p id="shortdesc">
An example of using the Layer.MultiMap class.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div style="background-color:green" onclick="add()"> click to add the marker to the map</div>
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
</body>

View File

@@ -2,12 +2,8 @@
<head>
<title>Modify Feature</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: 512px;
height: 350px;
border: 1px solid gray;
}
#controls {
width: 512px;
}
@@ -33,20 +29,14 @@
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.MousePosition());
var modifyOptions = {
onModificationStart: function(feature) {
OpenLayers.Console.log("start modifying", feature.id);
},
onModification: function(feature) {
OpenLayers.Console.log("modified", feature.id);
},
onModificationEnd: function(feature) {
OpenLayers.Console.log("end modifying", feature.id);
},
onDelete: function(feature) {
OpenLayers.Console.log("delete", feature.id);
function report(event) {
OpenLayers.Console.log(event.type, event.feature.id);
}
};
vectors.events.on({
"beforefeaturemodified": report,
"featuremodified": report,
"afterfeaturemodified": report
});
controls = {
point: new OpenLayers.Control.DrawFeature(vectors,
OpenLayers.Handler.Point),
@@ -57,8 +47,7 @@
regular: new OpenLayers.Control.DrawFeature(vectors,
OpenLayers.Handler.RegularPolygon,
{handlerOptions: {sides: 5}}),
modify: new OpenLayers.Control.ModifyFeature(vectors,
modifyOptions)
modify: new OpenLayers.Control.ModifyFeature(vectors)
};
for(var key in controls) {
@@ -112,7 +101,7 @@
<body onload="init()">
<h3 id="title">OpenLayers Modify Feature Example</h3>
<div id="shortdesc">A demonstration of the ModifyFeature control for editing vector features.</div>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="controls">
<ul id="controlToggle">
<li>

View File

@@ -4,16 +4,7 @@
<head>
<title>MousePosition Control</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
body {
margin: 0;
padding: 0;
}
#map {
width: 512px;
height: 256px;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
@@ -42,7 +33,7 @@
Use the MousePosition Control to display the coordinates of the cursor
inside or outside the map div.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="coords"></div>
<p>Moving your mouse to the upper left corner of this map should return 'x=0,y=0' -- in the past, it didn't in IE. If it returns 2,2, consider it a bug, and report it.</p>
</body>

View File

@@ -2,6 +2,7 @@
<head>
<title>MultiMap SphericalMercator</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: 100%;
@@ -59,6 +60,6 @@
multimap layer does not fully support the sphericalMercator projection at
this time.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
</body>
</html>

View File

@@ -1,13 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
@@ -37,7 +31,7 @@
Load your tiles faster by pointing to the same server, but with different urls
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">
Browsers typically limit the number of concurrent requests to the same server, based on hostname. In order to ake tiles load more quickly, it often makes sense to distribute requests over multiple hostnames to achieve more concurrency. Typically, browsers perform best with 3 different hostnames -- your performance may vary. (For example, if your server can't handle more than 2 requests simultaneously, then additional hostnames will not help you.)
</div>

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers Navigation Control</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
@@ -31,7 +25,7 @@
<div id="shortdesc">Demonstrate Navigation Control features</div>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<a href="#" onclick="nav.enableZoomWheel();return false">Turn on Wheel Zoom</a> | <a href="#" onclick="nav.disableZoomWheel(); return false;">Turn off Wheel Zoom</a>
<div id="docs">
This example demonstrates a couple features of the Navigation control. The Navigation control controls most map dragging, movement, zooming, etc. In this case, we have a demonstration of how to create a navigation control with no zoom wheel action, which can then be enabled or disabled by the user.

View File

@@ -1,12 +1,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Navigation History Example</title>
<style type="text/css">
#map {
width: 512px;
height: 256px;
border: 1px solid gray;
}
<link rel="stylesheet" href="style.css" type="text/css" />
<style>
#panel {
right: 0px;
height: 30px;
@@ -16,24 +12,12 @@
float: left;
margin: 5px;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, nav, panel;
// preload images if you care
var preload = [
"../theme/default/img/view_previous_on.png",
"../theme/default/img/view_next_on.png"
];
var img = new Array(preload.length);
for(var i=0; i<preload.length; ++i) {
img[i] = new Image();
img[i].src = preload[i];
}
function init(){
function init() {
map = new OpenLayers.Map('map');
nav = new OpenLayers.Control.NavigationHistory();
@@ -53,8 +37,6 @@
);
map.addLayer(layer);
map.zoomToMaxExtent();
}
</script>
</head>
@@ -68,7 +50,7 @@
A control for zooming to previous and next map extents.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
Map navigation history controls<div id="panel"></div>
<div id="docs"></div>
</body>

View File

@@ -1,14 +1,11 @@
<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" />
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
#paneldiv {
height: 80px;
}
#paneldiv { float: right }
#paneldiv div {
top: 10px;
}
@@ -35,8 +32,8 @@
</head>
<body onload="init()">
<h1 id="title">Navigation Toolbar: Outside the Map</h1>
<div id="map" class="smallmap"></div>
<div id="paneldiv" class="olControlNavToolbar"></div>
<div id="map"></div>
<div id="docs">
<p> To place the Naviation Toolbar outside the map:</p>
<ul>
@@ -45,20 +42,6 @@
<li>Specify the HTML element as a 'div' option in your NavToolbar constructor</li>
<li>Add the olControlNavToolbar class to your div.</li>
</ul>
<pre id="code">
&lt;link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
&lt;style type="text/css">
#paneldiv { float: right; }
#paneldiv div {
top: 10px;
}
&lt;/style>
&lt;div id="paneldiv" class="olControlNavToolbar">&lt;/div>
...
var panel = new OpenLayers.Control.NavToolbar({'div':OpenLayers.Util.getElement('paneldiv')});
</pre>
</div>
</body>

View File

@@ -1,15 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
float:right;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<title>NavToolbar Demo</title>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
@@ -37,6 +29,6 @@
Demo the NavToolbar, a subclass of Control.Panel which shows icons for
navigation.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
</body>
</html>

View File

@@ -1,13 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#mapDiv {
width: 400px;
height: 400px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
@@ -35,7 +29,7 @@
Create an untiled WMS layer using the singleTile: true, option or the deprecated
WMS.Untiled layer.
</p>
<div id="mapDiv"></div>
<div id="mapDiv" class="smallmap"></div>
<p> The first layer is an old OpenLayers.Layer.WMS.Untiled layer, using
a default ratio value of 1.5.
<p> The second layer is an OpenLayers.Layer.WMS layer with singleTile set

View File

@@ -1,16 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 600px;
height: 475px;
border: 1px solid black;
}
#info {
float: right;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
@@ -118,27 +109,8 @@
</script>
</head>
<body onload="init()">
<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>
<p id="shortdesc">This example shows the use of a WFS service rendered using the OpenLayers vector library.</p>
<div id="map"></div>
<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
@@ -158,5 +130,24 @@
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>

203
examples/ordering.html Normal file
View File

@@ -0,0 +1,203 @@
<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" />
<style type="text/css">
.smallmap {
width: 300px;
}
.docs {
padding: 0px 5px;
}
td {
vertical-align: top;
}
</style>
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
<script type="text/javascript">
var GOLD_Z_INDEX = 15;
var FIRST_RED_Z_INDEX = 10;
var SECOND_RED_Z_INDEX = 11;
var RADIUS_FROM_CENTER = 40;
var POINT_DISTANCE = 10;
function initYOrderMap() {
var map = new OpenLayers.Map("yorder");
var layer = new OpenLayers.Layer.Vector(
"Y-Order",
{
styleMap: new OpenLayers.StyleMap({
externalGraphic: "../img/marker-gold.png",
pointRadius: 10,
graphicZIndex: GOLD_Z_INDEX
}),
isBaseLayer: true,
rendererOptions: {yOrdering: true}
}
);
map.addLayers([layer]);
map.zoomToMaxExtent();
// Add features to the layers to show off z-index/y-ordering.
// We do this after adding the layer so we can work in pixels.
var center = map.getViewPortPxFromLonLat(map.getCenter());
var top = new OpenLayers.Pixel(center.x, center.y - RADIUS_FROM_CENTER);
var bottom = new OpenLayers.Pixel(center.x, center.y + RADIUS_FROM_CENTER);
var left = new OpenLayers.Pixel(center.x - RADIUS_FROM_CENTER, center.y - POINT_DISTANCE / 2);
var right = new OpenLayers.Pixel(center.x + RADIUS_FROM_CENTER, center.y - POINT_DISTANCE / 2);
// Add the ordering features. These are the gold ones that all have the same z-index
// and succomb to y-ordering.
var orderingFeatures = [];
// Note: We use > here on purpose (instead of >= ), as well as subtracting the
// the POINT_DISTANCE in the beginning of the loop (as opposed to the end).
// This is purely for symmetry. Also note that the gold features are drawn
// from bottom to top so as to quickly signal whether or not y-ordering is working.
while (bottom.y > top.y) {
bottom.y -= POINT_DISTANCE;
var lonLat = map.getLonLatFromViewPortPx(bottom);
orderingFeatures.push(
new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
)
);
}
layer.addFeatures(orderingFeatures);
// Add the z-index features. Technically, these features succomb to y-ordering
// as well; however, since they have different z-indexes, the z-indexes take
// precedence.
var indexFeatures = [];
var useFirst = true;
while (left.x <= right.x) {
var lonLat = map.getLonLatFromViewPortPx(left);
var point = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
);
// This is where the magic happens. We override the style on the layer
// to give our own style with alternativing z-indexes.
point.style = {
graphicZIndex: useFirst ? FIRST_RED_Z_INDEX : SECOND_RED_Z_INDEX,
externalGraphic: "../img/marker.png",
pointRadius: 10
}
indexFeatures.push(
point
);
left.x += POINT_DISTANCE;
useFirst = !useFirst;
}
layer.addFeatures(indexFeatures);
}
function initDrawingOrderMap() {
var map = new OpenLayers.Map("drawingorder");
var layer = new OpenLayers.Layer.Vector(
"Drawing Order",
{
// Note there's no z-index set, and yOrdering is left
// to its default.
styleMap: new OpenLayers.StyleMap({
externalGraphic: "../img/marker-green.png",
pointRadius: 10
}),
isBaseLayer: true
}
);
map.addLayers([layer]);
map.zoomToMaxExtent();
// Add features to the layers to show off z-index/y-ordering.
// We do this after adding the layer so we can work in pixels.
var center = map.getViewPortPxFromLonLat(map.getCenter());
var top = new OpenLayers.Pixel(center.x, center.y - RADIUS_FROM_CENTER);
var bottom = new OpenLayers.Pixel(center.x, center.y + RADIUS_FROM_CENTER);
var left = new OpenLayers.Pixel(center.x - RADIUS_FROM_CENTER, center.y);
var right = new OpenLayers.Pixel(center.x + RADIUS_FROM_CENTER, center.y);
// Add the ordering features. These are the gold ones that all have the same z-index
// and succomb to y-ordering.
var orderingFeatures = [];
while (bottom.y > top.y && left.x < right.x) {
var bottomLonLat = map.getLonLatFromViewPortPx(bottom);
var leftLonLat = map.getLonLatFromViewPortPx(left);
orderingFeatures.push(
new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(leftLonLat.lon, bottomLonLat.lat)
)
);
bottom.y -= POINT_DISTANCE / 2; // Divide by 2 for better visual.
left.x += POINT_DISTANCE / 2;
}
layer.addFeatures(orderingFeatures);
}
function init(){
initYOrderMap();
initDrawingOrderMap();
};
</script>
</head>
<body onload="init()">
<h1 id="title">Z-Index/Y-Order Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
This example shows the use of z-indexing and y-ordering of external graphics. Zoom in and out to see this behavior.
</p>
<h3>Z-Index (with Y-Ordering enabled)</h3>
<table>
<tr>
<td>
<div id="yorder" class="smallmap"></div>
</td>
<td>
<div class="docs">
In this map, the gold features all have the same z-index, and the red features have alternating z-indeces. The gold features' z-index is greater than the red features' z-indeces, which is why gold features look to be drawn on top of the red features. Since each gold feature has the same z-index, gold features succomb to y-ordering: this is where features that seem closest to the viewer (lower lattitude) show up above those that seem farther away (higher lattitude).
<br><br>
All vector layers have z-indexing enabled by default, but are not enabled with y-ordering. You can enable y-ordering by passing the parameter <i>yOrdering: true</i> in the vector layer's options hash. For all configurations, if features have the same z-index -- and if y-ordering is enabled: the same lattitude -- those features will succomb to drawing order, where the last feature to be drawn will appear above the rest.
</div>
</td>
</tr>
</table>
<br>
<h3>Drawing Order (no Z-Indexes set, and Y-Ordering disabled)</h3>
<table>
<tr>
<td>
<div id="drawingorder" class="smallmap"></div>
</td>
<td>
<div class="docs">
In this map, features are not given z-indexes, and the layer's <i>yOrdering</i> parameter is set to the default (false). This configuration makes features succomb to drawing order instead of z-index order or y-order.
<br><br>
The features in this map were drawn from left to right and bottom to top, diagonally, to show that y-ordering is not enabled.
</div>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -1,11 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
<link rel="stylesheet" href="style.css" type="text/css" />
<style>
#map {
width: 70%;
height: 475px;
border: 1px solid black;
height: 350px;
}
</style>
<script src="../lib/OpenLayers.js"></script>
@@ -103,7 +102,9 @@
</script>
</head>
<body onload="init()">
<div style="width:28%; float:right" id="download">
<h1 id="title">Advanced OSM Layer</h1>
<div id="map" class="smallmap"></div>
<div id="download">
<ul>
<li><a href="javascript:new_data();">Download current view</a></li>
<li><a href="javascript:clear_data();">Clear current data</a></li>
@@ -111,7 +112,6 @@
</ul>
<div id="status">Loading...</div>
</div>
<div id="map"></div>
<a id="vectorlink" href="" style="display:none">Display via data: URL (FF Only)</a>
<textarea id="vectors" style="display:none;width:100%" rows="10"></textarea>
</body>

View File

@@ -2,11 +2,10 @@
<head>
<title>Using maxResolution to control overlays</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
<link rel="stylesheet" href="style.css" type="text/css" />
<style>
#map {
width: 650px;
height: 550px;
border: 1px solid black;
height: 350px;
}
</style>
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
@@ -20,17 +19,17 @@
function init(){
// Variables
map = new OpenLayers.Map('map', { controls: [] });
map = new OpenLayers.Map('map', {
controls: [
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.LayerSwitcher({'ascending':false}),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.Navigation()
]
});
var lon = 35;
var lat = -6;
var zoom = 6;
var map, layer;
// Map Controls
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.MouseToolbar());
map.addControl(new OpenLayers.Control.LayerSwitcher({'ascending':false}));
map.addControl(new OpenLayers.Control.MousePosition());
// Map Layers
@@ -42,7 +41,6 @@
// Add Layers
map.addLayers([GMapsHybr, GMapsStreets, GMapsSat, MarkersLayer2]);
// Visual
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
if (!map.getCenter()) map.zoomToMaxExtent();
@@ -57,7 +55,7 @@
See how to control the maximum resolution for a markers layer,
causing it to not be displayed beyond a certain point.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
</body>
</html>

View File

@@ -2,6 +2,7 @@
<head>
<title>Overview Map 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" type="text/javascript"></script>
<style>
#map1 {

View File

@@ -0,0 +1,56 @@
<html>
<head>
<title>Pan and Zoom Panels</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<!--
-- Special stylesheet inclusion for ie6, which doesn't handle the alpha
-- channel of images correctly. The special ie6 stylesheet will only
-- be included if the browser running is ie6. For now, the only thing it
-- does is load alternative, non-alpha pngs for the zoom/pan panels.
-->
<!--[if lte IE 6]>
<link rel="stylesheet" href="../theme/default/ie6-style.css" type="text/css" />
<![endif]-->
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript" src="../lib/OpenLayers.js"></script>
<script>
var map;
var lon = 5;
var lat = 40;
var zoom = 5;
function init(){
map = new OpenLayers.Map("map", {
controls: [
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanPanel(),
new OpenLayers.Control.ZoomPanel()
]
});
var wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{layers: 'basic'}
);
map.addLayers([wms]);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
}
</script>
</head>
<body onload='init();'>
<h1 id="title">Pan and Zoom Panels</h1>
<div id="tags"></div>
<p id="shortdesc">Customizable pan and zoom panels</p>
</p>
<div id="map" class="smallmap"></div>
<p id="docs">
The pan and zoom panels allow you to use CSS styling to change the
look and feel of the panels, including changing their position
and their icons without needing to change any code.
</p>
</body>
</html>

View File

@@ -1,12 +1,8 @@
<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" />
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
.olControlPanel div {
display:block;
width: 24px;
@@ -94,6 +90,6 @@
CSS, and add your own controls to it.
</p>
<div id="panel"></div>
<div id="map"></div>
<div id="map" class="smallmap"></div>
</body>
</html>

View File

@@ -1,13 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 800px;
height: 400px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer, rss, lineFeatures, popup;
@@ -57,13 +51,13 @@
</script>
</head>
<body onload="init()">
<h1>GeoRSS PointTrack in OpenLayers</h1>
<h1 id="title">GeoRSS PointTrack in OpenLayers</h1>
<p style="font-size:.9em;">This demo uses OpenLayers.Layer.GeoRSS and OpenLayers.Layer.PointTrack. The track is created by connecting the points of the GeoRSS feed.</a></p>
<form onsubmit="return false;">
GeoRSS URL: <input type="text" id="url" size="50" /><input type="submit" onclick="addUrl(); return false;" value="Load Feed" onsubmit="addUrl(); return false;" />
</form>
<p>The above input box allows the input of a URL to a GeoRSS feed. This feed can be local to the HTML page -- for example, entering 'xml/track1.xml' will work by default.</p>
<p>The example shows a track, displayed as a line connecting the points of the feed. It also shows markers at positions that have a title tag in the rss item. If clicked, a popup will show title and description.</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
</body>
</html>

View File

@@ -1,6 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" debug="true">
<head>
<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: 900px;
@@ -840,7 +841,7 @@
*/
function addMarker(ll, popupClass, popupContentHTML, closeBox, overflow) {
var feature = new OpenLayers.Feature(layer, ll);
var feature = new OpenLayers.Feature(markers, ll);
feature.closeBox = closeBox;
feature.popupClass = popupClass;
feature.data.popupContentHTML = popupContentHTML;
@@ -875,14 +876,27 @@
All kinds of different popup configurations.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<!-- preloading these images so the autosize will work correctly -->
<img src="small.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
<img src="wideshort.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
<img src="widelong.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
<img src="thinlong.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
<p> All of the images in this file a pre-cached, meaning they are
loaded immediately when you load the page (they are just placed
far offscreen, that's why you don't see them).
</p>
<br>
<p> The only image that is *not* preloaded is small.jpg, the brazilian
flag. We do this in order to test out to make sure that our auto-sizing
code does in fact activate itself as the images load. To verify
this, clear your cache and reload this example page. Click on
any of the markers in the 'AutoSize' row. If the popup autosizes
to correctly contain the entire flag: golden. If the popup is
tiny and you can only see a corner of it, then this code is broken.
</p>
<br/>

View File

@@ -1,13 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 400px;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
@@ -118,7 +112,7 @@
All kinds of ways to create and interact with Popups.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<p>If you open an anchoredbubble and switch to google, it shouldn't crash. If it does, don't release OpenLayers.</p>
<div style="background-color:purple" onclick="add()"> click to add Popup to map</div>
<div style="background-color:green" onclick="addMarker()"> click to add a Marker with an AnchoredBubble popup</div>

View File

@@ -2,12 +2,8 @@
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<style type="text/css">
body {
border: 0px;
margin: 0px;
padding: 0px;
}
#map {
width: 100%;
height: 100%;
@@ -51,6 +47,7 @@
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.ScaleLine());
}
</script>
</head>
@@ -63,7 +60,7 @@
<p id="shortdesc">
Use different (not default) projections with your map
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<p>When using alternative projections, you still use OpenLayers.LonLat objects, even though
the properties are actually X/Y values at that point.</p>
</body>

View File

@@ -0,0 +1,261 @@
<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" />
<style type="text/css">
.float-left {
float: left;
}
.clear-left {
clear: left;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, vector, protocol, modify;
function init() {
// create Gears protocol
protocol = new OpenLayers.Protocol.SQL.Gears({
databaseName: "db_name",
tableName: "table_name",
saveFeatureState: false
});
if (!GearsIsSupported()) {
return;
}
map = new OpenLayers.Map("map");
// create base layer
var layer = new OpenLayers.Layer.WMS("OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{"layers": "basic"}
);
map.addLayer(layer);
// create vector layer
vector = new OpenLayers.Layer.Vector("Vector", {
protocol: protocol,
strategies : [new OpenLayers.Strategy.Fixed()],
eventListeners: {
featuremodified: function(obj) {
if (obj.feature.state != OpenLayers.State.INSERT &&
obj.feature.state != OpenLayers.State.DELETE) {
obj.feature.state = OpenLayers.State.UPDATE;
}
displayStatus();
}
}
});
map.addLayer(vector);
// create modify feature control
modify = new OpenLayers.Control.ModifyFeature(vector);
// create editing panel
var panel = new OpenLayers.Control.Panel({
displayClass: "olControlEditingToolbar"
});
var navigation = new OpenLayers.Control.Navigation({
eventListeners: {
activate: function(obj) {
modify.activate();
},
deactivate: function(obj) {
modify.deactivate();
}
}
});
var editing = new OpenLayers.Control.DrawFeature(
vector, OpenLayers.Handler.Polygon, {
displayClass: "olControlDrawFeaturePolygon",
eventListeners: {
featureadded: function(obj) {
obj.feature.state = OpenLayers.State.INSERT;
displayStatus();
}
}
});
panel.addControls([navigation, editing]);
panel.defaultControl = navigation;
// add controls to the map
map.addControl(modify);
map.addControl(panel);
// center the map
map.setCenter(new OpenLayers.LonLat(5, 40), 5);
}
function displayResult(txt) {
if (window.resultDomElement === undefined) {
window.resultDomElement = OpenLayers.Util.getElement("last-result");
}
resultDomElement.innerHTML = txt;
displayStatus();
}
function displayStatus() {
if (window.statusDomElement === undefined) {
window.statusDomElement = OpenLayers.Util.getElement("status");
}
var createCnt = 0;
var updateCnt = 0;
var deleteCnt = 0;
var i, len, state;
for (i = 0, len = vector.features.length; i < len; i++) {
state = vector.features[i].state;
if (state == OpenLayers.State.INSERT) {
createCnt++;
} else if (state == OpenLayers.State.UPDATE) {
updateCnt++;
} else if (state == OpenLayers.State.DELETE) {
deleteCnt++;
}
}
statusDomElement.innerHTML = createCnt + " features to create, " +
updateCnt + " features to update, " +
deleteCnt + " features to delete";
}
function GearsIsSupported() {
if (!protocol.supported()) {
OpenLayers.Console.userError("You must install Gears prior to using this example");
return false;
}
return true;
}
function featuresWithState(state) {
var list = [];
var i, len, feature;
for (i = 0, len = vector.features.length; i < len; i++) {
feature = vector.features[i];
if (feature.state == state) {
list.push(feature);
}
}
return list;
}
function _sync() {
if (!GearsIsSupported()) {
return;
}
var resp = protocol.read();
if (!resp.success()) {
OpenLayers.Console.error("reading from Gears DB failed");
return;
}
vector.destroyFeatures();
if (!resp.features || resp.features.length <= 0) {
displayResult("No features to read");
return;
}
vector.addFeatures(resp.features);
displayResult("features successfully read");
}
function _commit() {
if (!GearsIsSupported()) {
return;
}
var error = false;
function callback(resp) {
if (error) {
return;
}
if (!resp.success()) {
OpenLayers.Console.error("Commiting to Gears DB failed");
error = true;
return;
}
modify.selectControl.unselectAll()
if (resp.reqFeatures) {
vector.destroyFeatures(resp.reqFeatures);
}
if (resp.features) {
vector.addFeatures(resp.features);
}
}
if (vector.features.length > 0) {
protocol.commit(vector.features, {
"create": {
callback: callback
},
"update": {
callback: callback
},
"delete": {
callback: callback
}
});
if (!error) {
displayResult("features successfully committed");
}
} else {
displayResult("no features to commit");
}
}
function _delete() {
if (!GearsIsSupported()) {
return;
}
var feature = vector.selectedFeatures[0];
if (feature) {
modify.selectControl.unselectAll()
feature.state = OpenLayers.State.DELETE;
displayStatus();
}
}
</script>
</head>
<body onload="init()">
<h1 id="title">Gears Protocol Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the usage of the Gears protocol.
</p>
<div class="float-left">
<div id="map" class="smallmap"></div>
</div>
<div>
<a href="javascript:_sync()">Sync</a>
<p>The Sync link destroys the features currently in the layer, reads
features from the Gears database, and adds them to the layer.
Uncommitted features will be lost.</p>
<a href="javascript:_commit()">Commit</a>
<p>The Commit link commits to the Gears database the features that are
marked as INSERT, UPDATE or DELETE.</p>
<a href="javascript:_delete()">Delete</a>
<p>The Delete link marks the selected feature as DELETE. To select a feature
click choose the navigation control in the editing toolbar.</p>
</div>
<div style="margin-top: 30px">
<p>Status: <span id="status"></span></p>
<p>Result: <span id="last-result"></span></p>
</div>
<div class="clear-left" id="docs">
<p>This example demonstrates the usage of OpenLayers Gears protocol to
read/create/update/delete features from/to the Gears database.
<a href="http://gears.google.com/">Gears</a> must obviously be installed
in your browser for this example to work.</p>
</div>
</body>
</html>

View File

@@ -18,6 +18,7 @@ import sys, os
allowedHosts = ['www.openlayers.org', 'openlayers.org',
'labs.metacarta.com', 'world.freemap.in',
'prototype.openmnnd.org', 'geo.openplans.org',
'sigma.openplans.org',
'www.openstreetmap.org']
method = os.environ["REQUEST_METHOD"]
@@ -39,7 +40,7 @@ try:
print "Status: 502 Bad Gateway"
print "Content-Type: text/plain"
print
print "This proxy does not allow you to access that location."
print "This proxy does not allow you to access that location (%s)." % (host,)
print
print os.environ

View File

@@ -2,20 +2,8 @@
<head>
<title>OpenLayers Regular Polygon 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">
html, body {
margin: 0;
padding: 1em;
font: 0.9em Verdana, Arial, sans serif;
}
input, select, textarea {
font: 1em Verdana, Arial, sans serif;
}
#map {
width: 512px;
height: 350px;
border: 1px solid gray;
}
p {
width: 512px;
}
@@ -85,7 +73,7 @@
Shows how to use the RegularPolygon handler to draw features with
different numbers of sides.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="config">
<ul id="controls"><b>Map Controls</b>

View File

@@ -2,12 +2,8 @@
<head>
<title>OpenLayers Resize Features 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: 500px;
height: 350px;
border: 1px solid #ccc;
}
p {
width: 500px;
}
@@ -88,7 +84,7 @@
Demonstration of how to use the geometry resize methods to
change feature sizes programatically.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<p>This example demonstrates how features can be resized. There is not yet
a control built that provides a tool for resizing, but the geometry.resize
method can be accessed to resize programmatically.</p>

View File

@@ -2,13 +2,7 @@
<head>
<title>OpenLayers Restricted Extent Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 512px;
height: 256px;
border: 1px solid #ccc;
}
</style>
<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">
@@ -47,7 +41,7 @@
Don't let users drag outside the map extent: instead, limit dragging such
that the extent of the layer is the maximum viewable area.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<p>
Map navigation is limited by a combination of map and layer properties.
The base layer resolutions array controls the resolutions (or zoom

View File

@@ -2,12 +2,8 @@
<head>
<title>OpenLayers Rotate Features 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: 500px;
height: 350px;
border: 1px solid #ccc;
}
p {
width: 500px;
}
@@ -81,12 +77,12 @@
};
var center = new OpenLayers.Feature.Vector(origin, null, style);
vectorLayer.addFeatures([center]);
window.setInterval(rotateFeature, 100,
pointFeature, 360 / 20, origin);
window.setInterval(rotateFeature, 100,
lineFeature, 360 / 40, origin);
window.setInterval(rotateFeature, 100,
polygonFeature, -360 / 20, origin);
window.setInterval(function() {rotateFeature(
pointFeature, 360 / 20, origin)}, 100);
window.setInterval(function() {rotateFeature(
lineFeature, 360 / 40, origin)}, 100);
window.setInterval(function(){rotateFeature(
polygonFeature, -360 / 20, origin)}, 100);
}
function rotateFeature(feature, angle, origin) {
@@ -104,7 +100,7 @@
Details on how to create and rotate vector features programmatically
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<div id="docs">This example shows a few features rotating. There is not yet a control
built that provides a tool for rotating, but the geometry.rotate method
can be accessed to rotate programmatically.</div>

View File

@@ -3,12 +3,8 @@
<title>Open Popup on Layer.Vector</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="../theme/default/framedCloud.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<style type="text/css">
#map {
width: 800px;
height: 350px;
border: 1px solid gray;
}
#controlToggle li {
list-style: none;
}
@@ -79,7 +75,7 @@
<p id="shortdesc">
Using a Control.SelectFeature, open a popup on click.
</p>
<div id="map"></div>
<div id="map" class="smallmap"></div>
<ul id="controlToggle">
<li>
<input type="radio" name="type" value="none" id="noneToggle"

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