Compare commits

..

780 Commits

Author SHA1 Message Date
Tim Schaub
2c58b03669 Merge pull request #887 from tschaub/default-renderer
Use the Canvas renderer by default.
2014-04-02 12:40:54 -06:00
Tim Schaub
5653d57712 Change default renderer to Canvas 2014-04-02 11:43:20 -06:00
Frédéric Junod
72e5a347b9 Merge pull request #1937 from fredj/heatmap-render-order
Set render order to null in ol.layer.Heatmap
2014-04-02 12:06:26 +02:00
Frederic Junod
6469b6c889 Set render order to null in ol.layer.Heatmap
For performance reasons: the render order is not relevant for a
heatmap representation and this avoids to sort the features each frame.
2014-04-02 10:53:04 +02:00
Frédéric Junod
3c32f8b9e4 Merge pull request #1934 from fredj/ol.dom.createCanvasContext
Add ol.dom.createCanvasContext function
2014-04-02 10:52:29 +02:00
Frederic Junod
55de0a54b9 Add ol.dom.createCanvasContext2D function 2014-04-02 09:37:41 +02:00
Tim Schaub
0b21c6bea7 Merge pull request #1936 from tschaub/curly
Typo in objectliterals.jsdoc.
2014-04-01 19:05:17 -06:00
Tim Schaub
2770e61e6c Curly instead of bar 2014-04-01 16:15:22 -06:00
Andreas Hocevar
39bf863335 Merge pull request #1886 from ahocevar/touchend-button
Zoom happens twice on Android browser
2014-04-01 17:07:34 +02:00
ahocevar
a3be9e720a Register pointer event handlers as disposable 2014-04-01 15:31:39 +02:00
Frédéric Junod
e5d59fd7f1 Merge pull request #1933 from fredj/null-renderOrder
Don't sort the features when renderOrder is null
2014-04-01 14:47:44 +02:00
Frederic Junod
ea28b3716c Don't sort the features when renderOrder is null 2014-04-01 14:11:51 +02:00
Tom Payne
0906605878 Merge pull request #1932 from twpayne/fix-draw-order
Stop draw order from preventing batch reuse
2014-04-01 14:04:12 +02:00
ahocevar
e05cff670b Use pointer events for button clicks 2014-04-01 13:46:58 +02:00
Tom Payne
ba0d35668f Stop draw order from preventing batch reuse 2014-04-01 13:45:15 +02:00
Frédéric Junod
bbb39fc930 Merge pull request #1931 from fredj/popup-scroll
Stop 'mouseweel' events in ol-overlaycontainer-stopevent div
2014-04-01 12:31:58 +02:00
Frederic Junod
849b534159 Stop 'mouseweel' events in ol-overlaycontainer-stopevent div 2014-04-01 09:42:08 +02:00
Frederic Junod
13224fd479 Use ol.MapBrowserEvent.EventType.POINTERDOWN
Instaed of a hardcoded string
2014-04-01 09:35:34 +02:00
Frédéric Junod
ac25c3ad57 Merge pull request #1930 from fredj/export
Export ol.coordinate.add
2014-03-31 23:24:38 +02:00
Bart van den Eijnden
17ecccdb23 Put reference to workshop in QuickStart 2014-03-31 21:03:10 +02:00
Bart van den Eijnden
5f20be93a5 Mention the workshop in the readme 2014-03-31 20:55:58 +02:00
Frederic Junod
ef74d8c5dc Export ol.coordinate.add 2014-03-31 17:03:58 +02:00
Antoine Abt
ef546888c8 Merge pull request #1750 from tonio/default_editing_style
Share editing default styles
2014-03-31 11:03:35 +02:00
Marc Jansen
43a9dbd6a8 Merge pull request #1925 from marcjansen/keyboard-interaction-docs
Correct documentation for `keyboardEventTarget`.
2014-03-31 10:34:54 +02:00
Antoine Abt
7122906214 Select interaction options are now optional 2014-03-31 10:24:17 +02:00
Antoine Abt
5cc1a986c2 Share editing default styles 2014-03-31 10:24:17 +02:00
Marc Jansen
8b538d765a Correct documentation for keyboardEventTarget. 2014-03-31 10:23:39 +02:00
Tim Schaub
24ad507710 Merge pull request #1917 from tschaub/node-deps
Update node packages.
2014-03-28 17:44:13 -06:00
Tim Schaub
2dd3bd88ea Update node packages
* closure-util - Driving the compiler, not watching spurious files
 * async - Bugfixes not related to our use, but this may sidestep the Travis errors we're seeing
2014-03-28 17:27:41 -06:00
Éric Lemoine
2add376113 Merge pull request #1922 from elemoine/modify
Fixes to modify interaction
2014-03-28 16:43:05 +01:00
Éric Lemoine
c82d5ba88e Make the Modify interaction more robust
This prevents a JavaScript error when features are added while the interaction does not have a map.
2014-03-28 16:09:52 +01:00
Éric Lemoine
afa5f35cef Create the R-Tree in the Modify constructor
In this way features can be added/removed to/from the R-Tree even when the interaction does not have a map.
2014-03-28 16:07:03 +01:00
Éric Lemoine
c33a3372d9 Fix initial state of the Modify interaction
Features that are in the features collection need to be added to the R-Tree.
2014-03-28 16:03:34 +01:00
Frédéric Junod
b2e4c4bc1a Merge pull request #1921 from fredj/text-offset
Scale the text offset by the device's pixel ratio
2014-03-28 15:37:12 +01:00
Tom Payne
8545aa83a9 Merge pull request #1915 from twpayne/select-interaction
Restore select interaction behaviour
2014-03-28 14:07:26 +01:00
Andreas Hocevar
37eea9340e Merge pull request #1283 from ahocevar/delete-vertex
Add a way to delete vertices with the Modify interaction
2014-03-28 12:39:28 +01:00
Frederic Junod
e0278e0e9c Scale the text offset by the device's pixel ratio
Fixes #1918
2014-03-28 12:22:12 +01:00
ahocevar
8b99fd9bc1 Updates to pass jshint validation 2014-03-28 12:02:08 +01:00
ahocevar
b9cd512ffc Lower pixel tolerance to avoid accidental vertex deltion 2014-03-28 11:37:06 +01:00
ahocevar
e612330dd7 Add a way to delete vertices with the Modify interaction
After this change, vertices can be deleted by simply clicking on
them. This is the same behaviour as e.g. in geojson.io.
2014-03-28 11:36:13 +01:00
Tom Payne
baab8dab63 Merge pull request #1916 from twpayne/fix-object-uid
Fix location of call to goog.getUid, thanks @elemoine
2014-03-27 22:57:29 +01:00
Tom Payne
7db06b61de Fix location of call to goog.getUid, thanks @elemoine 2014-03-27 22:22:54 +01:00
Tom Payne
f5e272fb3d Remove stray option in modify-features example 2014-03-27 21:54:41 +01:00
Tom Payne
15efba8a23 Restore ol.interaction.Select options 2014-03-27 21:54:41 +01:00
Tom Payne
0ec6bc6325 Fix jsdoc 2014-03-27 21:54:40 +01:00
Frédéric Junod
16054cb753 Merge pull request #1913 from fredj/heatmap-clamp
Optimize opacity clamping
2014-03-27 19:58:08 +01:00
Tom Payne
ddac5c5725 Merge pull request #1888 from twpayne/draw-order
Optional fixed draw order
2014-03-27 19:50:13 +01:00
Frederic Junod
a5a7550930 Optimize opacity clamping 2014-03-27 19:31:30 +01:00
Tom Payne
192c97d52b Respect renderOrder in ol.renderer.canvas.Vector 2014-03-27 19:03:42 +01:00
Tom Payne
479472f6fe Add renderOrder option to ol.layer.Vector 2014-03-27 19:01:53 +01:00
Tom Payne
4e93fe2fbd Call goog.getUid in ol.Object constructor 2014-03-27 19:01:29 +01:00
Tim Schaub
57b43e9822 Merge pull request #1912 from tschaub/modify-example
Add style and condition for multiple selection to modify example.
2014-03-27 11:53:36 -06:00
Tim Schaub
2da07f8837 Always toggle selection 2014-03-27 11:26:17 -06:00
Tim Schaub
02a7913c0f Add condition for selection 2014-03-27 11:07:06 -06:00
Tim Schaub
1e0d2af0f0 Add a style for selected features 2014-03-27 11:01:12 -06:00
Frédéric Junod
f4af416aa8 Merge pull request #1894 from fredj/heatmap-weight
Take the feature's weight into account
2014-03-27 17:57:46 +01:00
Tim Schaub
862deefa43 Merge pull request #1897 from tschaub/absolute
Don't use protocol relative URLs.
2014-03-27 09:56:27 -06:00
Frédéric Junod
00bae6a962 Merge pull request #1910 from fredj/api-links
Update links to W3C specs in doc
2014-03-27 14:16:36 +01:00
Frederic Junod
4886c1dcab Update links to W3C specs 2014-03-27 13:56:59 +01:00
Andreas Hocevar
47b82f0f11 Merge pull request #1906 from ahocevar/fix-event-docs
Do not delete event and fires doclets
2014-03-27 13:00:37 +01:00
ahocevar
d4eb5dd2ee Use a more visually appealing margin for descriptions 2014-03-27 13:00:08 +01:00
ahocevar
a5d8f463ff Clean up
Only mark symbol as unexported when it is not in the API, and
no longer extract links from fires annotations because all links
are handled now.
2014-03-27 12:37:01 +01:00
Frédéric Junod
07775ae1ca Merge pull request #1909 from fredj/extern
Remove unneeded json.js extern
2014-03-27 11:48:09 +01:00
Frederic Junod
f60854e63f Remove unneeded json.js extern 2014-03-27 11:21:20 +01:00
Frédéric Junod
e1b05ca4ca Merge pull request #1902 from fredj/native-json
Use native JSON.parse function
2014-03-27 11:07:46 +01:00
Frederic Junod
d36536b935 Better documentation for weight option 2014-03-27 10:53:11 +01:00
Frederic Junod
0043e39ee3 Clamp opacity value to (0, 1) 2014-03-27 10:53:05 +01:00
Frederic Junod
0461901a86 Add new 'weight' option to ol.layer.Heatmap 2014-03-27 10:52:48 +01:00
Frederic Junod
0c131ba931 Take the feature's weight into account 2014-03-27 10:52:35 +01:00
ahocevar
15b0bc719e Do not loop through parents
Now that we use the parseComplete event, we walk through all
doclets in the loop anyway.
2014-03-27 01:56:31 +01:00
ahocevar
a1d9491d62 Do not delete event and fires doclets 2014-03-27 01:18:59 +01:00
Andreas Hocevar
0dcdd58396 Merge pull request #1904 from ahocevar/doc-improvements
API doc improvements
2014-03-26 23:47:02 +01:00
ahocevar
cc1fceab05 Do not query the array twice 2014-03-26 23:46:42 +01:00
Andreas Hocevar
d148d814b2 Merge pull request #1901 from ahocevar/canvasimmediate-less-exports
Do not export the ol.render.canvas.Immediate constructor
2014-03-26 18:43:16 +01:00
ahocevar
46ec3209bd Make ol.View2D available when exploring olx.MapOptions 2014-03-26 18:38:26 +01:00
ahocevar
19ed446f43 Make ol.render.canvas.Immediate available in the docs 2014-03-26 18:33:45 +01:00
ahocevar
e5edb5c0e3 Also consider linked symbols as documented 2014-03-26 18:33:15 +01:00
ahocevar
f129a68248 Only add symbols to the unexported array once
This basically fixes a typo that caused unexported symbols to
be added to the unexported array multiple times.
2014-03-26 18:32:36 +01:00
ahocevar
118d9c200a Remove undocumented symbols at the end of the parsing process
This ensures that we do not mark symbols as undocumented before
all potential dependencies are parsed.
2014-03-26 18:31:31 +01:00
Frederic Junod
0062759f75 Use native JSON.parse function 2014-03-26 16:40:13 +01:00
ahocevar
0c5e232d66 Do not export the ol.render.canvas.Immediate constructor 2014-03-26 15:25:30 +01:00
Frédéric Junod
36305f7efe Merge pull request #1900 from fredj/topojson
ol.format.TopoJSON issues
2014-03-26 15:12:45 +01:00
Frederic Junod
5c4adebb7d Add more topojson tests 2014-03-26 14:59:08 +01:00
Tom Payne
9e6f35c62e Fix TopoJSON return type and line string parsing 2014-03-26 14:59:08 +01:00
Frederic Junod
429a256fff Fix 'scale' and 'translate' tests 2014-03-26 14:59:08 +01:00
Andreas Hocevar
b59fa4e8af Merge pull request #1898 from ahocevar/events
Document events
2014-03-26 14:13:59 +01:00
ahocevar
a3b5376520 Add missing event documentation and stability tags 2014-03-26 14:04:58 +01:00
ahocevar
932cab12af Document stability of MapBrowserEvent properties and events 2014-03-25 22:07:14 +01:00
ahocevar
7fa8bd6723 Document ol.MapEvent events 2014-03-25 18:25:05 +01:00
ahocevar
3227ce4a06 Document ol.ObjectEvent events 2014-03-25 18:24:57 +01:00
ahocevar
4fad17b213 Make clearer what the 'Event' for observable properties means 2014-03-25 18:24:37 +01:00
ahocevar
7a9353cc87 Document classes and properties from externs/oli.js 2014-03-25 18:24:09 +01:00
ahocevar
d0ac615bef Distinct unexported and undocumented symbols 2014-03-25 18:23:05 +01:00
ahocevar
026c7149c8 Fix @override documentation 2014-03-25 18:21:55 +01:00
ahocevar
7e850ca33d Use JSDoc's stock event documentation 2014-03-25 18:21:08 +01:00
Tom Payne
901164df38 Merge pull request #1893 from twpayne/jshint-clean-ups
Check with JSHint
2014-03-25 17:04:14 +01:00
Tim Schaub
9ce7d6ea45 Avoid protocol relative URL to support apps using file protocol 2014-03-24 15:46:12 -06:00
ahocevar
f37245963c Document Map events 2014-03-24 21:53:42 +01:00
ahocevar
fcd737e62b Document MapBrowserEvent events 2014-03-24 21:53:32 +01:00
ahocevar
50f8eb65fd Add capabilities to document events 2014-03-24 21:53:18 +01:00
Tom Payne
b613c9cde7 Merge pull request #1859 from pgiraud/geolocation_tracking_orientation
Geolocation tracking with orientation example
2014-03-24 12:53:53 +01:00
Pierre GIRAUD
8e9ffb377e Geolocation tracking with orientation example 2014-03-24 12:26:17 +01:00
Tom Payne
710e6df71a Merge pull request #1892 from twpayne/fix-stack-overflow
Fix stack overflow when handling very, very large numbers of coordinates
2014-03-24 12:07:58 +01:00
Tom Payne
369c20388e Use ol.array.safeExtend in ol.format.KML 2014-03-24 11:56:53 +01:00
Tom Payne
82b703f3f0 Use ol.array.safeExtend in ol.format.GML 2014-03-24 11:56:53 +01:00
Tom Payne
dbc4f4e621 Use ol.array.safeExtend in ol.geom.Polygon 2014-03-24 11:56:53 +01:00
Tom Payne
c1d37195f5 Use ol.array.safeExtend in ol.geom.MultiPolygon 2014-03-24 11:56:53 +01:00
Tom Payne
b9a6048791 Use ol.array.safeExtend in ol.geom.MultiPoint 2014-03-24 11:56:53 +01:00
Tom Payne
765985c5a9 Use ol.array.safeExtend in ol.geom.MultiLineString 2014-03-24 11:56:53 +01:00
Tom Payne
de2ee2451e Use ol.array.safeExtend in ol.geom.LineString 2014-03-24 11:56:53 +01:00
Tom Payne
71dae7b71e Add ol.array.safeExtend 2014-03-24 11:56:53 +01:00
Marc Jansen
84463f59d4 Merge pull request #1614 from Intermedix/ol-touch-zoomslider
Add styles for .ol-touch .ol-zoomslider
2014-03-24 09:24:23 +01:00
Tom Payne
7923540f74 Add jshint target to check and integration-test targets 2014-03-24 00:46:49 +01:00
Tom Payne
df6e69a56e Add jshint target 2014-03-24 00:46:49 +01:00
Tom Payne
af952b7ea5 Install node dependencies on Travis 2014-03-23 19:59:50 +01:00
Tom Payne
2bb829594e Add jshint to dependencies 2014-03-23 19:59:50 +01:00
Tom Payne
004d8b721d Add .jshintrc 2014-03-23 19:59:49 +01:00
Tom Payne
14cca5e2f9 Make vector-labels example work in advanced mode 2014-03-23 19:59:49 +01:00
Tom Payne
06469ede50 No need to quote properties in vector-labels example 2014-03-23 19:59:49 +01:00
Tom Payne
9a6b502960 Add missing semicolon 2014-03-23 19:59:49 +01:00
Tom Payne
8c6c262a6a Don't redeclare variable 2014-03-23 19:59:49 +01:00
Tom Payne
a5cc4d0728 Use === to compare with undefined 2014-03-23 19:59:49 +01:00
Tom Payne
b91371348e Disable warnings about property access 2014-03-23 19:59:49 +01:00
Tom Payne
4a8ef6a229 Use dot property access in ol.pointer.TouchSource 2014-03-23 19:59:49 +01:00
Tom Payne
cf111c7a77 Add missing externs for Touch 2014-03-23 19:59:49 +01:00
Tom Payne
aeb1626b08 Suppress jshint warnings about use of String as a constructor 2014-03-23 19:59:49 +01:00
Tom Payne
06dc1aa4f2 Suppress warning about fall-through in switch statement 2014-03-23 19:59:49 +01:00
Tom Payne
a54f3c6644 Move nodeName into correct scope 2014-03-23 18:30:03 +01:00
Tom Payne
35dea5e3a6 Always use === to compare with 0 2014-03-23 18:29:47 +01:00
Tom Payne
7f5446afff Merge pull request #1889 from twpayne/layer-spy-pixel-ratio
Take pixel ratio into account in layer-spy example
2014-03-23 03:05:33 +01:00
Tom Payne
f051230f99 Take pixel ratio into account in layer-spy example 2014-03-23 02:54:15 +01:00
Bart van den Eijnden
56e958f209 Merge pull request #1878 from bartvde/mapquest-https
MapQuest HTTPS problem (r=@fredj)
2014-03-21 13:36:23 +01:00
Antoine Abt
4879f79094 Merge pull request #1877 from tonio/skip_features
Replace renderGeometryFunction by skippedFeatures
2014-03-21 09:57:19 +01:00
Bart van den Eijnden
c7529113fb Fix MapQuest source when using https 2014-03-21 08:56:59 +01:00
Tim Schaub
788c734635 Merge pull request #1887 from tschaub/editing-examples
Separate test example from modify example.
2014-03-20 15:29:17 -06:00
Tim Schaub
1b4aa63673 Separate test example from modify example 2014-03-20 12:18:17 -06:00
Frédéric Junod
185a655cdd Merge pull request #1881 from fredj/pointerevents-cleanups
Miscellaneous pointer events cleanups
2014-03-20 16:36:35 +01:00
Éric Lemoine
3b642ae549 Remove the getSkippedFeatureUids function 2014-03-20 13:30:45 +01:00
Éric Lemoine
c4b654b26c Rename skippedFeaturesHash to skippedFeatureUids 2014-03-20 13:29:30 +01:00
Éric Lemoine
71484d9a53 Better API doc strings in ol.Map 2014-03-20 13:25:20 +01:00
Éric Lemoine
435e5e6916 Better type checking in ol.Map 2014-03-20 13:19:54 +01:00
Antoine Abt
6a4c2bccc5 Coding style 2014-03-20 13:08:10 +01:00
Antoine Abt
78039aceb8 Use a hash to store features uids 2014-03-20 13:03:31 +01:00
Frederic Junod
764d7aaaa4 Remove unused ol.pointer.PointerEvent#originalEvent 2014-03-20 12:38:14 +01:00
Frederic Junod
6af2d5ae47 Remove trailing newlines 2014-03-20 12:38:14 +01:00
Frederic Junod
6d4552c783 Cache the result of goog.object.getCount 2014-03-20 12:38:14 +01:00
Frederic Junod
a2375d58b6 Store touch coordinates as ol.Pixel instead of goog.math.Coordinate 2014-03-20 12:38:14 +01:00
Frederic Junod
395fdf9bbf Move function declaration out of the constructor 2014-03-20 12:38:13 +01:00
Andreas Hocevar
23e1e6e0f4 Merge pull request #1875 from ahocevar/modify-performance
Do not update RTree while dragging vertices
2014-03-20 10:43:47 +01:00
Antoine Abt
d0f2dd354b Trigger render on skippedFeatures change 2014-03-20 10:25:45 +01:00
Antoine Abt
e1e4969599 Name frameState skippedFeaturesIds as private 2014-03-20 10:24:39 +01:00
Antoine Abt
0d87516135 Map stores skippedFeatures instead of layers 2014-03-19 17:24:58 +01:00
Tom Payne
0ea102ae66 Merge pull request #1874 from twpayne/wfs-fixes
Miscellaneous GML and WFS fixes
2014-03-19 12:54:49 +01:00
Antoine Abt
e91db0f9af Check for null layers (for postcompose hitdetection) 2014-03-19 12:33:48 +01:00
Antoine Abt
c8de4d908d Skip features in select interaction 2014-03-19 12:33:32 +01:00
Antoine Abt
c2c3798087 Update select-features example styles 2014-03-19 12:31:45 +01:00
Antoine Abt
9f7cba0ac0 Skipped features replaces RenderGeometryFunction 2014-03-19 12:31:45 +01:00
ahocevar
878f7cc7c8 Do not update RTree while dragging vertices 2014-03-19 11:36:55 +01:00
Tom Payne
1fc1cd0b2f Merge pull request #1873 from twpayne/sphere-interpolate
Add ol.Sphere#interpolate
2014-03-19 00:13:46 +01:00
Tom Payne
f41a4dc543 Add EPSG:4326 tests 2014-03-18 19:12:27 +01:00
Tom Payne
0b5f0d0c8e Add ol.Sphere#interpolate 2014-03-18 18:52:44 +01:00
Tom Payne
b3ac959d6a Parse coordinates in GML in a single pass 2014-03-18 16:18:54 +01:00
Tom Payne
84cb3c88ef Fix fixing of OGC stupidity 2014-03-18 16:18:49 +01:00
Tom Payne
1b2e9aa13d Fix return types 2014-03-18 16:18:44 +01:00
Tom Payne
088a748d70 Remove tests for spherical geometry on poorly defined points 2014-03-18 14:58:39 +01:00
Frédéric Junod
f50451698a Merge pull request #1872 from fredj/vbarray
Fix vbarray extern
2014-03-18 09:01:43 +01:00
Frederic Junod
b04639ccc5 Fix vbarray extern
dimension argument is optional.
See http://msdn.microsoft.com/en-us/library/3kk8f869(v=vs.94).aspx
and http://msdn.microsoft.com/en-us/library/0kbz883e(v=vs.94).aspx
2014-03-18 08:14:34 +01:00
Frédéric Junod
1b6f0a3fd1 Merge pull request #1870 from fredj/has-touch
Fix ol.BrowserFeature.HAS_TOUCH detection code
2014-03-18 08:00:56 +01:00
Bart van den Eijnden
5db19fc307 Merge pull request #1867 from bartvde/stability
Mark parts of control and overlay as stable
2014-03-17 20:06:52 +01:00
Tom Payne
84479a096f Merge pull request #1871 from twpayne/select-toggle
Replace ol.interaction.Select add with toggle
2014-03-17 17:10:45 +01:00
Tom Payne
395f1222a1 Add remove and toggle options to ol.interaction.Select 2014-03-17 16:43:41 +01:00
Tom Payne
29d1ee5e03 Add ol.events.condition.never 2014-03-17 16:40:38 +01:00
Tim Schaub
f57a0544a0 Merge pull request #1845 from tschaub/buffered
Track replay group resolution and buffer max extent to capture strokes.
2014-03-17 08:50:07 -06:00
Frederic Junod
f2d8ad34fa Fix ol.BrowserFeature.HAS_TOUCH detection code
Use goog.global instead goog.global.document.documentElement to avoid
false negative results when using the chrome development tools (Touch
Events emulation).

Code borrowed from https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
except for the DocumentTouch part which is deprecated (https://developer.mozilla.org/en-US/docs/Web/API/DocumentTouch)

Fixes #1869
2014-03-17 15:04:55 +01:00
Tom Payne
ade384f842 Merge pull request #1868 from twpayne/wrap-x
Add wrapX option to ol.source.XYZ
2014-03-17 14:16:56 +01:00
Tom Payne
27943d9ed6 Tidy up setting of default projection 2014-03-17 14:08:41 +01:00
Tom Payne
2100cd30df Add wrapX option to ol.source.XYZ 2014-03-17 14:08:41 +01:00
Frédéric Junod
38009e1984 Merge pull request #1866 from fredj/pointerevents-tests
Fix simulated touch event in tests
2014-03-17 12:18:36 +01:00
Frederic Junod
9a51557dec Increase simulated clientY value
The the difference in position must be greater than
ol.pointer.MouseSource.DEDUP_DIST
2014-03-17 12:04:10 +01:00
Bart van den Eijnden
83bf626e03 Mark parts of control and overlay as stable 2014-03-17 11:06:46 +01:00
Frederic Junod
391f81f838 Fix simulated touch event in tests 2014-03-17 10:35:13 +01:00
Frédéric Junod
593bb46708 Merge pull request #1865 from fredj/device-orientation
Make ol.DeviceOrientation dispatch change events
2014-03-17 09:34:29 +01:00
Éric Lemoine
f019f3ed44 Merge pull request #1858 from elemoine/geolocation
Add change event to Geolocation
2014-03-17 09:32:08 +01:00
Frederic Junod
2e390794ed Use change event in device-orientation example 2014-03-17 09:06:25 +01:00
Frederic Junod
6df7d5afda Make ol.DeviceOrientation dispatch change events 2014-03-17 09:05:52 +01:00
Andreas Hocevar
c3cc4af453 Merge pull request #1861 from ahocevar/init-lastpixel
Initialize lastPixel_ properly
2014-03-14 15:44:52 +01:00
ahocevar
6de1636507 Initialize lastPixel_ properly 2014-03-14 15:24:58 +01:00
Éric Lemoine
c8f981b38d Merge pull request #1840 from tsauerwein/pointerevents
Use pointer events
2014-03-14 11:13:24 +01:00
tsauerwein
155b9b3f86 Add comment about pointercancel listener 2014-03-14 10:16:27 +01:00
tsauerwein
b2a37b8244 Remove not needed require 2014-03-14 10:16:27 +01:00
tsauerwein
41df4e0a23 Remove assertion again
When doing a double tap, the timeout id might get overridden.
2014-03-14 10:16:27 +01:00
tsauerwein
599de6a44a Listen also to pointerdown on overlay container 2014-03-14 10:16:27 +01:00
tsauerwein
89da5debfa Fix order of olx.interaction.* types 2014-03-14 10:16:27 +01:00
tsauerwein
7789d5eb08 Fix Google Maps example 2014-03-14 10:16:27 +01:00
tsauerwein
51a557efbb Replace goog.structs.Map with plain object 2014-03-14 10:16:27 +01:00
tsauerwein
8a26ac6e24 Set preventDefault in PointerEvent constructor 2014-03-14 10:16:27 +01:00
tsauerwein
68fa5fb9ce Make use of goog.array.remove 2014-03-14 10:16:27 +01:00
tsauerwein
debdc26fd2 Remove assignment inside expression 2014-03-14 10:16:27 +01:00
tsauerwein
71b424f74c Add missing require 2014-03-14 10:16:27 +01:00
tsauerwein
1a477b8f32 Assert that timeout reset ids are not overridden 2014-03-14 10:16:27 +01:00
tsauerwein
d170281354 Re-use handler 2014-03-14 10:16:27 +01:00
tsauerwein
e08fa37565 Use enums for pointer event types 2014-03-14 10:16:27 +01:00
tsauerwein
72d7a6e1ff Remove unused property pointerMap on NativeSource 2014-03-14 10:16:27 +01:00
tsauerwein
b693ddf56e Remove assignments inside expression 2014-03-14 10:16:27 +01:00
tsauerwein
73c33e58e9 Remove unused constant NEW_MOUSE_EVENT 2014-03-14 10:16:27 +01:00
tsauerwein
77aa29e6ee Remove blank lines 2014-03-14 10:16:27 +01:00
tsauerwein
873d47d087 Remove not needed type cast 2014-03-14 10:16:27 +01:00
tsauerwein
6933023441 Remove leading whitespace 2014-03-14 10:16:27 +01:00
Éric Lemoine
d08ab1ea78 PinchZoom interaction sets/unsets interacting hint 2014-03-14 10:16:27 +01:00
Éric Lemoine
544ceaf9f9 PinchRotate interaction sets/unsets interacting hint 2014-03-14 10:16:27 +01:00
Éric Lemoine
b5339550b7 DragPan interaction sets/unsets interacting hint 2014-03-14 10:16:27 +01:00
Éric Lemoine
d1ef5b0f5b Remove view hint handling from pointer interaction 2014-03-14 10:16:27 +01:00
Éric Lemoine
35b31730b5 Change a property from private to protected 2014-03-14 10:16:27 +01:00
Éric Lemoine
b939ca24d7 Use a more explicit variable name 2014-03-14 10:16:27 +01:00
Tom Payne
df71854561 Merge ol.pointer.CLONE_PROPS and CLONE_DEFAULTS into a single array 2014-03-14 10:16:27 +01:00
tsauerwein
5a358918e1 Rename interactions
The idea behind the naming scheme is that for example
for `DragRotate`, `Rotate` is the action and `Drag` the
gesture that issues the action.
2014-03-14 10:16:27 +01:00
Frederic Junod
ee80238ed2 Use 'undefined' for undefined numbers
Conflicts:
	src/ol/pointer/touchsource.js
2014-03-14 10:16:27 +01:00
tsauerwein
18c2888987 Remove not used property TouchSource.firstXY 2014-03-14 10:16:27 +01:00
Frederic Junod
f5b15f737f Move DEDUP_TIMEOUT and CLICK_COUNT_TIMEOUT constants out of the instance 2014-03-14 10:16:27 +01:00
tsauerwein
fcb52d2361 Remove unnecessary call to goog.bind 2014-03-14 10:16:27 +01:00
tsauerwein
52839533e6 Fix typo in POINTERDRAG constant 2014-03-14 10:16:27 +01:00
ahocevar
e28faa3a2b Removing code for functionality now handled by #1834 2014-03-14 10:16:27 +01:00
tsauerwein
6742e6a03a Fix type annotation 2014-03-14 10:16:27 +01:00
Frederic Junod
028a183d11 Pass the mapping object to the ol.pointer.EventSource constructor
Conflicts:
	src/ol/pointer/mssource.js
2014-03-14 10:16:27 +01:00
tsauerwein
4468d96a13 Read pointerId/pointerType from browser event
and not from the Google Closure event.
2014-03-14 10:16:27 +01:00
Frederic Junod
aee76c989d Change ol.BrowserFeature.HAS_POINTER feature detection
Because navigator.pointerEnabled will not be part of the final spec.
See https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890
2014-03-14 10:16:27 +01:00
Frederic Junod
a13ade90ad Simplify pointerType string conversion 2014-03-14 10:16:27 +01:00
Frederic Junod
08b297e628 Use goog.object.get instead of ol.pointer.PointerEvent#getValue_ 2014-03-14 10:16:27 +01:00
tsauerwein
6e2f0dce76 Work on a copy of changedTouches
On Opera Mobile 11.10 it is not possible to
directly work on `changedTouches` (e.g. map
fails). That is why a copy is made first.
2014-03-14 10:16:27 +01:00
Frederic Junod
b2e946794f Set ol.pointer.*Source#mapping_ properties to private 2014-03-14 10:16:27 +01:00
Frederic Junod
a916e2500b Add ol.pointer.TouchSource.POINTER_TYPE constant 2014-03-14 10:16:26 +01:00
Frederic Junod
a74ad0e459 Remove ol.pointer.*Source#events properties 2014-03-14 10:16:26 +01:00
Frederic Junod
6b4b62dd3a Use goog.object.get instead of ol.pointer.PointerEvent#getValueOr_ 2014-03-14 10:16:26 +01:00
Frederic Junod
cbb875e504 Add extern for Navigator.prototype.pointerEnabled 2014-03-14 10:16:26 +01:00
tsauerwein
51d7cb2820 Make goog.events.listen return proper listener key
When goog.events.listen receives an array of event types,
it only return null as listener key. So that calling
goog.events.unlistenByKey does not work.
2014-03-14 10:16:26 +01:00
tsauerwein
b17957b543 Fix support for legacy IE 2014-03-14 10:16:26 +01:00
tsauerwein
d6ca93e23c Adding missing return 2014-03-14 10:16:26 +01:00
tsauerwein
42f0dfa75a Use goog.dispose 2014-03-14 10:16:26 +01:00
tsauerwein
79424ec856 Add comment about mouse support only 2014-03-14 10:16:26 +01:00
tsauerwein
0d72f4542e Remove old event types
Pointer events for the win.
2014-03-14 10:16:26 +01:00
tsauerwein
5f75104e33 Remove DragInteraction 2014-03-14 10:16:26 +01:00
tsauerwein
50d09eba93 Adding missing default returns 2014-03-14 10:16:26 +01:00
ahocevar
5b25826e2f Adding missing require 2014-03-14 10:16:26 +01:00
ahocevar
29454c2326 Note about MultiGeometry rendering 2014-03-14 10:16:26 +01:00
ahocevar
18ba2f8be6 Fixing API docs 2014-03-14 10:16:26 +01:00
ahocevar
f5f2dae300 Updating tests for Draw interaction 2014-03-14 10:16:26 +01:00
ahocevar
bc1489e8a0 Adding basic support for mobile
Usability still needs improvement.
2014-03-14 10:16:26 +01:00
ahocevar
d6880039cc Making the draw interaction work with pointer events
This is not yet optimized for mobile, and tests need to be
updated.
2014-03-14 10:16:26 +01:00
ahocevar
be1318f133 Adding basic support for non-mouse devices 2014-03-14 10:16:26 +01:00
ahocevar
f663a3d87a Do not render selected features on the original layer
See #1796 for a discussion on how to handle this in a better
way.
2014-03-14 10:16:26 +01:00
ahocevar
f6efcbcc24 The Modify interaction now uses pointer events
While dragging a vertex, the feature on the original layer is
not updated until the first pointer move after dragging. See
#1796. Previously, the Modify interaction did not set the
interacting hint on the view, so the feature was also updated
on the original layer. But now, the interacting hint is set,
which exposes this behaviour.
2014-03-14 10:16:26 +01:00
ahocevar
32ffb1ecae Relay pointermove events again
This will be needed for hover actions.
2014-03-14 10:16:26 +01:00
ahocevar
296da6f4c1 Updating google-map example to use pointer events 2014-03-14 10:16:26 +01:00
ahocevar
05dd760287 Rename ol.interaction.PointerInteraction 2014-03-14 10:16:26 +01:00
tsauerwein
fa434bedda use anonymous function 2014-03-14 10:16:26 +01:00
tsauerwein
bc31d42964 removes dead code 2014-03-14 10:16:26 +01:00
tsauerwein
43aac5480c fixes interaction options in tests 2014-03-14 10:16:26 +01:00
tsauerwein
dc164fd496 removes now superfluous DragPanInteraction 2014-03-14 10:16:26 +01:00
tsauerwein
56dcdd02ec base dragrotateandzoominteraction on pointer interaction 2014-03-14 10:16:26 +01:00
tsauerwein
c593add6d8 base dragrotateinteraction on pointer interaction 2014-03-14 10:16:26 +01:00
tsauerwein
12b0fee790 pointer interaction might also receive events that are not pointer events 2014-03-14 10:16:26 +01:00
tsauerwein
411b7257cf refactoring pointer interactions 2014-03-14 10:16:26 +01:00
tsauerwein
fca9c50a3f PointerInteraction uses MapBrowserPointerEvent not MapBrowserEvent 2014-03-14 10:16:26 +01:00
tsauerwein
a696150470 base interaction for zoom box on pointer events 2014-03-14 10:16:26 +01:00
tsauerwein
bfc95451e8 fixes preventDefault() on IE11 2014-03-14 10:16:26 +01:00
tsauerwein
122dac857f PointerEventHandler test 2014-03-14 10:16:26 +01:00
tsauerwein
3d7ae92f0b tests for mouse- and touchsource 2014-03-14 10:16:26 +01:00
tsauerwein
2846996609 tests for pointereventhandler 2014-03-14 10:16:26 +01:00
tsauerwein
68b7ee58a5 fixes tests for mapbrowserevent 2014-03-14 10:16:26 +01:00
tsauerwein
e0b345b7db add assertion 2014-03-14 10:16:26 +01:00
tsauerwein
692a68644f introduce type POINTERDRAG to make a distinction between pointer move and drag 2014-03-14 10:16:26 +01:00
tsauerwein
eca6846dac move checks for pointer support into browserfeature module 2014-03-14 10:16:26 +01:00
tsauerwein
b52f79340d use separate pointer event handler for document when dragging 2014-03-14 10:16:26 +01:00
tsauerwein
2e4badb7f3 when copying properties for touch events, make sure that those properties that might be different for each Touch object are not copied from the touch event 2014-03-14 10:16:26 +01:00
tsauerwein
7fbd11154b refactoring, type annotations 2014-03-14 10:16:26 +01:00
tsauerwein
d772c95ccf makes PointerEvent a plain closure class, instead of trying to mimic a mouse event, which was required for the polyfill 2014-03-14 10:16:25 +01:00
tsauerwein
7c8713f79d add comment about an open bug with native Android browser (4.1.2) when the page is scrolled 2014-03-14 10:16:25 +01:00
tsauerwein
e1f4410ad4 removes not needed WeakMap struct 2014-03-14 10:16:25 +01:00
tsauerwein
a31cc3f18c only track events when "pointerdown" event was received, because on native android browser wrong move events are sent with no "pointerdown" event 2014-03-14 10:16:25 +01:00
tsauerwein
c4c1eb7d45 allow dragging for mouse/ms/native when pointer is outside map viewport element 2014-03-14 10:16:25 +01:00
tsauerwein
ee2174785f copy properties for pointer event from internal browser event, not from google.event.BrowserEvent 2014-03-14 10:16:25 +01:00
tsauerwein
1c75ecc260 former touch interactions now use pointer events 2014-03-14 10:16:25 +01:00
tsauerwein
014ef96c31 base interactions for pointer events on existing touch interactions 2014-03-14 10:16:25 +01:00
tsauerwein
37ab50e2e4 use goog.bind, safari does not support the native bind 2014-03-14 10:16:25 +01:00
tsauerwein
492549642e add polymer license info 2014-03-14 10:16:25 +01:00
tsauerwein
0858f6825c source for touch events 2014-03-14 10:16:25 +01:00
tsauerwein
445ff5e05a source for native pointer events (IE11) 2014-03-14 10:16:25 +01:00
tsauerwein
df4bd7c43b source for ms pointer events (IE10) 2014-03-14 10:16:25 +01:00
tsauerwein
7140f608f8 pointer events generated by mouse events 2014-03-14 10:16:25 +01:00
Éric Lemoine
91cd8f20cc Use change event in geolocation example 2014-03-14 09:32:37 +01:00
Éric Lemoine
0577bbc1a1 Make Geolocation dispatch change events 2014-03-14 09:32:25 +01:00
Tim Schaub
88efda1a1f Track resolution and buffer max extent to capture strokes 2014-03-13 20:40:18 -04:00
Andreas Hocevar
1a40b1793c Merge pull request #1789 from ahocevar/mousewheel-delta
Mousewheel zoom broken and resolution constraints not respected in Firefox
2014-03-13 23:43:04 +01:00
ahocevar
44e0f6ce68 Use the delta from goog.events.MouseWheelHandler as-is 2014-03-13 19:51:28 +01:00
Steven Pukansky
e62e537eed Update zoomslider custom styling to match control styling changes 2014-03-13 11:52:09 -04:00
Austin Hyde
a0fdc0ecf9 Update the zoomslider example to have better styling for touch devices 2014-03-13 11:52:09 -04:00
Austin Hyde
a8dd1d29c8 Fix zoomslider controls to match zoom controls more closely 2014-03-13 11:52:09 -04:00
Austin Hyde
f45cb50121 Add styles for .ol-touch .ol-zoomslider 2014-03-13 11:52:09 -04:00
Frédéric Junod
457d5635eb Merge pull request #1857 from fredj/doc
Add missing options in olx.layer.HeatmapOptions
2014-03-13 15:57:29 +01:00
Andreas Hocevar
9547ded39a Merge pull request #1854 from ahocevar/modify-interior-rings
Add support for editing interior polygon rings
2014-03-13 15:51:35 +01:00
Bart van den Eijnden
88e7dde488 Merge pull request #1856 from bartvde/popup-anchor
Add offsetX and offsetY config options for ol.Overlay (r=@fredj,@twpayne)
2014-03-13 15:44:48 +01:00
Frederic Junod
9a4892bff3 Wrap long lines 2014-03-13 15:39:46 +01:00
Frederic Junod
d1111bacf3 Add missing options in olx.layer.HeatmapOptions 2014-03-13 15:38:42 +01:00
Bart van den Eijnden
731e37349e Combine offsetX and offsetY with positioning 2014-03-13 15:34:45 +01:00
Bart van den Eijnden
3fe3beb28a Add offsetX and offsetY config options for ol.Overlay 2014-03-13 15:06:02 +01:00
Frédéric Junod
9f1b695747 Merge pull request #1855 from fredj/const
Add '@const' to ol.BrowserFeature.HAS_ARRAY_BUFFER
2014-03-13 11:24:11 +01:00
Frederic Junod
5f43fe6da0 Add '@const' to ol.BrowserFeature.HAS_ARRAY_BUFFER 2014-03-13 10:54:43 +01:00
ahocevar
ecddcdd732 Add support for editing interior polygon rings 2014-03-13 01:02:15 +01:00
Andreas Hocevar
1fbdf47e2a Merge pull request #1807 from ahocevar/float-no-zero
Modify interaction sometimes does not allow to create a new vertex
2014-03-13 00:51:43 +01:00
Andreas Hocevar
e017555b7f Merge pull request #1808 from ahocevar/modify-multi
Modify interaction allows vertices to be added where they shouldn't be
2014-03-12 22:59:56 +01:00
Tim Schaub
c2400f6dba Merge pull request #1815 from Intermedix/lazy-style-function
Lazily create styles returned by ol.defaultFeatureStyleFunction.
2014-03-12 17:26:49 -04:00
Tom Payne
24b3f3dcc0 Merge pull request #1853 from twpayne/leading-whitespace
Remove leading whitespace
2014-03-12 20:24:46 +01:00
Tom Payne
dbca1795cf Merge pull request #1849 from twpayne/remove-old-modify-interaction
Remove old modify interaction
2014-03-12 19:53:45 +01:00
Tom Payne
9bd49e985e Add leading whitespace check 2014-03-12 19:52:38 +01:00
Tom Payne
271487c1bc Remove leading whitespace 2014-03-12 19:52:13 +01:00
Tom Payne
63f50fc035 Merge pull request #1852 from adube/example-vector-labels
Add rotation, offsetX and offsetY to vector-labels example
2014-03-12 15:53:22 +01:00
Bart van den Eijnden
c2b0760579 Merge pull request #1836 from bartvde/mapquest-layers-doc
Add possible values of layer for olx.source.MapQuestOptions (r=@elemoine)
2014-03-12 15:24:06 +01:00
Paul Spencer
94efa58363 Merge pull request #1844 from pagameba/doc-ol-format-feature
Documentation for ol.format.Feature subclasses
2014-03-12 10:23:25 -04:00
Alexandre Dubé
140618c5a2 Add rotation, offsetX and offsetY to vector-labels example 2014-03-12 10:20:49 -04:00
Tom Payne
f60891a4f4 Merge pull request #1851 from twpayne/looser-tests
Don't compare floating point numbers for exact equality
2014-03-12 15:16:59 +01:00
Tom Payne
82c4850f69 Don't compare floating point numbers for exact equality 2014-03-12 15:00:04 +01:00
Tom Payne
f7fa1ff4ad Merge pull request #1847 from twpayne/split-ol-geom-flat
Split ol.geom.flat into smaller modules
2014-03-12 14:41:25 +01:00
Tom Payne
9c59ac8570 Merge pull request #1848 from twpayne/remove-old-parsers
Remove old parsers
2014-03-12 14:38:49 +01:00
Tom Payne
ec3147504a Merge pull request #1850 from twpayne/wms-ex-geographic-bounding-box
Fix parsing of EX_GeographicBoundingBox when ol3 is compiled
2014-03-12 14:36:42 +01:00
Tom Payne
1a643e1b37 Fix parsing of EX_GeographicBoundingBox when ol3 is compiled 2014-03-12 14:25:23 +01:00
Tom Payne
df03bdeae8 Remove old ol.interaction.Modify 2014-03-12 13:51:35 +01:00
Tom Payne
3e145c0bc6 Remove old modify-features example 2014-03-12 13:51:12 +01:00
Tom Payne
a0f234595e Remove old WMS GetCapabilities parser tests 2014-03-12 13:49:02 +01:00
Tom Payne
eaccf2471c Remove old WMS GetCapabilities parser 2014-03-12 13:49:02 +01:00
Tom Payne
6d3f30328b Remove old WFS parser tests 2014-03-12 13:49:02 +01:00
Tom Payne
bdca074077 Remove old WFS parser 2014-03-12 13:48:31 +01:00
Tom Payne
bf0e788658 Remove old GML parser tests 2014-03-12 13:48:31 +01:00
Tom Payne
9492c95539 Remove old GML parser 2014-03-12 13:42:56 +01:00
Tom Payne
a7fa4487a5 Remove old gml example 2014-03-12 13:41:52 +01:00
Tom Payne
78c8d976eb Remove empty ol.geom.flat 2014-03-12 13:26:14 +01:00
Tom Payne
48af6ecd1c Factor out ol.geom.flat.center 2014-03-12 13:26:14 +01:00
Tom Payne
ca44c6328c Factor out ol.geom.flat.transform 2014-03-12 13:26:14 +01:00
Tom Payne
6a00c14841 Move squaredDistance and squaredSegmentDistance into ol.math 2014-03-12 13:26:14 +01:00
Tom Payne
65dcc38fad Factor out ol.geom.flat.reverse 2014-03-12 13:26:14 +01:00
Tom Payne
3541a01aab Factor out ol.geom.flat.inflate 2014-03-12 13:26:14 +01:00
Tom Payne
9ca996725e Factor out ol.geom.flat.flip 2014-03-12 13:26:14 +01:00
Tom Payne
266c43dc78 Factor out ol.geom.flat.deflate 2014-03-12 13:26:14 +01:00
Tom Payne
d525b43d06 Factor out ol.geom.flat.contains and interiorpoint 2014-03-12 13:26:14 +01:00
Tom Payne
1363ce3a58 Factor out ol.geom.flat.orient 2014-03-12 13:26:14 +01:00
Tom Payne
becd1318bd Factor out ol.geom.flat.area 2014-03-12 13:26:13 +01:00
Tom Payne
20ee1dc992 Factor out ol.geom.flat.length 2014-03-12 13:26:13 +01:00
Tom Payne
522fda1688 Factor out ol.geom.flat.interpolate 2014-03-12 13:26:13 +01:00
Tom Payne
c8165a8168 Factor out ol.geom.flat.simplify 2014-03-12 13:26:13 +01:00
Tom Payne
2b6845244c Factor out ol.geom.flat.closest 2014-03-12 13:26:13 +01:00
Tom Payne
b565092d62 Use goog.math.lerp in ol.geom.flat.lineStringCoordinateAtM 2014-03-12 13:26:13 +01:00
Tom Payne
76779c175f Use goog.math.lerp in ol.geom.flat.lineStringInterpolate 2014-03-12 13:26:13 +01:00
Tom Payne
86dc90ceca Merge pull request #1830 from twpayne/geom-fixes
Extra geometry functions
2014-03-12 13:24:45 +01:00
ahocevar
62034e8fb9 Only update the index for the current component 2014-03-12 13:02:52 +01:00
Tom Payne
5c6eb85040 Merge pull request #1843 from twpayne/no-regex
Don't use the regex module
2014-03-12 11:57:29 +01:00
Éric Lemoine
934664296f Merge pull request #1842 from elemoine/1798
Re-render on feature changes
2014-03-12 10:43:22 +01:00
Éric Lemoine
814e5d2790 Re-render on feature changes 2014-03-12 10:03:42 +01:00
Paul Spencer
d1ee4b8fed Add documentation for the TopoJSON format. 2014-03-11 20:53:21 -04:00
Paul Spencer
a646577bd6 Add documentation for the KML format. 2014-03-11 20:53:21 -04:00
Paul Spencer
37feb7db64 Add documentation for the IGC format. 2014-03-11 20:53:21 -04:00
Paul Spencer
3c85c32cc5 Add documentation for the GPX format. 2014-03-11 20:53:21 -04:00
Paul Spencer
cc90d59cac Add documentation for the GeoJSON format. 2014-03-11 20:53:20 -04:00
Paul Spencer
c74e01ca0a Add @function as a custom jsdoc tag for the linter. 2014-03-11 20:53:20 -04:00
Paul Spencer
7fd50c058b Add documentation for ol.format.Feature public API methods intended to be inherited by subclasses. 2014-03-11 20:53:20 -04:00
Bart van den Eijnden
ac2840721c Merge pull request #1829 from bartvde/wfs2
WFS 1.1.0 format (read/write) (r=@twpayne,@ahocevar)
2014-03-11 22:14:25 +01:00
Tom Payne
fa1fae732f Don't use the regex module 2014-03-11 21:41:36 +01:00
Frédéric Junod
7b7bc78f57 Merge pull request #1610 from fredj/wms-capabilities
Add ol.format.WMSCapabilities format
2014-03-11 17:04:26 +01:00
Frédéric Junod
2ed3b93f34 Merge pull request #1553 from fredj/geolocation-geom
Add new 'accuracyGeometry'  property to ol.Geolocation
2014-03-11 16:40:24 +01:00
Frederic Junod
a267ed4e52 Use ol.Sphere#circle to create the accuracy 'circle' 2014-03-11 15:42:08 +01:00
Tom Payne
0c8552edbb Add ol.Sphere#circle 2014-03-11 15:28:16 +01:00
Frederic Junod
e62842464c Use accuracyGeometry in geolocation example 2014-03-11 15:14:55 +01:00
Frederic Junod
962ed06717 Add new 'accuracyGeometry' property to ol.Geolocation 2014-03-11 15:13:54 +01:00
Frédéric Junod
7f46a293d2 Merge pull request #1839 from fredj/text-offset
Add offsetX and offsetY properties to ol.style.Text
2014-03-11 14:35:38 +01:00
Tom Payne
0e26ee3181 Merge pull request #1828 from twpayne/frame-state-extern
Prevent renaming of frameState properties
2014-03-11 14:21:54 +01:00
Frederic Junod
4a893f7837 Add offsetX and offsetY properties to ol.style.Text 2014-03-11 14:06:51 +01:00
Paul Spencer
a8f1f74b3a Merge pull request #1835 from pagameba/doc-canvas-immediate
Add and export documentation for ol.render.canvas.Immediate
2014-03-11 08:10:45 -04:00
Paul Spencer
10d855afd4 Add and export documentation for ol.render.canvas.Immediate 2014-03-11 07:48:37 -04:00
Bart van den Eijnden
92b29c7b09 Add possible values of layer for olx.source.MapQuestOptions 2014-03-11 10:38:33 +01:00
Andreas Hocevar
c99f969bb9 Merge pull request #1833 from ahocevar/hit-detection-pointer
Fix the pointer index
2014-03-11 08:30:40 +01:00
Éric Lemoine
a0e4bfa28b Merge pull request #1827 from elemoine/featureoverlay
Use default style function in FeatureOverlay
2014-03-11 07:32:07 +01:00
ahocevar
127cce7973 Fix the pointer index
It has to point to the end of the current block, not to the
beginning of the next block. See L581.
2014-03-10 18:18:41 +01:00
Frederic Junod
924ecba95c Fix coding style 2014-03-10 17:22:35 +01:00
Tom Payne
0335d4aa6a Use oli.View2DState instead of ol.View2DState 2014-03-10 17:19:29 +01:00
Tom Payne
0a3ef09c30 Add oli.View2DState extern 2014-03-10 17:19:11 +01:00
Frederic Junod
2fdae368c2 Check if the EX_GeographicBoundingBox is correctly parsed 2014-03-10 17:18:04 +01:00
Frederic Junod
ea8c004c76 Remove unneeded type cast 2014-03-10 17:13:16 +01:00
Frederic Junod
1c13d6ed69 Add ol.format.WMSCapabilities 2014-03-10 17:06:48 +01:00
Frederic Junod
d7d2b3353d Add ol.xml.makeObjectPropertyPusher 2014-03-10 17:06:48 +01:00
Frederic Junod
2f53c4a3ad Add ol.format.XLink 2014-03-10 17:06:48 +01:00
Frederic Junod
13698d0d06 Add ol.format.XML 2014-03-10 17:06:48 +01:00
Frederic Junod
55a8f9a5ec Remove duplicate files 2014-03-10 17:06:48 +01:00
Frederic Junod
5fba2dd7d5 Move src/ol/parser/* and tests into old directory 2014-03-10 17:06:48 +01:00
Tom Payne
b77f0e7d3a Add ol.geom.MultiPolygon#appendPolygon 2014-03-10 16:53:20 +01:00
Tom Payne
c8bbeca06e Add ol.geom.MultiPolygon#getPolygon 2014-03-10 16:53:20 +01:00
Tom Payne
719384ad14 Tidy up ol.geom.MultiPolygon#getPolygons 2014-03-10 16:53:20 +01:00
Tom Payne
cb27ae5826 Add test for ol.geom.MultiPolygon#getPolygons 2014-03-10 16:53:20 +01:00
Tom Payne
7a51b4c7b6 Add ol.geom.MultiLineString#appendLineString 2014-03-10 16:53:20 +01:00
Tom Payne
7ee4fb8a2e Add ol.geom.MultiLineString#getLineString 2014-03-10 16:53:20 +01:00
Tom Payne
669f21ca29 Construct individual line strings directly from flat coordinates 2014-03-10 16:53:20 +01:00
Tom Payne
ddfce24f05 Add ol.geom.MultiPoint#getPoint 2014-03-10 16:53:20 +01:00
Tom Payne
361d31b596 Construct individual points directly from flat coordinates 2014-03-10 16:53:19 +01:00
Tom Payne
033e2e7dd8 Add ol.geom.MultiPoint#appendPoint 2014-03-10 16:53:19 +01:00
Tom Payne
c2d4ffaba1 Add ol.geom.Polygon#getLinearRing 2014-03-10 16:53:19 +01:00
Tom Payne
03911e6c6b Add ol.geom.Polygon#appendLinearRing 2014-03-10 16:53:19 +01:00
Tom Payne
94cfb3205a Add ol.geom.LineString#appendCoordinate 2014-03-10 16:53:19 +01:00
Tom Payne
470790b811 Check arguments passed to ol.geom.MultiPolygon#setFlatCoordinates 2014-03-10 16:53:19 +01:00
Tom Payne
ee5a9d6a4e Check arguments passed to ol.geom.MultiLineString#setFlatCoordinates 2014-03-10 16:53:19 +01:00
Tom Payne
23dc855c2f Check arguments passed to ol.geom.Polygon#setFlatCoordinates 2014-03-10 16:53:19 +01:00
Bart van den Eijnden
041479f1b7 Add more typedefs for return objects 2014-03-10 16:40:00 +01:00
Bart van den Eijnden
431a4d1725 Restore the exports 2014-03-10 15:40:55 +01:00
Bart van den Eijnden
6800a3290b Port over test case for multiple Query elements 2014-03-10 15:37:29 +01:00
Bart van den Eijnden
33abbfced1 Add support for writing Native 2014-03-10 15:24:00 +01:00
Bart van den Eijnden
4e5e75f525 Add write support for Transaction 2014-03-10 14:58:03 +01:00
Tom Payne
022a7a03e0 Use oli.FrameState instead of ol.FrameState 2014-03-10 14:48:23 +01:00
Tom Payne
8aca7ce140 Add oli.FrameState extern 2014-03-10 14:45:49 +01:00
Tom Payne
6cadc2b9ab Merge pull request #1785 from adube/example-labels
Example labels
2014-03-10 14:11:31 +01:00
Tom Payne
586c4b9cd2 Merge pull request #1746 from sbrunner/fitcoordinates
Fit coordinates on visible map, Center coodinate on positions
2014-03-10 14:08:47 +01:00
Andreas Hocevar
97da6b4874 Merge pull request #1824 from ahocevar/replay-hit-detection
Iterating through the hit detection replay batch fails when geometryRenderFunction returns false
2014-03-10 12:38:25 +01:00
ahocevar
c6ba9787b5 Update the pointer to the next block when reversing
Just reversing the array is not enough, the pointers to the
beginning of the next block must be changed to the reversed
array index.
2014-03-10 12:37:45 +01:00
Éric Lemoine
6047a4dcf6 Use default style function in FeatureOverlay 2014-03-10 11:32:36 +01:00
Tim Schaub
f3c06989b6 Merge pull request #1822 from tschaub/append-first
Always add first segment when appending coordinates.
2014-03-07 11:53:49 -07:00
Tom Payne
7a1e4aa6c8 Merge pull request #1820 from twpayne/fix-multipolygon-get-polygons
Fix calculation of ends in ol.geom.MultiPolygon#getPolygons
2014-03-07 19:50:19 +01:00
Tom Payne
f32d491d45 Fix calculation of ends in ol.geom.MultiPolygon#getPolygons 2014-03-07 19:49:38 +01:00
Tim Schaub
8317317127 Always add first segment when appending coordinates
When we have only a single point, we want to make sure it gets added (fixes #1821).

Because this code doesn't differentiate coordinates that are part of a linestring or linearring from those that are independent points, we always add the first segment (or pair of points).  In addition, coordinates for segments are appended whenever they represent a change in relationship with respect to the extent.  This keeps the code simpler for handling fills and properly capturing intersection points for linestrings.  This could be modified to save a few extra coordinates, but it provides for simpler code at a very minimal cost.
2014-03-07 11:02:25 -07:00
Bart van den Eijnden
2ce92ac6a2 Add write support for BBOX filter 2014-03-07 16:44:24 +01:00
Tom Payne
7da18bd144 Merge pull request #1819 from oterral/fix_anchor
Fix anchor origin calculation
2014-03-07 14:49:14 +01:00
oterral
5028aa3bc3 Fix anchor origin calculation 2014-03-07 13:35:18 +01:00
ahocevar
6fbafef4ad Add a layer with real data to the example 2014-03-07 10:52:50 +01:00
ahocevar
bc79b89c5e Limit shared segment editing
To avoid surprises, we enable shared segment editing only on
segments that have the same vertex coordinates.
2014-03-07 10:52:50 +01:00
ahocevar
97f8fdbd15 Added another linestring to show shared segment editing 2014-03-07 10:52:50 +01:00
ahocevar
42935408fb Keep track of intersecting segments
Because we have nodes sorted by segment distance from the
editing vertex in #handleMouseAtPixel(), it is cheap to create a
hash of intersecting segments there. Now in #handleDragStart(),
we do not need to measure the distance of the vertex to the
segment. Instead, we just test if the segment is in the hash.
2014-03-07 10:52:49 +01:00
Bart van den Eijnden
c05e8d0292 Read the metadata of a FeatureCollection 2014-03-07 10:32:17 +01:00
Marc Jansen
044b8380fa Merge pull request #1817 from marcjansen/fix-modify-example
Close polygon in modify-feature example.
2014-03-07 10:25:47 +01:00
Marc Jansen
8a4fba360b Close polygon in modify-feature example. 2014-03-07 10:07:47 +01:00
Austin Hyde
0e21d2c99d Lazily create ol.defaultFeatureStyleFunction
Besides the slight performance benefit of not prerendering the default
circle style until we need to, this change also allows loading OL3
in browsers that don't support the canvas API (IE 7-8). If the circle
style is rendered on load, the lack of HTMLCanvasElement#getContext
causes IE 7-8 to bomb, regardless of if vector styles are used at all.
2014-03-06 15:31:26 -05:00
Bart van den Eijnden
2310ccdb91 Add reading of TransactionResponse 2014-03-06 19:04:23 +01:00
Tim Schaub
1f30a5f40d Merge pull request #1662 from tschaub/drawing-rings
Add `minPointsPerRing` option to the draw interaction.  By default, polygon drawing cannot be finished until three points have been added.  To allow polygon drawing to finish after only two points have been added, set `minPointsPerRing: 2`.
2014-03-06 09:39:45 -07:00
Tim Schaub
36204faf2f Merge pull request #1754 from tschaub/clip
Track max extent for replay and limit draw instructions outside that extent.
2014-03-06 09:37:43 -07:00
Marc Jansen
e5fe832839 Merge pull request #1814 from marcjansen/no-jsdoc-googx
Exclude `googx/dom/fullscreen.js` from API-docs
2014-03-06 17:12:28 +01:00
Marc Jansen
4107b140a6 Adjust parameters of jsdoc-call in build.py.
The `src`-directory is no longer defined on the commmandline
and the `index.md` as explicit source file is now the first
argument.
2014-03-06 16:08:46 +01:00
Marc Jansen
32524d186a Add explicit includes/excludes to jsdoc config. 2014-03-06 16:06:51 +01:00
Frédéric Junod
68f5adc284 Merge pull request #1687 from fredj/ol.layer.Heatmap
Add ol.layer.heatmap
2014-03-06 15:00:13 +01:00
Tom Payne
d1a85502a4 Merge pull request #1810 from twpayne/rbush-get-in-extent
Rename ol.structs.RBush#getAllInExtent to getInExtent
2014-03-06 14:40:01 +01:00
Tom Payne
e5ee44f8ad Rename ol.structs.RBush#getAllInExtent to getInExtent 2014-03-06 14:30:56 +01:00
Frédéric Junod
6fb98851d9 Merge pull request #1806 from fredj/overlays-events
Set map in 'add' and 'remove' event handler
2014-03-06 13:33:47 +01:00
Frederic Junod
3bc0a6e6f0 Don't use Uint32Array for IE compatibility 2014-03-06 13:28:18 +01:00
Stéphane Brunner
9789b1c1e3 Add center example 2014-03-06 10:54:39 +01:00
Stéphane Brunner
015c660386 Add ol.View2D#centerOn 2014-03-06 10:54:15 +01:00
Stéphane Brunner
9984ca109c Add ol.View2D#fitGeometry 2014-03-06 10:54:04 +01:00
Bart van den Eijnden
7ebf97406d Add support for writing WFS GetFeature 2014-03-06 09:24:39 +01:00
Frederic Junod
c32d8a2e53 Add ol.layer.Heatmap class and example 2014-03-06 09:14:03 +01:00
Frederic Junod
9d05e08b49 Dispatch 'render' event in renderer.canvas.VectorLayer
The context property of the event only contains the vector rendering.
2014-03-06 09:14:03 +01:00
Frederic Junod
f0f2a2d2b0 Set control map in 'add' and 'remove' event handler 2014-03-06 09:03:38 +01:00
Frederic Junod
3dc9d296eb Set interaction map in 'add' and 'remove' event handler 2014-03-06 09:01:50 +01:00
Frederic Junod
9d8243a772 Set overlay map in 'add' and 'remove' event handler 2014-03-06 09:00:00 +01:00
Tim Schaub
8c9d22c5e5 Merge pull request #1797 from tschaub/convolution-kernel
Example applying a convolution kernel to an image.
2014-03-05 17:27:54 -07:00
Tim Schaub
ed3c4a9cea Merge pull request #1758 from tschaub/get-features
Rename vector source methods.
2014-03-05 17:27:36 -07:00
Tim Schaub
50001132be Transform extent coordinates before clipping 2014-03-05 13:27:40 -07:00
Tim Schaub
a18593ee10 Support minPointsPerRing and default to 3 2014-03-05 12:58:03 -07:00
Tim Schaub
2e47777794 Rename getAllFeaturesAtCoordinate to getFeaturesAtCoordinate 2014-03-05 12:32:09 -07:00
Tim Schaub
30dc8195ca Rename getAllFeatruesInExtent to getFeaturesInExtent 2014-03-05 12:31:09 -07:00
Tim Schaub
333e4a9625 Rename getAllFeatures to getFeatures 2014-03-05 12:29:24 -07:00
Bart van den Eijnden
30865c2a42 Merge pull request #1793 from bartvde/gml-write
Add write support for ol.format.GML (r=@ahocevar)
2014-03-05 16:55:28 +01:00
Bart van den Eijnden
dd9311e79e Revert to cloning the context object 2014-03-05 16:44:01 +01:00
Bart van den Eijnden
75f139bb27 Use a single node factory for more multi geometries 2014-03-05 16:44:01 +01:00
Bart van den Eijnden
e1b2af6cde Combine surface/polygon and linestring/curve writers 2014-03-05 16:44:01 +01:00
Bart van den Eijnden
718b54c292 Do not clone the context for every feature 2014-03-05 16:44:01 +01:00
Bart van den Eijnden
ba2d35fc57 Cache serializers on the context 2014-03-05 16:44:01 +01:00
Bart van den Eijnden
d7f40c11e8 Do not use ol.xml.pushSerializeAndPop for single items 2014-03-05 16:44:01 +01:00
Bart van den Eijnden
16a09930fb Use ol.format.XSD.readNonNegativeIntegerString instead of parseInt 2014-03-05 16:44:01 +01:00
Bart van den Eijnden
64060795ce Use const for schema location 2014-03-05 16:44:00 +01:00
Bart van den Eijnden
2bc5e462d1 Use more intelligent node factories, less duplicate code 2014-03-05 16:44:00 +01:00
Bart van den Eijnden
9b4fc06a5b Finish write support for features 2014-03-05 16:44:00 +01:00
Bart van den Eijnden
8dce3249d6 Implement writeFeatures 2014-03-05 16:44:00 +01:00
Bart van den Eijnden
3e09ea4a00 Finish off writeGeometry 2014-03-05 16:44:00 +01:00
Bart van den Eijnden
6cd9e4bcf4 Add write support for gml:MultiCurve 2014-03-05 16:44:00 +01:00
Bart van den Eijnden
86d90d2f8a Add write support for gml:MultiPolygon 2014-03-05 16:44:00 +01:00
Bart van den Eijnden
414c6e2a12 Add write support for gml:MultiLineString 2014-03-05 16:44:00 +01:00
Bart van den Eijnden
a79f8442c7 Add write support for gml:MultiPoint 2014-03-05 16:43:59 +01:00
Bart van den Eijnden
c4c53a7ac3 Add write support for gml:Curve 2014-03-05 16:43:59 +01:00
Bart van den Eijnden
a6d6317d9e Serialize polygon as surface 2014-03-05 16:43:59 +01:00
Bart van den Eijnden
cbb38c10e0 Add write support for gml:MultiSurface 2014-03-05 16:43:59 +01:00
Bart van den Eijnden
476bd901f0 Add write support for gml:Polygon 2014-03-05 16:43:59 +01:00
Bart van den Eijnden
5240929a53 Correct axis order for gml:pos 2014-03-05 16:43:59 +01:00
Bart van den Eijnden
37a78dc753 Use correct axis order in write 2014-03-05 16:43:59 +01:00
Bart van den Eijnden
083d8d9890 Add write support for gml:LineString 2014-03-05 16:43:58 +01:00
Bart van den Eijnden
717db8b788 Add write support for gml:Point 2014-03-05 16:43:58 +01:00
Frédéric Junod
e0d7470dac Merge pull request #1804 from fredj/box-text
Fix ol.render.Box text
2014-03-05 13:58:05 +01:00
Frederic Junod
db01363c10 Set text style in ol.render.Box 2014-03-05 10:33:34 +01:00
Frederic Junod
08d6e060fa Fix coding style 2014-03-05 10:33:07 +01:00
Tom Payne
189ba34955 Merge pull request #1802 from twpayne/kml-icon-anchor
Fix KML icon anchor origin
2014-03-04 18:06:26 +01:00
Tom Payne
d2a52ba56d Fix KML anchor origin 2014-03-04 16:38:33 +01:00
Tom Payne
6c83189574 Merge pull request #1801 from twpayne/osm-xml-way-id
Set way ids in ol.format.OSMXML
2014-03-04 16:14:31 +01:00
Tom Payne
c06484344e Hoist var declaration 2014-03-04 16:04:52 +01:00
Tom Payne
d46a644c3a Set way ids in ol.format.OSMXML 2014-03-04 16:04:39 +01:00
Tom Payne
44ac3e6b42 Merge pull request #1800 from jachym/patch-1
setState never occures
2014-03-04 13:43:42 +01:00
Jachym Cepicky
be13ca635e setState never occures
Two changes for better parsing of non-existing input sources:

1 - use goog.isDefAndNotNull(source) in the condition (null is also considered as valid source now)
2 - call setState before goog.asserts.fail
2014-03-04 13:01:27 +01:00
Frédéric Junod
d7297795ee Merge pull request #1799 from fredj/mapquest-logo
Use protocol relative logo in ol.source.MapQuest
2014-03-04 11:45:18 +01:00
Frederic Junod
39427cf691 Use protocol relative logo in ol.source.MapQuest 2014-03-04 10:28:05 +01:00
Tom Payne
e6412e13fb Merge pull request #1782 from twpayne/caramenter-hidpi
Add support for Carmenta Server hi-DPI WMS requests
2014-03-03 17:49:24 +01:00
Frédéric Junod
7fd3e2dc7e Merge pull request #1794 from fredj/osmxml-format
Add ol.format.OSMXML and ol.source.OSMXML
2014-03-03 14:39:56 +01:00
Frederic Junod
6ab3f6e175 Add ol.format.OSMXML and ol.source.OSMXML 2014-03-03 14:28:13 +01:00
Tom Payne
2482a3fb9f Add support for Carmenta Server hi-DPI WMS requests 2014-03-03 14:18:24 +01:00
Tom Payne
35349764d9 Merge pull request #1766 from twpayne/kml-style-url
Handle out-of-order and shared Styles and styleUrls in KML
2014-03-03 10:55:37 +01:00
Tom Payne
07eff0181b Merge pull request #1788 from twpayne/interpolate-m
getCoordinateAtM for MultiLineStrings
2014-03-03 09:39:00 +01:00
Tom Payne
c2df9d45a5 Merge pull request #1787 from twpayne/exports-clean-up
Exports clean-up
2014-03-03 09:38:38 +01:00
Tim Schaub
f3b615299f Example applying a convolution kernel to an image 2014-03-02 22:56:50 -07:00
ahocevar
e9c2b0e4c6 Merge pull request #1790 from ahocevar/simpliy-google-example
Simplify the google-map example
2014-03-02 19:41:02 +01:00
ahocevar
caf59eea8f Simplify the google-map example
By creating the ol3 map div in the html, there is no need any
more to wait for the custom GMaps control to append the ol3 map
to its parent. This also fixes an issue that sometimes prevented
the ol3 map to appear, when the GMaps tiles were loaded before
the custom control's div was appended to its parent.
2014-03-02 15:56:21 +01:00
Tom Payne
b2aa9bb19f Export ol.DragBoxEvent coordinate as a property, not a function 2014-03-02 12:24:09 +01:00
Tom Payne
95674a5a4c Export ol.render.canvas.Immediate#setTextStyle 2014-03-02 12:20:14 +01:00
Tom Payne
ddc990500a Sort exports files alphabetically 2014-03-02 12:19:28 +01:00
Tom Payne
8125b4a847 Add ol.geom.MultiLineString#getCoordinateAtM 2014-03-02 12:14:52 +01:00
Tom Payne
296c83fa36 Add ol.geom.flat.lineStringsCoordinateAtM 2014-03-02 12:11:18 +01:00
Tom Payne
85f08d1092 Add documentation to ol.geom.LineString#getCoordinateAtM 2014-03-02 11:38:17 +01:00
Tom Payne
2d9091856c Move layout test in ol.geom.LineString 2014-03-02 11:35:15 +01:00
Tom Payne
c3cad6b6fa Merge pull request #1786 from twpayne/catch-cors-exceptions
Catch CORS exceptions when loading icons
2014-03-01 17:07:08 +01:00
Tom Payne
fb1c66525c Catch CORS exceptions when loading icons 2014-03-01 13:56:44 +01:00
Tom Payne
fe0a32c4db Merge pull request #1759 from twpayne/interpolate-m
Interpolate-M
2014-02-28 17:35:46 +01:00
Tom Payne
fbcb787e8b Merge pull request #1783 from twpayne/first-last-coordinate
Get first and last coordinate
2014-02-28 17:34:13 +01:00
Alexandre Dubé
ae6f557cbc Fix vector-labels example
Typo fixes, add 1 more font
2014-02-28 11:25:07 -05:00
Alexandre Dubé
e3d9b23170 Update vector-labels example
Add note about the 'Text/Wrap' option currently not working.
2014-02-28 10:58:17 -05:00
Alexandre Dubé
3eabcc2565 Remove unused 'align' column from geojson 2014-02-28 10:58:17 -05:00
Alexandre Dubé
1e1020e90d Update vector-labels example
Add forms to let the user change the labels as they want.
Text 'Wrap' doesn't work properly. '\n' are supposed to allow
line to break.
2014-02-28 10:58:17 -05:00
Alexandre Dubé
0c63c76dea Add vector label example 2014-02-28 10:58:17 -05:00
Alexandre Dubé
6cd214c1e4 Add geojson sample files 2014-02-28 10:58:17 -05:00
Frederic Junod
bca9512478 Use ol.geom.LineString#getCoordinateAtM in igc example 2014-02-28 16:33:02 +01:00
Tom Payne
c0f9b1de19 Use binary search in ol.geom.flat.lineStringCoordinateAtM 2014-02-28 16:33:02 +01:00
Tom Payne
1c21316d20 Add tests for ol.geom.LineString#getCoordinateAtM 2014-02-28 16:33:02 +01:00
Tom Payne
c218d5d4e8 Add ol.geom.LineString#getCoordinateAtM 2014-02-28 16:33:02 +01:00
Tom Payne
6781a6cef3 Add ol.geom.flat.lineStringCoordinateAtM 2014-02-28 16:30:03 +01:00
Tom Payne
5803faadcb Merge pull request #1784 from twpayne/interior-point
Export getInteriorPoint(s) methods
2014-02-28 16:21:41 +01:00
Tom Payne
de46a5a053 Add ol.geom.MultiPolygon#getInteriorPoints 2014-02-28 16:10:24 +01:00
Tom Payne
0f884b5d03 Add ol.geom.Polygon#getInteriorPoint 2014-02-28 16:10:01 +01:00
Tom Payne
a1e8ff0a8f Add ol.geom.SimpleGeometry#getLastCoordinate 2014-02-28 15:36:18 +01:00
Tom Payne
7ca47e3b2a Add ol.geom.SimpleGeometry#getFirstCoordinate 2014-02-28 15:36:06 +01:00
ahocevar
b47e6a6cf4 Merge pull request #1771 from ahocevar/tooltip-box
Fix zoom in/out tooltip sizing for box-sizing css resets
2014-02-28 14:59:50 +01:00
Tom Payne
df3ff9e546 Merge pull request #1781 from twpayne/format-feature
Rename ol.format.Format to ol.format.Feature
2014-02-28 14:47:19 +01:00
Tom Payne
8e402371d5 Don't export ol.format.Feature#readProjection 2014-02-28 14:01:46 +01:00
Tom Payne
60bba9aa12 Merge pull request #1778 from twpayne/render-sync-forces-render
Make renderSync always force a render
2014-02-28 13:53:33 +01:00
Tom Payne
56b6913a01 Rename ol.format.XML to ol.format.XMLFeature 2014-02-28 13:13:11 +01:00
Tom Payne
7e32676a9e Rename ol.format.Text to ol.format.TextFeature 2014-02-28 13:11:57 +01:00
Tom Payne
87cf424029 Rename ol.format.JSON to ol.format.JSONFeature 2014-02-28 13:09:14 +01:00
Tom Payne
8ad4b292b7 Rename ol.format.Binary to ol.format.BinaryFeature 2014-02-28 13:07:49 +01:00
Tom Payne
ea8944c755 Rename ol.format.Format to ol.format.Feature 2014-02-28 13:05:57 +01:00
Frédéric Junod
56c45217df Merge pull request #1780 from fredj/unused-require
Remove unused ol.FeatureOverlay require
2014-02-28 10:42:46 +01:00
Frédéric Junod
88ea2bebbd Merge pull request #1777 from fredj/polyline-cleanup
ol.format.Polyline cleanup
2014-02-28 10:40:11 +01:00
Frederic Junod
01288618cf Remove unused ol.FeatureOverlay require 2014-02-28 10:35:10 +01:00
Marc Jansen
7910e98c7a Merge pull request #1779 from marcjansen/build.py-help
Minor change of wording in `build.py help`.
2014-02-28 10:33:55 +01:00
Marc Jansen
fbecd9a6b9 Minor change of wording in build.py help. 2014-02-28 10:31:53 +01:00
Tom Payne
9a7261d6b3 Remove ol.Map#withFrozenRendering 2014-02-27 19:01:39 +01:00
Tom Payne
ad29e6bceb Don't use withFrozenRendering in ol.interaction.Select#handleMapBrowserEvent 2014-02-27 19:01:21 +01:00
Tom Payne
73be72380b Don't use withFrozenRendering in ol.interaction.DragRotateAndZoom#handleDragEnd 2014-02-27 19:01:15 +01:00
Tom Payne
c9c8497b7e Don't use withFrozenRendering in ol.interaction.Interaction.zoomWithoutConstraints 2014-02-27 19:01:07 +01:00
Tom Payne
e0c8b57e11 Don't use withFrozenRendering in ol.interaction.Interaction.rotateWithoutConstraints 2014-02-27 19:01:01 +01:00
Tom Payne
dd83952c28 Make renderSync always force a render 2014-02-27 18:59:05 +01:00
Frederic Junod
7f8d4937f5 Remove unused ol.format.Polyline.decodeUnsignedInteger function 2014-02-27 13:36:08 +01:00
Frederic Junod
c31f70bf08 Remove unused ol.format.Polyline.encodeSignedInteger function 2014-02-27 13:36:08 +01:00
Frederic Junod
040b954e15 Remove unused ol.format.Polyline.encodeFloat function 2014-02-27 13:36:08 +01:00
Frederic Junod
11f718ab22 Remove unused ol.format.Polyline.decodeSignedInteger function 2014-02-27 13:36:08 +01:00
Frederic Junod
b2b5e60f87 Remove unused ol.format.Polyline.decodeFloat function 2014-02-27 13:36:08 +01:00
Frederic Junod
6ad63b113d Improve code and apidoc formating 2014-02-27 13:36:08 +01:00
Tom Payne
c6df670a55 Merge pull request #1776 from twpayne/fix-full-screen-test
Don't check for full screen support at load time
2014-02-27 13:33:14 +01:00
Tom Payne
94a3504252 Revert "Add ol.BrowserFeature.HAS_FULLSCREEN constant"
This reverts commit 5a940c207a.

Detection of full screeen support requires the document to have a body.
This is not the case if ol3 is loaded in the head.  Therefore, defer the
test for full screen support to when it is needed.
2014-02-27 13:28:23 +01:00
Frédéric Junod
99a00b1986 Merge pull request #1767 from fredj/ie11-fullscreen
Add fullscreen API support to IE11
2014-02-27 12:12:36 +01:00
Tom Payne
23f6fc0d0f Merge pull request #1732 from twpayne/render-sync
Switch to asynchronous rendering by default
2014-02-27 11:03:20 +01:00
Frédéric Junod
b8d7bc93b2 Merge pull request #1772 from fredj/doc
Minor doc updates
2014-02-27 10:57:49 +01:00
Frederic Junod
ac9fe664e0 Add fullscreen API support to IE11 2014-02-27 09:31:42 +01:00
Frederic Junod
5a940c207a Add ol.BrowserFeature.HAS_FULLSCREEN constant 2014-02-27 09:30:05 +01:00
Frederic Junod
2f50fcc56c Better ol.Geolocation documentation 2014-02-27 09:25:50 +01:00
Frederic Junod
431ef6ef07 Add newline in quick start doc 2014-02-27 09:23:23 +01:00
Frederic Junod
2f73816916 Fix path to ol.css 2014-02-27 09:23:00 +01:00
ahocevar
3544f70604 Explicit box model definition for box model dependent sizing
The zoom in/out tooltips are clipped when a css reset sets the
box-sizing to anything other than content-box. This breaks the
sizing of these tooltips, because they rely on content-box
sizing. This issue can e.g. be seen when using a bootstrap 3.x
bootstrap.css
2014-02-26 19:22:24 +01:00
ahocevar
f9a9f70a43 Merge pull request #1770 from ahocevar/export-circle
Export #drawCircleGeometry()
2014-02-26 18:36:46 +01:00
Tom Payne
8a8de9d3cc Merge pull request #1769 from twpayne/clean-ups
Trivial clean-ups
2014-02-26 18:27:35 +01:00
Antoine Abt
c915e1209a Merge pull request #1761 from tonio/chrome_buttons
Fix button tips not disappearing on Chrome
2014-02-26 18:24:29 +01:00
ahocevar
bd22ebca45 Export #drawCircleGeometry()
Especially with the immediate API, it is convenient to be able
to draw cirlces.
2014-02-26 18:22:44 +01:00
Tom Payne
1a81227aef Remove trailing whitespace 2014-02-26 17:58:43 +01:00
Tom Payne
c5f7d08694 Remove stray comma 2014-02-26 17:56:22 +01:00
Tom Payne
7bbef0f0ea Read Icon hrefs as URIs 2014-02-26 17:37:49 +01:00
Tom Payne
b3c527166d Be more tolerant of out-of-spec KML files 2014-02-26 17:37:49 +01:00
Tom Payne
42c832154b Refactor KML style handling to handle shared Styles and StyleMaps 2014-02-26 17:37:49 +01:00
Frédéric Junod
74dd99485a Merge pull request #1751 from elemoine/vectorlayer
Fix type error in ol.layer.Vector
2014-02-26 17:24:04 +01:00
Éric Lemoine
e43a8d116e Fix type error in ol.layer.Layer 2014-02-26 16:44:52 +01:00
Frederic Junod
69749dee55 Fix type error in ol.layer.Vector 2014-02-26 16:39:21 +01:00
Tom Payne
0daa2b1781 Merge pull request #1757 from twpayne/interim-tiles-on-error
Add option to use interim tiles on tile errors
2014-02-26 16:36:52 +01:00
Tom Payne
d42a262814 Add out-of-order shared Style and StyleMap test 2014-02-26 16:08:01 +01:00
Tom Payne
e3980078d9 Merge pull request #1764 from bentrm/win-build
Updated build script to run target integration-test in Win
2014-02-26 13:22:04 +01:00
Benjamin Thurm
cb8d9d9b68 Update Win build defaults with min fallbacks 2014-02-26 11:42:34 +01:00
Antoine Abt
d53fa8f45a Fix chrome not to blur on mouseout/focusout
may be related to https://code.google.com/p/chromium/issues/detail?id=321264 ?
2014-02-26 11:24:54 +01:00
Antoine Abt
7426da61ea Make ZoomToExtent listen on button click
& not its container
2014-02-26 11:15:03 +01:00
Benjamin Thurm
1253765c89 Remove unused import and variable 2014-02-26 10:28:09 +01:00
Benjamin Thurm
a19e992a5b Run files via shell commands for Win compatibility 2014-02-26 09:53:56 +01:00
Tim Schaub
af1bd0228c Function for applying a 2d transform to an extent 2014-02-25 22:07:16 -07:00
Tim Schaub
2750f53fda Clip to max extent 2014-02-25 21:47:57 -07:00
Tim Schaub
50822a4d58 Skip coordinates that don't affect the rendered extent
Segments that intersect the replay group's extent are drawn.  Any segment that represents a change in coordinate-extent relationship is drawn.  This maintains the left/right relationship (or cross product) between points in the rendered extent and every rendered segment.

Still left undone: clip the replay group's rendering to the max extent.
2014-02-25 21:47:57 -07:00
Tim Schaub
6b018bbaf9 Testing segment intersection with extent
If needed, this function can be modified to take two additional coorinates that will be set to the intersection points.
2014-02-25 21:47:57 -07:00
Tim Schaub
cb11959f01 Determining coordinate relationship to extent 2014-02-25 21:47:57 -07:00
Tim Schaub
f4746687e8 Keep track of max extent for replay 2014-02-25 21:47:57 -07:00
Tim Schaub
ee2485534a Add an example that renders a simple fractal
This works at resolutions where simplification is significantly reducing the number of points in the line.  At high resolutions, navigation becomes unresponsive.  Limiting draw instructions to a replay group's extent will fix this.
2014-02-25 21:47:56 -07:00
Tim Schaub
667f4278b3 Merge pull request #1748 from tschaub/roughly
Fix test failures on Chrome 33.  The trig functions in V8 have changed, and are may change again (see https://code.google.com/p/v8/issues/detail?id=3006 for the full story).  As a result, we no longer rely on Vincenty for antipodal distance calculations (not recommended anyway), and we use a very low precision match for testing cosine distance on a sphere.
2014-02-25 15:39:31 -07:00
Tom Payne
69addbca87 Merge pull request #1749 from twpayne/windows-newlines
Generate proper line endings on Windows
2014-02-25 22:26:54 +01:00
Tom Payne
face69cda9 Remove reference to stale build/src/external/src/types.js target 2014-02-25 22:16:45 +01:00
Tom Payne
d0c83c74d2 Update to the latest version of pake 2014-02-25 22:02:35 +01:00
Bart van den Eijnden
a78b25cdca Merge pull request #1760 from bartvde/gmlfix2
Get rid of unneccessary if else statements in the GML format (r=@ahocevar)
2014-02-25 20:14:13 +01:00
Bart van den Eijnden
a2c01b1090 Get rid of unneccessary if else statements in the GML format 2014-02-25 19:58:15 +01:00
Bart van den Eijnden
c945768e0e Merge pull request #1752 from bartvde/gml-rewrite
Add format for reading GML v3 (r=@ahocevar)
2014-02-25 19:30:56 +01:00
Bart van den Eijnden
28b12e1b28 Remove unused ol.format.GML.NAMESPACE_URIS_ 2014-02-25 19:13:20 +01:00
Bart van den Eijnden
272a3762d6 Make sure function naming convention is consistent 2014-02-25 18:53:30 +01:00
Bart van den Eijnden
182eba5890 Use goog.isDef where possible 2014-02-25 17:41:14 +01:00
Bart van den Eijnden
7d02c4a371 Handle undefined value at readGeometryFromNode instead 2014-02-25 17:28:36 +01:00
Bart van den Eijnden
46a6f96032 Handle that ol.xml.pushParseAndPop can return undefined 2014-02-25 17:25:14 +01:00
Bart van den Eijnden
8d623d765a Do not create parsers in wfs namespace if not needed 2014-02-25 17:11:24 +01:00
Bart van den Eijnden
6256bf1989 Add feature id (fid) parsing 2014-02-25 16:28:10 +01:00
Bart van den Eijnden
98368a554d Use ol.xml.pushParseAndPop instead 2014-02-25 14:58:16 +01:00
Tom Payne
63e5ec9020 Merge pull request #1756 from twpayne/clean-up-preload
Move preload default value to where it is used
2014-02-25 14:51:22 +01:00
Bart van den Eijnden
346aa730e5 Merge pull request #5 from ahocevar/gml-context
Always use a context for GML parsing
2014-02-25 14:48:10 +01:00
ahocevar
71e1dc9f45 Always use a context for GML parsing
The context is at the bottom of the object stack. All entry
points to parsing (#readGeometryFromNode(),
#readFeaturesFromNode()) set up the context now, and parsers
always access the context at index 0 of the objectStack.
2014-02-25 14:33:20 +01:00
Bart van den Eijnden
679b152852 Add srsName info at index 0 in the stack 2014-02-25 13:58:19 +01:00
Bart van den Eijnden
08e2ccb59a Handle srsName better 2014-02-25 13:22:15 +01:00
Tom Payne
0118c3ec17 Activate useInterimTilesOnError in ol.renderer.dom.TileLayer 2014-02-25 13:12:23 +01:00
Tom Payne
8bd44b2fc6 Activate useInterimTilesOnError in ol.renderer.webgl.TileLayer 2014-02-25 13:09:10 +01:00
Tom Payne
0c7a19a307 Activate useInterimTilesOnError in ol.renderer.canvas.TileLayer 2014-02-25 12:59:09 +01:00
Bart van den Eijnden
cbe71fefd0 Merge pull request #4 from ahocevar/gml-stack
Use stack instead of recursion
2014-02-25 09:45:10 +01:00
ahocevar
b4454535f7 Use stack instead of recursion for features
This also allows us to work without a local copy of the
namespace URIs.
2014-02-25 09:34:38 +01:00
Tim Schaub
bfc42ffa62 More realistic precision for cosine distance results
Chris Veness' discussion of using the spherical law of cosines (http://www.movable-type.co.uk/scripts/latlong.html) suggests it gives well-conditioned results "around 1 metre" in JavaScript (this assumes a sphere with 6,371km radius).

In Chrome 33, Math.pow(Math.cos(Math.PI / 4), 2) yields 0.4999999999999999.  When we take the arccosine of twice this, we get something significantly different than zero.  Multiplying by 6371 means we can't assert that this is within 1e-9 of zero.
2014-02-24 15:54:17 -07:00
Tim Schaub
ac83bb78f1 More repeated test cases 2014-02-24 15:02:30 -07:00
Tim Schaub
b01e90b942 Removing repeated test cases 2014-02-24 14:59:18 -07:00
Tim Schaub
7f1a13361b Remove antipodal test cases
The Vincenty formula can fail to converge for antipodal points (see http://en.wikipedia.org/wiki/Vincenty's_formulae#Nearly_antipodal_points), so those test cases are removed.  These tests fail with the latest V8 due to optimization of trig functions with lookup tables.  For example, Math.cos(Math.PI / 2) is no longer calculated based on the value of Math.PI / 2 (which is different than the actual value of π / 2).  Instead, values close to multiples of π / 2 are determined to be 0 (which is arguably what you want).  Previously the tests were relying on very small numbers being returned in this case.
2014-02-24 14:53:00 -07:00
Tim Schaub
2537fb4574 Fixing test failure on Chrome 33 2014-02-24 14:53:00 -07:00
Tom Payne
d0a352816c Add useInterimTilesOnError property to ol.layer.Tile 2014-02-24 21:30:39 +01:00
Tom Payne
8c665c0bb1 Move preload property default value into ol.renderer.Layer#manageTilePyramid 2014-02-24 21:26:11 +01:00
Bart van den Eijnden
0a71b5bbaa Rename NAMESPACE_URIS_ to namespaceURIs_ 2014-02-24 16:59:08 +01:00
Bart van den Eijnden
d2c88c1ea3 Use readFeatureFromNode instead 2014-02-24 16:49:35 +01:00
Bart van den Eijnden
0a93bb38f8 Copy NAMESPACE_URIS_ array to the instance 2014-02-24 16:01:15 +01:00
Tom Payne
53d9335282 Merge pull request #1753 from oterral/fix_typo
Fix option name zoomInTipLabel
2014-02-24 15:37:47 +01:00
oterral
7e842b0850 Fix option name zoomInTipLabel 2014-02-24 15:26:13 +01:00
Bart van den Eijnden
831d233874 Move parseGeometry workaround into the tests 2014-02-24 15:25:54 +01:00
Bart van den Eijnden
a095d41ac4 Add support for axis orientation 2014-02-24 15:25:54 +01:00
Bart van den Eijnden
7145179c30 Port over more test cases 2014-02-24 15:25:54 +01:00
Bart van den Eijnden
dd8d69f976 Call setGeometryName on the feature 2014-02-24 15:25:54 +01:00
Bart van den Eijnden
b2885217df Add feature parsing from WFS FeatureCollection 2014-02-24 15:25:54 +01:00
Bart van den Eijnden
796e7be623 Add preliminary read support for features 2014-02-24 15:25:53 +01:00
Bart van den Eijnden
54426133ab Add test case for gml:LinearRing 2014-02-24 15:25:53 +01:00
Bart van den Eijnden
9e44e79789 Add support for gml:MultiSurface 2014-02-24 15:25:53 +01:00
Bart van den Eijnden
e479bd142f Add gml:MultiCurve support 2014-02-24 15:25:53 +01:00
Bart van den Eijnden
086828ba14 Add support for gml:MultiPolygon 2014-02-24 15:25:53 +01:00
Bart van den Eijnden
a484452207 Add support for gml:MultiLineString 2014-02-24 15:25:53 +01:00
Bart van den Eijnden
aa4d798dc7 Add gml:MultiPoint parsing 2014-02-24 15:25:53 +01:00
Bart van den Eijnden
95bbb849bb Deal with srsDimension 2014-02-24 15:25:53 +01:00
Bart van den Eijnden
877d5a445e Add parser for gml:Envelope 2014-02-24 15:25:52 +01:00
Bart van den Eijnden
85fe1bf737 Add parsing for gml:Curve 2014-02-24 15:25:52 +01:00
Bart van den Eijnden
e845d6558c Add parsing for gml:Surface 2014-02-24 15:25:52 +01:00
Bart van den Eijnden
ae1e660ab4 Add geometry parsing for point, line, polygon 2014-02-24 15:25:52 +01:00
ahocevar
28d0d82253 Merge pull request #1716 from ahocevar/gpx-write
Write support for ol.format.GPX
2014-02-24 14:23:16 +01:00
ahocevar
3a560c9843 Put jsdoc comment into effect 2014-02-24 14:14:13 +01:00
ahocevar
bb38771096 No magic for namespace URI 2014-02-24 14:13:41 +01:00
ahocevar
c1a966bb6f namespaceURI can be null, but not undefined 2014-02-24 13:55:20 +01:00
Tom Payne
f028befdf9 Merge pull request #1739 from twpayne/rotate-with-map
Allow icons to be rotated with the map
2014-02-24 13:06:48 +01:00
Antoine Abt
e213bccef7 Merge pull request #1740 from tonio/interaction_api
Editing interaction api cleanup
2014-02-24 08:46:49 +01:00
Tom Payne
55755871c2 Use write to avoid newline problems 2014-02-23 14:45:30 +01:00
Tom Payne
8e9d5fb0e9 Always write binary files in mode wb 2014-02-23 14:33:38 +01:00
Tom Payne
48b85316bb Always read binary files with mode rb 2014-02-23 14:33:38 +01:00
Tom Payne
3aedca7bd6 Always read line-by-line with mode rU 2014-02-23 13:50:54 +01:00
ahocevar
7b56abdac7 Get rid of compiler warnings 2014-02-23 01:50:59 +01:00
Tim Schaub
9d06dd82ff Merge pull request #1745 from tschaub/linked-css
Don't inject stylesheets with JavaScript.
2014-02-22 09:08:20 -07:00
Tim Schaub
e633f7f8c1 Don't inject stylesheets with JavaScript
This reverts 4d619d71b1 (see #1527), going back to what we had after e13075f6ff (see #881).

To avoid the 404 in the hosted examples, the css is copied to the same relative path when hosted as during development.
2014-02-21 18:45:46 -07:00
ahocevar
696425af36 Documentation and cleanup 2014-02-21 22:49:33 +01:00
ahocevar
480a6a85ba Add trk serialization for ol.format.GPX 2014-02-21 20:27:04 +01:00
ahocevar
791cb2415b Simplify annotations 2014-02-21 20:22:44 +01:00
ahocevar
1354d8ce78 Added rte serialization for ol.format.GPX 2014-02-21 16:55:48 +01:00
ahocevar
13b4f07cd9 New makeChildrenAppender function and Node factory refactoring
The makeChildAppender function is used for adding a node of a
type with maxOccurs=1. For adding nodes of a type with
maxOccurs>1, the new makeChildrenAppender function was added.

With this new function, it turned out that more convenience for
creating node factories is required. The makeChildNodeFactory
function was renamed to makeSimpleNodeFactory, and it now can
create node factories where not only the namespace, but also the
node name can be fixed.
2014-02-21 16:55:05 +01:00
Tom Payne
3c32bbdce3 Document rotateWithView option 2014-02-21 14:32:15 +01:00
Tom Payne
7a34929b15 Rename rotateWithMap to rotateWithView 2014-02-21 14:32:06 +01:00
Antoine Abt
a971928bbe Add features option to draw interaction 2014-02-21 13:41:07 +01:00
Tom Payne
a17055a419 Activate rotateWithMap option in ol.render.canvas.Immediate 2014-02-21 12:57:34 +01:00
Tom Payne
0e90cf02ad Pass view rotation to ol.render.canvas.Immediate 2014-02-21 12:57:09 +01:00
Antoine Abt
ec832bdf6e Modify interaction takes style & features options
Instead of a FeatureOverlay
2014-02-21 12:35:30 +01:00
Tom Payne
1d2c88efb9 Merge pull request #1717 from twpayne/binary-format
Add ol.format.Binary
2014-02-21 12:27:13 +01:00
Bart van den Eijnden
591e4b56df Merge pull request #1737 from bartvde/multipolygon
Implement setPolygons on ol.geom.MultiPolygon (r=@twpayne)
2014-02-21 12:24:13 +01:00
Antoine Abt
7cea6f3240 Make select interaction create its FeatureOverlay
You can now configure it with a `style` option.
2014-02-21 11:59:43 +01:00
Tom Payne
222fafcb77 Activate rotateWithMap option in ol.render.canvas.Replay 2014-02-21 11:57:11 +01:00
Tom Payne
fe420ce1eb Pass view rotation to replay 2014-02-21 11:56:34 +01:00
Bart van den Eijnden
9bade5ce87 Implement setPolygons on ol.geom.MultiPolygon 2014-02-21 11:28:18 +01:00
Tom Payne
27c5ab0312 Replace subtractViewRotation with rotateWithMap 2014-02-21 11:21:20 +01:00
Éric Lemoine
fe159aa7fa Merge pull request #1726 from oterral/fix_anchororigin
Add anchorOrigin option in ol.style.Icon
2014-02-21 09:24:23 +01:00
oterral
0a6390fb21 Add anchorOrigin option in ol.style.Icon 2014-02-21 09:09:59 +01:00
ahocevar
b4043398eb Added wpt serialization for ol.format.GPX 2014-02-21 07:18:42 +01:00
ahocevar
45860f4552 Framework for serializing structures to XML
This adds several helper functions for serializing to XML:

* ol.xml.serialize: Counterpart to ol.xml.parse. By splitting
  the serialization process up into a node factory and a node
  writer, note writers can easily be used for different
  namespaces.

* ol.xml.pushSerializeAndPop: Counterpart to
  ol.xml.pushParseAndPop.

* ol.xml.makeStructureNS: Works like ol.xml.createParsersNS,
  but works for arbitrary structures.

* ol.xml.makeChildAppender: If the top item of the stack has
  the new ol.xml.NodeStackItem type, this helper function
  can be used to create a serializer that appends the current
  node to its designated parent.

* ol.xml.makeChildNodeFactory: Creates a node factory which
  produces child nodes from an array of node names which are
  passed to ol.xml.serialize.

* ol.xml.makeSequence: A convenience function for creating
  xsd:sequence structures. Takes an object literal and an
  ordered list of the keys, and returns an array that can be
  passed as values to ol.xml.serialize.

* ol.xml.makeSimpleTypeWriter: Using e.g. the new write*TextNode
  functions from ol.format.XSD, this function creates a node
  writer that writes simple type nodes for values like strings
  or numbers.

The following commits will be using this new framework for
implementing ol.format.GPX.writeFeatures, and prose
documentation with instructions based on what was said above
will be added.
2014-02-21 07:18:36 +01:00
Tim Schaub
8a9fdbdeb7 Merge pull request #1734 from tschaub/unused-types
Remove unused types from objectliterals.jsdoc.
2014-02-20 16:15:21 -07:00
Tom Payne
dd3f4b9c00 Merge pull request #1733 from twpayne/zoomify-clean-ups
Zoomify clean-ups
2014-02-20 23:49:10 +01:00
Tim Schaub
4cc4c157fb No WFS parser currently 2014-02-20 15:32:18 -07:00
Tom Payne
c4786304b7 Only render overlays if the map is rendered 2014-02-20 19:56:42 +01:00
Tom Payne
443e7d9a8c Add ol.Map#isRendered 2014-02-20 19:56:22 +01:00
Tom Payne
710d0c1bd8 Handle asynchronous rendering in tests 2014-02-20 19:44:29 +01:00
Tom Payne
316c146613 Switch to asynchronous rendering by default 2014-02-20 19:42:00 +01:00
Tom Payne
a773ab256c Use a switch to select tier size calculation 2014-02-20 19:30:47 +01:00
Tom Payne
00eff70ae6 Use an enum for Zoomify tier size calculation option 2014-02-20 19:29:56 +01:00
Tom Payne
bf798ea766 Document tierSizeCalculation property 2014-02-20 19:28:43 +01:00
Tim Schaub
0692db7bc3 Merge pull request #1669 from tschaub/default-style
Provide a useful default style.
2014-02-20 11:09:12 -07:00
Antoine Abt
b6005fc834 Merge pull request #1725 from tonio/a11y-enhanced-zoomcontrol
Enhance controls accessibility
2014-02-20 17:15:12 +01:00
Tom Payne
5ce6ad99bb Merge pull request #1731 from felixgirault/ol.source.zoomify
Add an alternative algorithm for zoomify tier size calculation
2014-02-20 17:12:17 +01:00
Tim Schaub
0015331273 Provide a default style function 2014-02-20 08:57:11 -07:00
Tom Payne
a8f932fa07 Rename ol.Map#requestRenderFrame to ol.Map#render 2014-02-20 16:54:20 +01:00
Antoine Abt
ae3ad24928 Reorder default controls 2014-02-20 16:52:09 +01:00
Antoine Abt
3e21ad6dd2 Wording in description 2014-02-20 16:47:34 +01:00
Antoine Abt
30bc97755a Restore preventDefault call that shouldn’t have been removed 2014-02-20 16:47:34 +01:00
Antoine Abt
2a48197234 Css tweaks for touch devices 2014-02-20 16:47:34 +01:00
Antoine Abt
fd9b4a7ee9 Use «em» based positioning 2014-02-20 16:47:34 +01:00
Antoine Abt
ed8e0e8552 Minor cleanups 2014-02-20 16:47:34 +01:00
Antoine Abt
d52f62fb5a Make Fullscreen control use <button> instead of <a> 2014-02-20 16:47:33 +01:00
Félix Girault
a045a62651 Use shorter syntax for integer division by 2 2014-02-20 16:45:08 +01:00
Éric Lemoine
dc5c713536 Merge pull request #1730 from elemoine/colorcache
Fix handling of the color cache
2014-02-20 13:33:39 +01:00
Éric Lemoine
9428fb109f Fix handling of the color cache 2014-02-20 11:26:02 +01:00
Félix Girault
ac785459da Add an alternative algorithm for zoomify tier size calculation
Zoomify uses a different algorithm than ol3 to calculate the number of
tiles per tier.
These algorithms are compatible in most cases, but they will lead to
different results with some particular image sizes.

This update provides an option for the zoomify source to use one of
these two algorithms.
2014-02-20 11:17:16 +01:00
Frédéric Junod
3b79e2f4c7 Merge pull request #1727 from fredj/drop-fontawesome
Remove Font Awesome
2014-02-20 09:04:30 +01:00
Tom Payne
ebdb5dce22 Rename ol.Map#render to ol.Map#renderSync 2014-02-20 03:05:31 +01:00
Tim Schaub
29e894f913 Merge pull request #1728 from tschaub/set-values
Make setValues behave like multiple calls to set.
2014-02-19 12:00:54 -07:00
Tim Schaub
59cbe7c23a Safer feature constructor
Calling setValues now behaves like calling set (closes #1672)
2014-02-19 10:20:57 -07:00
Tim Schaub
6344b8e06c Make setValues consistent with repeated calls to set 2014-02-19 10:17:39 -07:00
Frederic Junod
c02920be8f Remove Font Awesome
Everything that we need (icon-arrow-left, icon-arrow-right, icon-plus,
icon-minus, icon-download and icon-flag) is already provided by Bootstrap.
2014-02-19 18:04:08 +01:00
Frédéric Junod
f88703053a Merge pull request #1724 from fredj/ol.dom.input
ol.dom.Input cleanups
2014-02-19 15:14:11 +01:00
Frédéric Junod
d178e29565 Merge pull request #1696 from fredj/ol.style.image-opacity
Add new opacity property to ol.style.Image
2014-02-19 11:48:20 +01:00
Frederic Junod
0e73ffa9d9 Set ol.style.Icon opacity 2014-02-19 11:40:40 +01:00
Frederic Junod
a445e81115 Handle image opacity in ol.render.canvas.Immediate 2014-02-19 11:40:40 +01:00
Frederic Junod
fca0942c30 Handle image opacity in ol.render.canvas.ImageReplay 2014-02-19 11:40:40 +01:00
Frederic Junod
430ff9c850 Add opacity property to ol.style.Image 2014-02-19 11:40:40 +01:00
Frederic Junod
03b979c30a Listen to 'input' and 'change' events 2014-02-19 11:37:05 +01:00
Frederic Junod
4e7d697273 Add missing function arguments 2014-02-19 11:37:05 +01:00
Frederic Junod
c9e9cbc7c8 Change ol.dom.Input target param from Element to HTMLInputElement 2014-02-19 11:37:05 +01:00
Frederic Junod
1e0ce96e9f Remove 'valueAsNumber' property from observable list
The property was removed in a0bea641d1
2014-02-19 09:53:46 +01:00
Antoine Abt
b3abc166a4 Make zoomToExtent control use <button> instead of <a> 2014-02-19 09:34:04 +01:00
Éric Lemoine
a734c8a6ff Merge pull request #1720 from elemoine/assign
Initialize properties in the constructor
2014-02-19 08:18:53 +01:00
Éric Lemoine
aee620d2d9 Initialize properties in the constructor 2014-02-19 00:13:39 +01:00
Antoine Abt
b6052320ad Coding style 2014-02-18 15:49:45 +01:00
Antoine Abt
1a44fb2ff3 Make zoom control tip texts configurable 2014-02-18 15:25:58 +01:00
Antoine Abt
a1d838c10c Use «em» for buttons sizing 2014-02-18 15:18:58 +01:00
Tom Payne
e40b9adde0 Add binary support to ol.source.VectorFile 2014-02-17 17:44:28 +01:00
Tom Payne
ef82965c0a Add ol.format.Binary 2014-02-17 17:44:28 +01:00
Tom Payne
cd2200b4af Add ol.binary 2014-02-17 17:44:28 +01:00
Tom Payne
399116ed82 Add binary support to ol.format.Format 2014-02-17 17:44:24 +01:00
Tom Payne
2d0b90a845 Add ol.BrowserFeature.HAS_ARRAY_BUFFER 2014-02-17 17:37:55 +01:00
Tom Payne
21a5052da6 Include VBArray externs in build 2014-02-17 17:37:25 +01:00
Tom Payne
2a42c6f472 Add VBArray externs 2014-02-17 17:37:07 +01:00
Tom Payne
524acc1901 Sort externs alphabetically 2014-02-17 17:36:49 +01:00
Antoine Abt
f8cfa9a24d Better integration of button tooltips 2014-02-17 16:43:35 +01:00
Mark Prins
18c2ffe522 use button elements instead of anchor elements and add tooltips to zoomcontrol 2014-02-17 14:57:15 +01:00
Mark Prins
9adf8b01f6 use button elements and add tooltips to zoomcontrol 2014-02-17 14:57:15 +01:00
Frédéric Junod
497a71ca6e Merge pull request #1715 from fredj/apidoc
Minor jsdoc fixes
2014-02-17 14:46:58 +01:00
Frederic Junod
d2c2ba3921 Add geom.jsdoc 2014-02-17 14:31:28 +01:00
Frederic Junod
bef5b0debe Minor api fixes 2014-02-17 14:25:34 +01:00
Éric Lemoine
9619e2832a Merge pull request #1702 from igrcic/tileWMS-extents-1701
Do not request tiles outside of extents for TileWMS source
2014-02-17 14:17:27 +01:00
Bart van den Eijnden
673027ae11 Merge pull request #1714 from bartvde/issue-1714
404 in api docs for TileGridOptions (r=@twpayne)
2014-02-17 13:54:08 +01:00
Bart van den Eijnden
d85fcd1ad4 Add olx.tilegrid namespace to the API doc 2014-02-17 13:46:01 +01:00
Antoine Abt
aa51edbeef Make fullscreen control use shared styles 2014-02-17 12:30:57 +01:00
Antoine Abt
e567383269 Share styles between zoom & extent control 2014-02-17 12:30:57 +01:00
Antoine Abt
edd69ac95f Remove unneeded selectors, share font-family definitions 2014-02-17 12:30:57 +01:00
Éric Lemoine
2311213136 Merge pull request #1713 from elemoine/zoomcontrol
Use minus sign as zoom out label
2014-02-17 12:15:09 +01:00
Éric Lemoine
4b4c2d7deb Merge pull request #1711 from elemoine/modify
Modify interaction doesn't need to store styles
2014-02-17 12:14:29 +01:00
Antoine Abt
a658435e38 Merge pull request #1705 from tonio/geojson_null_geometry
Allow GeoJSON features to have `null` geometries.
2014-02-17 08:23:05 +01:00
Antoine Abt
04f1f2120b Merge pull request #1697 from tonio/remove_renderer_guess
Remove `ol.RendererHints.createFromQueryData` from the library
2014-02-17 08:21:18 +01:00
Ivan Grcic
ff32b80035 Add tests for TileWMS tileUrlFunction 2014-02-17 01:23:24 +01:00
Ivan Grcic
34d5f24816 Do not load tiles outside extents for TileWMS source 2014-02-17 01:23:23 +01:00
Éric Lemoine
66a17b20e0 Better code formatting 2014-02-16 23:20:32 +01:00
Éric Lemoine
eef32c5d5d Use minus sign as zoom out label 2014-02-16 23:19:03 +01:00
Tom Payne
e0b8e6005c Merge pull request #1712 from twpayne/fix-text-line-dash-immediate
Handle null line dashes for text stroke styles in ol.render.canvas.Immediate
2014-02-16 20:27:35 +01:00
Tom Payne
ea67e21116 Handle null line dashes for text stroke styles in ol.render.canvas.Immediate 2014-02-16 18:46:36 +01:00
Éric Lemoine
db83b11eee Modify interaction doesn't need to store styles 2014-02-16 16:15:11 +01:00
ahocevar
3463defd9c Merge pull request #1707 from ahocevar/css-transform-detection
CSS transform detection when DOM is ready
2014-02-16 02:47:02 +01:00
ahocevar
f3c099de8a Simplifying has2d and has3d check 2014-02-16 02:29:14 +01:00
ahocevar
91a736954d Properly cache the css transform support result 2014-02-15 17:37:37 +01:00
Tom Payne
1baf63cebe Merge pull request #1709 from twpayne/fix-immediate-text-style
Set text style in ol.render.canvas.Immediate
2014-02-15 16:14:57 +01:00
Tom Payne
a5fd5667b6 Set text style in ol.render.canvas.Immediate 2014-02-15 14:17:10 +01:00
ahocevar
81f7ea106b CSS transform detection when DOM is ready
The code to detect CSS transforms requires a DOM to append an
element to. By performing this action when first called instead
of unconditionally upon library load, we can load OpenLayers in
the document's head again.
2014-02-15 10:48:04 +01:00
Antoine Abt
24ee4cb742 [GeoJSON] Add support for feature with null geometries 2014-02-14 15:12:16 +01:00
Antoine Abt
d9c5102bcd Add failing test for feature with null geometries 2014-02-14 15:02:49 +01:00
Antoine Abt
4478d6c34c Fixes mobile fullscreen example (no mode chooser) 2014-02-14 09:32:14 +01:00
Antoine Abt
4dd8c248f5 Remove ol.RendererHints.createFromQueryData 2014-02-14 09:32:14 +01:00
Antoine Abt
21bfdb1d1e Add example extern for exampleNS 2014-02-14 09:32:14 +01:00
Antoine Abt
b169ef2094 Add renderer guess in example shared file
& use it in every example.
2014-02-13 17:21:03 +01:00
Antoine Abt
2369ac62eb Load example-behaviour before example script 2014-02-13 17:21:02 +01:00
549 changed files with 23369 additions and 21975 deletions

4
.jshintrc Normal file
View File

@@ -0,0 +1,4 @@
{
"-W030": true,
"-W083": true
}

View File

@@ -5,6 +5,7 @@ before_install:
- "git fetch origin refs/tags/v3.2.2:refs/tags/v3.2.2"
- "git checkout tags/v3.2.2"
- "cd ../.."
- "npm install"
before_script:
- "./build.py plovr"

View File

@@ -4,7 +4,7 @@
Welcome to [OpenLayers 3](http://ol3js.org/)!
Check out the [hosted examples](http://ol3js.org/en/master/examples/) or poke around the evolving [API docs](http://ol3js.org/en/master/apidoc/).
Check out the [hosted examples](http://ol3js.org/en/master/examples/), the [workshop](http://ol3js.org/ol3-workshop/) or poke around the evolving [API docs](http://ol3js.org/en/master/apidoc/).
Please don't ask questions in the github issue tracker but use [the mailing list](https://groups.google.com/forum/#!forum/ol3-dev) instead.

View File

@@ -8,7 +8,13 @@
},
"source": {
"includePattern": ".+\\.js(doc)?$",
"excludePattern": "(^|\\/|\\\\)_"
"excludePattern": "(^|\\/|\\\\)_",
"exclude": [
"src/googx/dom/fullscreen.js"
],
"include": [
"src"
]
},
"plugins": [
"plugins/markdown",

View File

@@ -1,10 +1,13 @@
/*
* This plugin parses goog.exportSymbol and goog.exportProperty calls to build
* a list of API symbols and properties. Everything else is marked undocumented,
* which will remove it from the docs.
* This plugin parses externs/oli.js as well as goog.exportSymbol and
* goog.exportProperty calls to build a list of API symbols and properties.
* Unexported modules linked from @param or @fires will be marked unexported,
* and the documentation will not contain the constructor. Everything else is
* marked undocumented, which will remove it from the docs.
*/
var api = [];
var unexported = [];
function collectExports(source) {
var i, ii, symbol, property;
@@ -27,9 +30,22 @@ function collectExports(source) {
}
}
function collectOliExports(source) {
var oli = source.match(/[^\{]oli\.([^;^ ]*);? ?/g);
if (oli) {
i = 0; ii = oli.length;
for (; i < ii; ++i) {
property = 'ol.' + oli[i].match(/oli.([^;]*)/)[1]
.replace('.prototype.', '#');
unexported.push(property);
}
}
}
var encoding = env.conf.encoding || 'utf8';
var fs = require('jsdoc/fs');
collectExports(fs.readFileSync('build/src/external/src/exports.js', encoding));
collectOliExports(fs.readFileSync('externs/oli.js', encoding));
exports.handlers = {
@@ -56,7 +72,6 @@ exports.handlers = {
}
}
if (api.indexOf(e.doclet.longname) > -1) {
// Add params of API symbols to the API
var names, name;
var params = e.doclet.params;
if (params) {
@@ -65,43 +80,39 @@ exports.handlers = {
if (names) {
for (j = 0, jj=names.length; j < jj; ++j) {
name = names[j];
if (api.indexOf(name) === -1) {
api.push(name);
if (unexported.indexOf(name) === -1) {
unexported.push(name);
}
}
}
}
}
}
}
};
function filter(e) {
if (e.doclet) {
var fqn = e.doclet.longname;
if (fqn) {
e.doclet.undocumented = (api.indexOf(fqn) === -1);
// Remove parents that are not part of the API
var parent;
var parents = e.doclet.augments;
if (parents) {
for (var i = parents.length - 1; i >= 0; --i) {
parent = parents[i];
if (api.indexOf(parent) === -1) {
parents.splice(i, 1);
var links = e.doclet.comment.match(/\{@link ([^\}]*)\}/g);
if (links) {
for (i=0, ii=links.length; i < ii; ++i) {
var link = links[i].match(/\{@link (.*)\}/)[1];
if (unexported.indexOf(link) === -1) {
unexported.push(link);
}
}
}
}
}
}
},
exports.nodeVisitor = {
visitNode: function(node, e, parser, currentSourceName) {
// filter out non-API symbols before the addDocletRef finisher is called
e.finishers.unshift(filter);
parseComplete: function(e) {
for (var j = e.doclets.length - 1; j >= 0; --j) {
var doclet = e.doclets[j];
if (doclet.kind == 'namespace' || doclet.kind == 'event' || doclet.fires) {
continue;
}
var fqn = doclet.longname;
if (fqn) {
doclet.unexported = (api.indexOf(fqn) === -1 && unexported.indexOf(fqn) !== -1);
if (api.indexOf(fqn) === -1 && unexported.indexOf(fqn) === -1) {
e.doclets.splice(j, 1);
}
}
}
}
};

View File

@@ -1,5 +1,5 @@
/*
* This is a hack to prevent inheritDoc and override tags from entirely removing
* This is a hack to prevent inheritDoc tags from entirely removing
* documentation of the method that inherits the documentation.
*
* TODO: Remove this hack when https://github.com/jsdoc3/jsdoc/issues/53
@@ -8,7 +8,7 @@
exports.nodeVisitor = {
visitNode: function(node, e, parser, currentSourceName) {
if (/@(inheritDoc|override)(\n|\r)/.test(e.comment)) {
if (/@(inheritDoc)(\n|\r)/.test(e.comment)) {
e.preventDefault = true;
}
}

View File

@@ -21,6 +21,12 @@ exports.defineTags = function(dictionary) {
description: description,
readonly: readonly
});
if (!doclet.fires) {
doclet.fires = [];
}
if (doclet.fires.indexOf('{@link ol.ObjectEvent} ol.event:ObjectEvent') === -1) {
doclet.fires.push('{@link ol.ObjectEvent} ol.event:ObjectEvent');
}
}
});
};

View File

@@ -22,6 +22,12 @@ exports.defineTags = function(dictionary) {
description: description,
readonly: readonly
});
if (!doclet.fires) {
doclet.fires = [];
}
if (doclet.fires.indexOf('{@link ol.ObjectEvent} ol.event:ObjectEvent') === -1) {
doclet.fires.push('{@link ol.ObjectEvent} ol.event:ObjectEvent');
}
}
}
});

View File

@@ -211,7 +211,7 @@ dt.tag-source, dd.tag-source {
.description {
margin-bottom: 1em;
margin-left: -16px;
margin-left: 0px;
margin-top: 1em;
}

View File

@@ -27,8 +27,7 @@
<?js if (doc.kind === 'module' && doc.module) { ?>
<?js= self.partial('method.tmpl', doc.module) ?>
<?js } ?>
<?js if (doc.kind === 'class') { ?>
<?js if (!doc.unexported && doc.kind === 'class') { ?>
<?js= self.partial('method.tmpl', doc) ?>
<?js } else { ?>
<?js if (doc.description) { ?>
@@ -101,6 +100,18 @@
<?js } ?>
<?js
var events = doc.events;
if (events && events.length && events.forEach) {
?>
<h3 class="subsection-title">Events</h3>
<?js if (observables && observables.length) { ?>
<p>These events are available in addition to the <b>Observable Properties</b> events listed above.</p>
<?js } ?>
<dl><?js= self.partial('events.tmpl', events) ?></dl>
<?js } ?>
<?js
var members = self.find({kind: 'member', memberof: title === 'Globals'? {isUndefined: true} : doc.longname});
if (members && members.length && members.forEach) {

View File

@@ -8,7 +8,7 @@
<th>Name</th>
<th>Type</th>
<th>Settable</th>
<th>Event</th>
<th><a href="ol.ObjectEvent.html">ol.ObjectEvent</a> type</th>
<th class="last">Description</th>
</tr>
</thead>

View File

@@ -8,19 +8,19 @@ def main(argv):
examples = {}
requires = set()
for filename in argv[1:]:
lines = open(filename).readlines()
lines = open(filename, 'rU').readlines()
if len(lines) > 0 and lines[0].startswith('// NOCOMPILE'):
continue
requires.update(line for line in lines if line.startswith('goog.require'))
examples[filename] = [line for line in lines if not line.startswith('goog.require')]
for require in sorted(requires):
print require,
sys.stdout.write(require)
for filename in sorted(examples.keys()):
print '// ', filename
print '(function(){'
sys.stdout.write('// ' + filename + '\n')
sys.stdout.write('(function(){\n')
for line in examples[filename]:
print line,
print '})();'
sys.stdout.write(line)
sys.stdout.write('})();\n')
if __name__ == '__main__':

View File

@@ -113,7 +113,7 @@ def main(argv):
for arg in args:
in_comment = False
object_literal = None
for line in open(arg):
for line in open(arg, 'rU'):
line = line.strip()
if not line:
continue

View File

@@ -5,7 +5,7 @@
* This loader is used for the hosted examples. It is used in place of the
* development loader (examples/loader.js).
*
* ol.css, ol.js, ol-simple.js, ol-whitespace.js, and ol-deps.js are built
* ol.js, ol-simple.js, ol-whitespace.js, and ol-deps.js are built
* by OL3's build.py script. They are located in the ../build/ directory,
* relatively to this script.
*
@@ -66,7 +66,6 @@
}
var scriptId = encodeURIComponent(scriptParams.id);
document.write('<link rel="stylesheet" href="../build/ol.css" type="text/css">');
if (mode != 'raw') {
document.write('<scr' + 'ipt type="text/javascript" src="../build/' + oljs + '"></scr' + 'ipt>');
} else {

View File

@@ -52,7 +52,7 @@ def main(argv):
common, vertex, fragment = [], [], []
attributes, uniforms, varyings = {}, {}, {}
block = None
for line in open(options.input):
for line in open(options.input, 'rU'):
if line.startswith('//!'):
m = re.match(r'//!\s+NAMESPACE=(\S+)\s*\Z', line)
if m:
@@ -111,10 +111,10 @@ def main(argv):
context['getUniforms'] = [uniforms[u] for u in sorted(uniforms.keys())]
if options.output and options.output != '-':
output = open(options.output, 'w')
output = open(options.output, 'wb')
else:
output = sys.stdout
output.write(pystache.render(open(options.template).read(), context))
output.write(pystache.render(open(options.template, 'rb').read(), context))
if __name__ == '__main__':

166
build.py
View File

@@ -4,8 +4,8 @@ from cStringIO import StringIO
import gzip
import json
import os
import os.path
import regex as re
import glob
import re
import shutil
import sys
@@ -14,68 +14,68 @@ from pake import ifind, main, output, rule, target, variables, virtual, which
if sys.platform == 'win32':
""" windows_defaults assumes that jsdoc was installed at a specific place
(C:\jsdoc). It also fixes a certain version (1.9.0) of phantomjs which
might not anymore be proposed on
http://code.google.com/p/phantomjs/downloads/list"""
windows_defaults = {
'ProgramFiles': os.environ.get('ProgramFiles', 'C:\\Program Files'),
'Python27': os.environ.get('SystemDrive', 'C:') + '\\Python27',
'jsdoc': os.environ.get('SystemDrive', 'C:') + '\\jsdoc3',
'phantomjs': (os.environ.get('SystemDrive', 'C:') +
'\\phantomjs-1.9.0-windows')
win = {
'GIT': 'git.exe',
'GJSLINT': 'gjslint.exe',
'JAVA': 'java.exe',
'JAR': 'jar.exe',
'JSDOC': 'jsdoc.cmd',
'JSHINT': './node_modules/.bin/jshint',
'PYTHON': 'python.exe',
'PHANTOMJS': 'phantomjs.cmd'
}
if which('git.exe'):
variables.GIT = 'git.exe'
else:
variables.GIT = os.path.join(windows_defaults['ProgramFiles'],
'Git', 'bin', 'git.exe')
sys_dir = os.environ.get('SYSTEMDRIVE')
program_files = os.environ.get('PROGRAMFILES')
java_home = os.environ.get('JAVA_HOME')
if which('gjslint.exe'):
variables.GJSLINT = 'gjslint.exe'
else:
variables.GJSLINT = os.path.join(windows_defaults['Python27'],
'Scripts', 'gjslint.exe')
if not java_home:
# Following lines choose sensible defaults to guess JAVA_HOME in
# 32/64bit Program Files folder opting for the most current version.
search_term = os.path.join(sys_dir, os.sep, 'Program Files*', 'Java', 'jdk*')
found_jdks = sorted(glob.glob(search_term), key=lambda x: x[-8:])
if found_jdks:
java_home = found_jdks[-1]
if which('java.exe'):
variables.JAVA = 'java.exe'
else:
variables.JAVA = os.path.join(windows_defaults['ProgramFiles'],
'Java', 'jre7', 'bin', 'java.exe')
if java_home:
if not which(win['JAVA']):
win['JAVA'] = os.path.join(java_home, 'bin', 'java.exe')
if not which(win['JAR']):
win['JAR'] = os.path.join(java_home, 'bin', 'jar.exe')
elif not which(win['JAVA']):
win['JAVA'] = os.path.join(program_files,
'Java', 'jre7', 'bin', 'java.exe')
if which('jar.exe'):
variables.JAR = 'jar.exe'
else:
variables.JAR = os.path.join(windows_defaults['ProgramFiles'],
'Java', 'jdk1.7.0_17', 'bin', 'jar.exe')
if not which(win['GIT']):
win['GIT'] = os.path.join(program_files, 'Git', 'cmd', 'git.exe')
if not which(win['GIT']):
win['GIT'] = os.path.join(program_files, 'Git', 'bin', 'git.exe')
if which('jsdoc.cmd'):
variables.JSDOC = 'jsdoc.cmd'
else:
variables.JSDOC = os.path.join(windows_defaults['jsdoc'],
'jsdoc.cmd')
if not which(win['PYTHON']):
win['PYTHON'] = os.path.join(sys_dir, 'Python27', 'python.exe')
if which('python.exe'):
variables.PYTHON = 'python.exe'
else:
variables.PYTHON = os.path.join(windows_defaults['Python27'],
'python.exe')
if not which(win['GJSLINT']):
win['GJSLINT'] = os.path.join(sys_dir, 'Python27', 'Scripts', 'gjslint.exe')
if which('phantomjs.exe'):
variables.PHANTOMJS = 'phantomjs.exe'
else:
variables.PHANTOMJS = os.path.join(windows_defaults['phantomjs'],
'phantomjs.exe')
if not which(win['PHANTOMJS']):
win['PHANTOMJS'] = 'phantomjs.exe'
if not which(win['PHANTOMJS']):
win['PHANTOMJS'] = os.path.join(sys_dir, 'phantomjs-1.9.7-windows', 'phantomjs.exe')
if not which(win['JSDOC']):
win['JSDOC'] = os.path.join(program_files, 'jsdoc3', 'jsdoc.cmd')
for program, path in win.iteritems():
setattr(variables, program, path)
else:
variables.GIT = 'git'
variables.GJSLINT = 'gjslint'
variables.JSHINT = './node_modules/.bin/jshint'
variables.JAVA = 'java'
variables.JAR = 'jar'
variables.JSDOC = 'jsdoc'
variables.NODE = 'node'
variables.PYTHON = 'python'
variables.PHANTOMJS = 'phantomjs'
@@ -83,7 +83,8 @@ variables.BRANCH = output(
'%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()
EXECUTABLES = [variables.GIT, variables.GJSLINT, variables.JAVA, variables.JAR,
variables.JSDOC, variables.PYTHON, variables.PHANTOMJS]
variables.JSDOC, variables.JSHINT, variables.PYTHON,
variables.PHANTOMJS]
EXPORTS = [path
for path in ifind('src')
@@ -103,7 +104,6 @@ EXAMPLES_SRC = [path
if path.endswith('.js')
if not path.endswith('.combined.js')
if not path.startswith('examples/bootstrap')
if not path.startswith('examples/font-awesome')
if path != 'examples/Jugl.js'
if path != 'examples/jquery.min.js'
if path != 'examples/loader.js'
@@ -154,7 +154,7 @@ PROJ4JS_ZIP_MD5 = '17caad64cf6ebc6e6fe62f292b134897'
def report_sizes(t):
stringio = StringIO()
gzipfile = gzip.GzipFile(t.name, 'w', 9, stringio)
with open(t.name) as f:
with open(t.name, 'rb') as f:
shutil.copyfileobj(f, gzipfile)
gzipfile.close()
rawsize = os.stat(t.name).st_size
@@ -167,7 +167,7 @@ def report_sizes(t):
virtual('default', 'build')
virtual('integration-test', 'lint', 'build', 'build-all',
virtual('integration-test', 'lint', 'jshint', 'build', 'build-all',
'test', 'build/examples/all.combined.js', 'check-examples', 'apidoc')
@@ -175,7 +175,7 @@ virtual('build', 'build/ol.css', 'build/ol.js',
'build/ol-simple.js', 'build/ol-whitespace.js')
virtual('check', 'lint', 'build/ol-all.js', 'test')
virtual('check', 'lint', 'jshint', 'build/ol-all.js', 'test')
virtual('todo', 'fixme')
@@ -252,11 +252,11 @@ for glsl_src in GLSL_SRC:
def _build_require_list(dependencies, output_file_name):
requires = set()
for dependency in dependencies:
for line in open(dependency):
for line in open(dependency, 'rU'):
match = re.match(r'goog\.provide\(\'(.*)\'\);', line)
if match:
requires.add(match.group(1))
with open(output_file_name, 'w') as f:
with open(output_file_name, 'wb') as f:
for require in sorted(requires):
f.write('goog.require(\'%s\');\n' % (require,))
@@ -307,7 +307,7 @@ def build_examples_all_combined_js(t):
@target('build/examples/all.js', EXAMPLES_SRC)
def build_examples_all_js(t):
t.output('bin/combine-examples.py', t.dependencies)
t.output('%(PYTHON)s', 'bin/combine-examples.py', t.dependencies)
@rule(r'\Abuild/examples/(?P<id>.*).json\Z')
@@ -321,19 +321,20 @@ def examples_star_json(name, match):
'../build/src/internal/src/types.js',
],
'externs': [
'//json.js',
'//jquery-1.7.js',
'../externs/bingmaps.js',
'../externs/bootstrap.js',
'../externs/closure-compiler.js',
'../externs/example.js',
'../externs/geojson.js',
'../externs/topojson.js',
'../externs/oli.js',
'../externs/proj4js.js',
'../externs/tilejson.js',
'../externs/closure-compiler.js',
'../externs/topojson.js',
'../externs/vbarray.js',
],
})
with open(t.name, 'w') as f:
with open(t.name, 'wb') as f:
f.write(content)
dependencies = [__file__, 'buildcfg/base.json']
return Target(name, action=action, dependencies=dependencies)
@@ -374,7 +375,7 @@ virtual('lint', 'build/lint-timestamp', 'build/lint-generated-timestamp',
def build_lint_src_timestamp(t):
t.run('%(GJSLINT)s',
'--jslint_error=all',
'--custom_jsdoc_tags=todo',
'--custom_jsdoc_tags=event,fires,todo,function',
'--strict',
t.newer(t.dependencies))
t.touch()
@@ -410,6 +411,15 @@ def build_lint_libtess_js_timestamp(t):
t.touch()
virtual('jshint', 'build/jshint-timestamp')
@target('build/jshint-timestamp', SRC, EXAMPLES_SRC, SPEC, precious=True)
def build_jshint_timestamp(t):
t.run(variables.JSHINT, '--verbose', t.newer(t.dependencies))
t.touch()
def _strip_comments(lines):
# FIXME this is a horribe hack, we should use a proper JavaScript parser
# here
@@ -448,7 +458,7 @@ def build_check_requires_timestamp(t):
# the generated regular expression to exceed Python's limits
if zi.filename.startswith('closure/goog/i18n/'):
continue
for line in zf.open(zi):
for line in zf.open(zi, 'rU'):
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
if m:
all_provides.add(m.group(1))
@@ -457,7 +467,7 @@ def build_check_requires_timestamp(t):
continue
require_linenos = {}
uses = set()
lines = open(filename).readlines()
lines = open(filename, 'rU').readlines()
for lineno, line in _strip_comments(lines):
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
if m:
@@ -540,7 +550,7 @@ def build_check_requires_timestamp(t):
requires = set()
uses = set()
uses_linenos = {}
for lineno, line in _strip_comments(open(filename)):
for lineno, line in _strip_comments(open(filename, 'rU')):
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
if m:
provides.add(m.group(1))
@@ -583,13 +593,17 @@ def build_check_requires_timestamp(t):
precious=True)
def build_check_whitespace_timestamp(t):
CR_RE = re.compile(r'\r')
LEADING_WHITESPACE_RE = re.compile(r'\s+')
TRAILING_WHITESPACE_RE = re.compile(r'\s+\n\Z')
NO_NEWLINE_RE = re.compile(r'[^\n]\Z')
ALL_WHITESPACE_RE = re.compile(r'\s+\Z')
errors = 0
for filename in sorted(t.newer(t.dependencies)):
whitespace = False
for lineno, line in enumerate(open(filename)):
for lineno, line in enumerate(open(filename, 'rU')):
if lineno == 0 and LEADING_WHITESPACE_RE.match(line):
t.info('%s:%d: leading whitespace', filename, lineno + 1)
errors += 1
if CR_RE.search(line):
t.info('%s:%d: carriage return character in line', filename, lineno + 1)
errors += 1
@@ -623,16 +637,16 @@ virtual('apidoc', 'build/jsdoc-%(BRANCH)s-timestamp' % vars(variables))
@target('build/jsdoc-%(BRANCH)s-timestamp' % vars(variables), 'host-resources',
'build/src/external/src/exports.js', 'build/src/external/src/types.js',
SRC, SHADER_SRC, ifind('apidoc/template'))
'build/src/external/src/exports.js', SRC, SHADER_SRC,
ifind('apidoc/template'))
def jsdoc_BRANCH_timestamp(t):
t.run('%(JSDOC)s', '-c', 'apidoc/conf.json', 'src', 'apidoc/index.md',
t.run('%(JSDOC)s', 'apidoc/index.md', '-c', 'apidoc/conf.json',
'-d', 'build/hosted/%(BRANCH)s/apidoc')
t.touch()
def split_example_file(example, dst_dir):
lines = open(example).readlines()
lines = open(example, 'rU').readlines()
target_lines = []
target_require_lines = []
@@ -650,11 +664,11 @@ def split_example_file(example, dst_dir):
target_lines.append(line)
target = open(
os.path.join(dst_dir, os.path.basename(example)), 'w')
os.path.join(dst_dir, os.path.basename(example)), 'wb')
target_require = open(
os.path.join(dst_dir, os.path.basename(example)
.replace('.js', '-require.js')),
'w')
'wb')
target.writelines(target_lines)
target.close()
@@ -674,17 +688,21 @@ def host_resources(t):
def host_examples(t):
examples_dir = 'build/hosted/%(BRANCH)s/examples'
build_dir = 'build/hosted/%(BRANCH)s/build'
css_dir = 'build/hosted/%(BRANCH)s/css'
t.rm_rf(examples_dir)
t.makedirs(examples_dir)
t.rm_rf(build_dir)
t.makedirs(build_dir)
t.rm_rf(css_dir)
t.makedirs(css_dir)
t.cp(EXAMPLES, examples_dir)
for example in [path.replace('.html', '.js') for path in EXAMPLES]:
split_example_file(example, examples_dir % vars(variables))
t.cp_r('examples/data', examples_dir + '/data')
t.cp('bin/loader_hosted_examples.js', examples_dir + '/loader.js')
t.cp('build/ol.js', 'build/ol-simple.js', 'build/ol-whitespace.js',
'build/ol.css', build_dir)
build_dir)
t.cp('build/ol.css', css_dir)
t.cp('examples/index.html', 'examples/example-list.js',
'examples/example-list.xml', 'examples/Jugl.js',
'examples/jquery.min.js', examples_dir)
@@ -708,7 +726,7 @@ def host_examples(t):
def check_examples(t):
examples = ['build/hosted/%(BRANCH)s/' + e
for e in EXAMPLES
if not open(e.replace('.html', '.js')).readline().startswith('// NOCOMPILE')]
if not open(e.replace('.html', '.js'), 'rU').readline().startswith('// NOCOMPILE')]
all_examples = \
[e + '?mode=advanced' for e in examples]
for example in all_examples:
@@ -820,7 +838,7 @@ Other less frequently used targets are:
installed on your machine.
fixme - Will print a list of parts of the code that are marked
with either TODO or FIXME.
todo - is an alias for the fixme-target
todo - This is an alias for the fixme-target (see above).
plovr - Fetches the required plovr.jar. Usually called by other
targets that depend on plovr.

View File

@@ -47,14 +47,14 @@
"disambiguate-properties": true,
"externs": [
"//json.js",
"../externs/bingmaps.js",
"../externs/closure-compiler.js",
"../externs/geojson.js",
"../externs/oli.js",
"../externs/proj4js.js",
"../externs/tilejson.js",
"../externs/topojson.js"
"../externs/topojson.js",
"../externs/vbarray.js"
],
"level": "VERBOSE",

View File

@@ -1,15 +1,16 @@
{
"externs": [
"//json.js",
"//jquery-1.7.js",
"../externs/bingmaps.js",
"../externs/bootstrap.js",
"../externs/closure-compiler.js",
"../externs/example.js",
"../externs/geojson.js",
"../externs/oli.js",
"../externs/proj4js.js",
"../externs/tilejson.js",
"../externs/topojson.js"
"../externs/topojson.js",
"../externs/vbarray.js"
],
"id": "simple",
"inherits": "base.json",

View File

@@ -3,7 +3,6 @@
"id": "ol-all",
"externs": [
"//json.js",
"../build/src/external/externs/types.js",
"../externs/bingmaps.js",
"../externs/closure-compiler.js",
@@ -11,7 +10,8 @@
"../externs/oli.js",
"../externs/proj4js.js",
"../externs/tilejson.js",
"../externs/topojson.js"
"../externs/topojson.js",
"../externs/vbarray.js"
],
"inherits": "base.json",

View File

@@ -13,7 +13,6 @@
"id": "ol-simple",
"externs": [
"//json.js",
"../build/src/external/externs/types.js",
"../externs/bingmaps.js",
"../externs/closure-compiler.js",
@@ -21,7 +20,8 @@
"../externs/oli.js",
"../externs/proj4js.js",
"../externs/tilejson.js",
"../externs/topojson.js"
"../externs/topojson.js",
"../externs/vbarray.js"
],
"inherits": "ol.json",

View File

@@ -14,14 +14,14 @@
"disambiguate-properties": false,
"externs": [
"//json.js",
"../externs/bingmaps.js",
"../externs/closure-compiler.js",
"../externs/geojson.js",
"../externs/oli.js",
"../externs/proj4js.js",
"../externs/tilejson.js",
"../externs/topojson.js"
"../externs/topojson.js",
"../externs/vbarray.js"
],
"inherits": "ol.json",

View File

@@ -13,7 +13,6 @@
"css-output-file": "../build/ol.css",
"externs": [
"//json.js",
"../build/src/external/externs/types.js",
"../externs/bingmaps.js",
"../externs/closure-compiler.js",
@@ -21,7 +20,8 @@
"../externs/oli.js",
"../externs/proj4js.js",
"../externs/tilejson.js",
"../externs/topojson.js"
"../externs/topojson.js",
"../externs/vbarray.js"
],
"inherits": "base.json",

View File

@@ -3,28 +3,15 @@
text-align: right;
bottom: 0;
right: 0;
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
padding: 6px;
color: #000000;
color: rgba(238,238,238,1);
background: rgba(0,60,136,0.3);
}
.ol-attribution a {
text-decoration: none;
}
/* rgba is not supported on IE <= 8, fall back to black text so that it's readable */
.ol-attribution {
color: #000000;
}
.ol-attribution:not([ie8andbelow]) {
color: #eeeeee;
background: rgba(0,60,136,0.3);
}
/* white links are unreadable on IE <= 8 with no background, fall back to blue links */
.ol-attribution a {
color: #7b98bc;
}
.ol-attribution a:not([ie8andbelow]) {
color: white;
color: rgba(255,255,255,1);
}
.ol-attribution ul {
@@ -46,65 +33,7 @@
padding-top: 2px;
white-space: nowrap;
}
.ol-full-screen {
/* IE <= 8 doesn't support rgba, fall back to a light grey */
background: #eee;
border-radius: 4px;
padding: 2px;
position: absolute;
right: 8px;
top: 8px;
}
.ol-full-screen:not([ie8andbelow]) {
/* IE <= 8 doesn't support rgba, fall back to a light grey */
background: rgba(255,255,255,0.4);
}
@media print {
.ol-full-screen {
display: none;
}
}
.ol-full-screen a {
/* IE <= 8 doesn't support rgba, fall back to a light blue */
background: #7b98bc;
color: white;
display: block;
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
font-size: 18px;
font-weight: bold;
height: 22px;
line-height: 19px;
margin: 1px;
padding: 0;
text-align: center;
text-decoration: none;
width: 22px;
}
.ol-full-screen a:not([ie8andbelow]) {
/* IE <= 8 doesn't support rgba, fall back to a light blue */
background: rgba(0,60,136,0.5);
}
a.ol-full-screen-false:after {
content: "\2194";
}
a.ol-full-screen-true:after {
content: "\00d7";
}
.ol-full-screen div {
border-radius: 2px;
}
.ol-full-screen div a {
border-radius: 2px;
}
.ol-full-screen a:hover {
/* IE <= 8 doesn't support rgba, fall back to a light blue */
background: #4c6079;
}
.ol-full-screen a:hover:not([ie8andbelow]) {
/* IE <= 8 doesn't support rgba, fall back to a light blue */
background: rgba(0,60,136,0.7);
}
.ol-logo {
bottom: 0;
left: 0;
@@ -127,24 +56,19 @@ a.ol-full-screen-true:after {
}
.ol-scale-line {
/* IE <= 8 doesn't support rgba, fall back to a light blue */
background: #95b9e6;
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line:not([ie8andbelow]) {
/* IE <= 8 doesn't support rgba, fall back to a light blue */
background: rgba(0,60,136,0.3);
}
.ol-scale-line-inner {
border: 1px solid #eeeeee;
border-top: none;
color: #eeeeee;
font-size: 10px;
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
text-align: center;
margin: 1px;
padding: 0px 2px;
@@ -162,157 +86,200 @@ a.ol-full-screen-true:after {
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-zoom {
.ol-zoom,
.ol-zoom-extent,
.ol-full-screen {
position: absolute;
top: 8px;
left: 8px;
/* IE <= 8 doesn't support rgba, fall back to a light grey */
background-color: #eee;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
/* IE <= 8 doesn't support rgba, fall back to a light grey */
.ol-zoom:not([ie8andbelow]) {
background-color: rgba(255,255,255,0.4);
.ol-zoom:hover,
.ol-zoom-extent:hover,
.ol-full-screen:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
@media print {
.ol-zoom {
.ol-zoom,
.ol-zoom-extent,
.ol-full-screen {
display: none;
}
}
.ol-zoom a {
.ol-zoom button,
.ol-zoom-extent button,
.ol-full-screen button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-size: 18px;
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
font-size: 1.14em;
font-weight: bold;
text-decoration: none;
text-align: center;
height: 22px;
width: 22px;
line-height: 19px;
/* IE <= 8 doesn't support rgba, fall back to a light blue */
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: #7b98bc;
}
.ol-zoom a:not([ie8andbelow]) {
/* IE <= 8 doesn't support rgba, fall back to a light blue */
background-color: rgba(0,60,136,0.5);
border: none;
}
.ol-touch .ol-zoom a {
font-size: 20px;
height: 30px;
width: 30px;
line-height: 26px;
.ol-zoom button::-moz-focus-inner,
.ol-zoom-extent button::-moz-focus-inner,
.ol-full-screen button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom a:hover {
color: #fff;
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-touch .ol-zoom button,
.ol-touch .ol-full-screen button,
.ol-touch .ol-zoom-extent button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-zoom button:hover,
.ol-zoom button:focus,
.ol-zoom-extent button:hover,
.ol-zoom-extent button:focus,
.ol-full-screen button:hover,
.ol-full-screen button:focus {
text-decoration: none;
/* IE <= 8 doesn't support rgba, fall back to a lighter blue */
background-color: #4c6079;
}
.ol-zoom a:hover:not([ie8andbelow]) {
/* IE <= 8 doesn't support rgba, fall back to a lighter blue */
background-color: rgba(0,60,136,0.7);
}
.ol-zoom-extent button:after {
content: "E";
}
.ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom-out {
border-radius: 0 0 2px 2px;
}
button.ol-full-screen-false:after {
content: "\2194";
}
button.ol-full-screen-true:after {
content: "\00d7";
}
/* invisible but not hidden */
.ol-has-tooltip [role=tooltip] {
position: absolute;
clip: rect(1px 1px 1px 1px); /* < IE8 */
clip: rect(1px, 1px, 1px, 1px);
padding: 0;
border: 0;
height: 1px;
width: 1px;
overflow: hidden;
font-weight: normal;
font-size: 14px;
text-shadow: 0 0 2px #fff;
}
/* show a tooltip offset to below and right */
.ol-has-tooltip:hover [role=tooltip], .ol-has-tooltip:focus [role=tooltip] {
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
clip: auto;
padding: 0 .4em;
font-size: .8em;
height: 1.2em;
width: auto;
line-height: 1.2em;
z-index: 1100;
max-height: 100px;
white-space: nowrap;
display: inline-block;
background: #FFF;
background: rgba(255,255,255,0.6);
color: #000;
border: 3px solid rgba(255,255,255,0);
border-left-width: 0;
border-radius: 0 4px 4px 0;
bottom: .3em;
left: 2.2em;
}
.ol-touch .ol-has-tooltip:hover [role=tooltip],
.ol-touch .ol-has-tooltip:focus [role=tooltip] {
display: none;
}
.ol-zoom .ol-has-tooltip:hover [role=tooltip],
.ol-zoom .ol-has-tooltip:focus [role=tooltip] {
top: 1.1em;
}
.ol-full-screen .ol-has-tooltip:hover [role=tooltip],
.ol-full-screen .ol-has-tooltip:focus [role=tooltip] {
right: 2.2em;
left: auto;
border-radius: 4px 0 0 4px;
}
.ol-zoomslider {
position: absolute;
top: 67px;
left: 8px;
/* IE <= 8 doesn't support rgba, fall back to a light grey */
top: 4.5em;
left: .5em;
background: #eee;
background: rgba(255, 255, 255, 0.4);
border-radius: 4px;
width: 28px;
height: 200px;
outline: none;
overflow: hidden;
padding: 0;
width: 1.5675em;
height: 200px;
padding: 3px;
margin: 0;
}
.ol-zoomslider:not([ie8andbelow]) {
/* IE <= 8 doesn't support rgba, fall back to a light grey */
background: rgba(255, 255, 255, 0.4);
}
.ol-zoomslider-thumb {
position: absolute;
display: block;
padding: 0;
margin: 2px;
/* IE <= 8 doesn't support rgba, fall back to a lighter blue */
background: #7b98bc;
background: rgba(0,60,136,0.5);
border-radius: 2px;
outline: none;
overflow: hidden;
height: 20px;
width: 24px;
}
.ol-zoomslider-thumb:not([ie8andbelow]) {
/* IE <= 8 doesn't support rgba, fall back to a lighter blue */
background: rgba(0,60,136,0.5);
}
.ol-zoom-extent {
position: absolute;
/* IE <= 8 doesn't support rgba, fall back to a light grey */
background: #eee;
border-radius: 4px;
left: 8px;
padding: 2px;
top: 65px;
}
.ol-zoom-extent:not([ie8andbelow]) {
/* IE <= 8 doesn't support rgba, fall back to a light grey */
background: rgba(255,255,255,0.4);
}
@media print {
.ol-zoom-extent {
display: none;
}
}
.ol-zoom-extent a {
display: block;
margin: 1px;
cursor: pointer;
font-size: 1.14em;
height: 1em;
width: 1.375em;
margin: 3px;
padding: 0;
color: white;
font-size: 16px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
width: 2.052em;
}
.ol-touch .ol-zoomslider-thumb {
width: 1.8em;
}
.ol-zoom-extent button,
.ol-attribution,
.ol-full-screen button,
.ol-scale-line-inner,
.ol-zoom button,
.ol-has-tooltip [role=tooltip] {
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
font-weight: bold;
text-decoration: none;
text-align: center;
height: 22px;
width: 22px;
/* IE <= 8 doesn't support rgba, fall back to a lighter blue */
background-color: #7b98bc;
border-radius: 2px;
}
.ol-zoom-extent a:not([ie8andbelow]) {
/* IE <= 8 doesn't support rgba, fall back to a lighter blue */
background-color: rgba(0, 60, 136, 0.5);
}
.ol-touch .ol-zoom-extent a {
font-size: 20px;
height: 30px;
width: 30px;
line-height: 26px;
}
.ol-zoom-extent a:hover {
/* IE <= 8 doesn't support rgba, fall back to a lighter blue */
background-color: #4c6079;
}
.ol-zoom-extent a:hover:not([ie8andbelow]) {
/* IE <= 8 doesn't support rgba, fall back to a lighter blue */
background-color: rgba(0, 60, 136, 0.7);
}
.ol-zoom-extent a:after {
content: "E";
}

View File

@@ -5,6 +5,10 @@ layout: doc.hbs
# Quick Start
## Workshop
Make sure to also check out the [OpenLayers 3 workshop](http://ol3js.org/ol3-workshop/).
## Put a map on a page
Below you'll find a complete working example. Create a new file, copy in the contents below, and open in a browser:
@@ -13,7 +17,7 @@ Below you'll find a complete working example. Create a new file, copy in the co
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="http://ol3js.org/en/{{ latest }}/build/ol.css" type="text/css">
<link rel="stylesheet" href="http://ol3js.org/en/{{ latest }}/css/ol.css" type="text/css">
<style>
.map {
height: 400px;
@@ -72,7 +76,8 @@ The map in the application is contained in a [`<div>` HTML element](http://en.wi
```xml
<style>
.map {
height: 400px; width: 100%;
height: 400px;
width: 100%;
}
</style>
```

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -53,8 +54,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=accessible" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=accessible" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,5 +1,4 @@
goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
@@ -11,7 +10,7 @@ var map = new ol.Map({
source: new ol.source.OSM()
})
],
renderer: ol.RendererHints.createFromQueryData(),
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: new ol.View2D({
center: [0, 0],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -56,8 +57,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=animation" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=animation" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,5 +1,4 @@
goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.animation');
goog.require('ol.easing');
@@ -28,7 +27,7 @@ var map = new ol.Map({
source: new ol.source.OSM()
})
],
renderer: ol.RendererHints.createFromQueryData(),
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: view
});

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -81,8 +82,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=bind-input" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=bind-input" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,6 +1,5 @@
goog.require('ol.BrowserFeature');
goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.dom.Input');
goog.require('ol.layer.Tile');
@@ -30,7 +29,7 @@ var view = new ol.View2D({
var map = new ol.Map({
layers: [layer],
renderer: ol.RendererHints.createFromQueryData(),
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: view
});

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -51,8 +52,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=bing-maps" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=bing-maps" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,5 +1,4 @@
goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.layer.Tile');
goog.require('ol.source.BingMaps');
@@ -26,7 +25,7 @@ for (i = 0, ii = styles.length; i < ii; ++i) {
}
var map = new ol.Map({
layers: layers,
renderer: ol.RendererHints.createFromQueryData(),
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: new ol.View2D({
center: [-6655.5402445057125, 6709968.258934638],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -66,8 +67,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=brightness-contrast" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=brightness-contrast" type="text/javascript"></script>
</body>
</html>

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -44,8 +45,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=canvas-tiles" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=canvas-tiles" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,5 +1,4 @@
goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
@@ -22,7 +21,7 @@ var map = new ol.Map({
})
})
],
renderer: ol.RendererHints.createFromQueryData(),
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: new ol.View2D({
center: ol.proj.transform(

135
examples/center.html Normal file
View File

@@ -0,0 +1,135 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<style>
.mapcontainer {
position: relative;
margin-bottom: 20px;
}
.map {
width: 1000px;
height: 600px;
}
div.ol-zoom {
top: 178px;
left: 158px;
}
div.ol-logo {
left: 150px;
bottom: 30px;
}
div.ol-attribution {
bottom: 30px;
right: 50px;
}
.padding-top {
position: absolute;
top: 0;
left: 0px;
width: 1000px;
height: 170px;
background: rgba(255, 255, 255, 0.5);
}
.padding-left {
position: absolute;
top: 170px;
left: 0;
width: 150px;
height: 400px;
background: rgba(255, 255, 255, 0.5);
}
.padding-right {
position: absolute;
top: 170px;
left: 950px;
width: 50px;
height: 400px;
background: rgba(255, 255, 255, 0.5);
}
.padding-bottom {
position: absolute;
top: 570px;
left: 0px;
width: 1000px;
height: 30px;
background: rgba(255, 255, 255, 0.5);
}
.center {
position: absolute;
border: solid 1px black;
top: 490px;
left: 560px;
width: 20px;
height: 20px;
}
</style>
<title>Advanced View Positioning example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png">OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12 mapcontainer">
<div id="map" class="map"></div>
<div class="padding-top"></div>
<div class="padding-left"></div>
<div class="padding-right"></div>
<div class="padding-bottom"></div>
<div class="center"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<button id="zoomtoswitzerlandbest">Zoom to Switzerland</button> (best fit),<br/>
<button id="zoomtoswitzerlandconstrained">Zoom to Switzerland</button> (respect resolution constraint).<br/>
<button id="zoomtoswitzerlandnearest">Zoom to Switzerland</button> (nearest),<br/>
<button id="zoomtolausanne">Zoom to Lausanne</button> (with min resolution),<br/>
<button id="centerlausanne">Center on Lausanne</button>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Advanced View Positioning example</h4>
<p id="shortdesc">This example demonstrates how a map's view can be
adjusted so a geometry or coordinate is positioned at a specific
pixel location. The map above has top, right, bottom, and left
padding applied inside the viewport. The view's <code>fitGeometry</code> method
is used to fit a geometry in the view with the same padding. The
view's <code>centerOn</code> method is used to position a coordinate (Lausanne)
at a specific pixel location (the center of the black box).</p>
<div id="docs">
<p>Use <code>Alt</code>+<code>Shift</code>+drag to rotate the map.</p>
<p>See the <a href="center.js" target="_blank">center.js source</a> to see how this is done.</p>
</div>
<div id="tags">center, rotation, openstreetmap</div>
</div>
</div>
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=center" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
</body>
</html>

127
examples/center.js Normal file
View File

@@ -0,0 +1,127 @@
goog.require('ol.Map');
goog.require('ol.View2D');
goog.require('ol.geom.Point');
goog.require('ol.geom.SimpleGeometry');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.GeoJSON');
goog.require('ol.source.OSM');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var source = new ol.source.GeoJSON({
projection: 'EPSG:3857',
url: 'data/geojson/switzerland.geojson'
});
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.6)'
}),
stroke: new ol.style.Stroke({
color: '#319FD3',
width: 1
}),
image: new ol.style.Circle({
radius: 5,
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.6)'
}),
stroke: new ol.style.Stroke({
color: '#319FD3',
width: 1
})
})
});
var vectorLayer = new ol.layer.Vector({
source: source,
style: style
});
var view = new ol.View2D({
center: [0, 0],
zoom: 1
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
vectorLayer
],
target: 'map',
view: view
});
var zoomtoswitzerlandbest = document.getElementById('zoomtoswitzerlandbest');
zoomtoswitzerlandbest.addEventListener('click', function() {
var feature = source.getFeatures()[0];
var polygon = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry());
var size = /** @type {ol.Size} */ (map.getSize());
view.fitGeometry(
polygon,
size,
{
padding: [170, 50, 30, 150],
constrainResolution: false
}
);
}, false);
var zoomtoswitzerlandconstrained =
document.getElementById('zoomtoswitzerlandconstrained');
zoomtoswitzerlandconstrained.addEventListener('click', function() {
var feature = source.getFeatures()[0];
var polygon = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry());
var size = /** @type {ol.Size} */ (map.getSize());
view.fitGeometry(
polygon,
size,
{
padding: [170, 50, 30, 150]
}
);
}, false);
var zoomtoswitzerlandnearest =
document.getElementById('zoomtoswitzerlandnearest');
zoomtoswitzerlandnearest.addEventListener('click', function() {
var feature = source.getFeatures()[0];
var polygon = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry());
var size = /** @type {ol.Size} */ (map.getSize());
view.fitGeometry(
polygon,
size,
{
padding: [170, 50, 30, 150],
nearest: true
}
);
}, false);
var zoomtolausanne = document.getElementById('zoomtolausanne');
zoomtolausanne.addEventListener('click', function() {
var feature = source.getFeatures()[1];
var point = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry());
var size = /** @type {ol.Size} */ (map.getSize());
view.fitGeometry(
point,
size,
{
padding: [170, 50, 30, 150],
minResolution: 50
}
);
}, false);
var centerlausanne = document.getElementById('centerlausanne');
centerlausanne.addEventListener('click', function() {
var feature = source.getFeatures()[1];
var point = /** @type {ol.geom.Point} */ (feature.getGeometry());
var size = /** @type {ol.Size} */ (map.getSize());
view.centerOn(
point.getCoordinates(),
size,
[570, 500]
);
}, false);

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -82,8 +83,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=custom-controls" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=custom-controls" type="text/javascript"></script>
</body>

View File

@@ -1,6 +1,5 @@
goog.require('ol');
goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.control');
goog.require('ol.control.Control');
@@ -71,7 +70,7 @@ var map = new ol.Map({
source: new ol.source.OSM()
})
],
renderer: ol.RendererHints.createFromQueryData(),
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: new ol.View2D({
center: [0, 0],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -46,8 +47,8 @@
<script src="jquery.min.js" type="text/javascript"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script src="loader.js?id=d3" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=d3" type="text/javascript"></script>
</body>
</html>

1
examples/d3.js vendored
View File

@@ -19,7 +19,6 @@ var map = new ol.Map({
})
})
],
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: ol.proj.transform([-97, 38], 'EPSG:4326', 'EPSG:3857'),

View File

@@ -0,0 +1,16 @@
{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "name": "Roussel" }, "geometry": { "type": "LineString", "coordinates": [ [ -74.317812426119204, 48.287712285170407 ], [ -73.965445435101188, 48.287712285170407 ] ] } },
{ "type": "Feature", "properties": { "name": "de la Grande-Décharge Sud" }, "geometry": { "type": "LineString", "coordinates": [ [ -72.890274359943689, 47.66777849648031 ], [ -73.03935270229745, 47.552045722357249 ], [ -73.03483517677158, 47.743778832463107 ], [ -72.750231068641639, 47.749854072477497 ], [ -72.754748594167509, 47.552045722357249 ] ] } },
{ "type": "Feature", "properties": { "name": "du Saguenay Ouest" }, "geometry": { "type": "LineString", "coordinates": [ [ -73.007730023616347, 48.07082744644633 ], [ -72.894791885469544, 47.889388912080449 ], [ -72.727643441012276, 48.082900678850329 ], [ -72.560494996555022, 47.895447137861773 ] ] } },
{ "type": "Feature", "properties": { "name": "Saint-Anicet" }, "geometry": { "type": "LineString", "coordinates": [ [ -72.985142395986983, 48.338787334581873 ], [ -72.980624870461128, 48.161307640513321 ], [ -72.885756834417805, 48.164320903012829 ], [ -72.894791885469544, 48.338787334581873 ] ] } },
{ "type": "Feature", "properties": { "name": "Saint-Remy-en-Bouzemont-Saint-Genest-et-Isson" }, "geometry": { "type": "LineString", "coordinates": [ [ -73.459482576203527, 47.53679865861892 ], [ -73.454965050677686, 47.719470781160837 ] ] } },
{ "type": "Feature", "properties": { "name": "Sainte-Geneviève" }, "geometry": { "type": "LineString", "coordinates": [ [ -73.716981531178234, 47.889388912080449 ], [ -73.423342371996569, 48.091953743979651 ], [ -73.242641350961676, 47.883329977544491 ], [ -73.685358852497131, 47.862118125007399 ] ] } },
{ "type": "Feature", "properties": { "name": "de Lombard" }, "geometry": { "type": "LineString", "coordinates": [ [ -73.631148546186679, 48.323770568268507 ], [ -73.626631020660795, 48.185408784389622 ], [ -73.55435061224685, 48.188420630879783 ], [ -73.55435061224685, 48.320766684325278 ], [ -73.473035152781165, 48.317762623483489 ], [ -73.482070203832905, 48.19745510840756 ], [ -73.400754744367205, 48.206487993065075 ], [ -73.396237218841335, 48.323770568268507 ], [ -73.301369182798027, 48.317762623483489 ], [ -73.319439284901506, 48.191432300378096 ] ] } },
{ "type": "Feature", "properties": { "name": "de la Grande-Baie Sud" }, "geometry": { "type": "LineString", "coordinates": [ [ -74.439785615317746, 47.564240180362376 ], [ -74.227461915601779, 47.716431476953346 ], [ -74.055795945618627, 47.552045722357249 ], [ -73.879612450109633, 47.710352336655504 ] ] } },
{ "type": "Feature", "properties": { "name": "de Tadoussac" }, "geometry": { "type": "LineString", "coordinates": [ [ -74.313294900593348, 48.091953743979651 ], [ -74.313294900593348, 47.880300244488787 ], [ -73.974480486152942, 47.877270334238752 ], [ -73.978998011678812, 48.076864416783366 ] ] } }
]
}

View File

@@ -0,0 +1,16 @@
{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "name": "Saguenay (Arrondissement Latterière)" }, "geometry": { "type": "Point", "coordinates": [ -75.849253579389796, 47.6434349837781 ] } },
{ "type": "Feature", "properties": { "name": "Canton Tremblay" }, "geometry": { "type": "Point", "coordinates": [ -75.840218528338056, 47.971115165183342 ] } },
{ "type": "Feature", "properties": { "name": "Saint-Félix-d'Otis" }, "geometry": { "type": "Point", "coordinates": [ -75.849253579389796, 48.278693733790902 ] } },
{ "type": "Feature", "properties": { "name": "La Baie" }, "geometry": { "type": "Point", "coordinates": [ -74.792152606335762, 47.649521925935176 ] } },
{ "type": "Feature", "properties": { "name": "Saint-David-de-Falardeau" }, "geometry": { "type": "Point", "coordinates": [ -74.801187657387501, 47.977163824275436 ] } },
{ "type": "Feature", "properties": { "name": "Saint-Honoré-de-Chicoutimi" }, "geometry": { "type": "Point", "coordinates": [ -74.792152606335762, 48.284706278302295 ] } },
{ "type": "Feature", "properties": { "name": "Alma" }, "geometry": { "type": "Point", "coordinates": [ -75.298115465233423, 47.6434349837781 ] } },
{ "type": "Feature", "properties": { "name": "Jonquière" }, "geometry": { "type": "Point", "coordinates": [ -75.298115465233423, 47.971115165183342 ] } },
{ "type": "Feature", "properties": { "name": "Chicoutimi" }, "geometry": { "type": "Point", "coordinates": [ -75.289080414181669, 48.284706278302295 ] } }
]
}

View File

@@ -0,0 +1,16 @@
{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "name": "Parc de la Colline" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -72.357206347890767, 47.72858763003908 ], [ -71.86027854004486, 47.527648291638172 ], [ -72.37075892446839, 47.539848426151735 ], [ -72.357206347890767, 47.72858763003908 ] ] ] } },
{ "type": "Feature", "properties": { "name": "Centre Paul-Étienne Simard" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -72.357206347890767, 48.013440900213297 ], [ -72.239750684218109, 48.013440900213297 ], [ -72.253303260795718, 47.856056000888501 ], [ -72.027426984502114, 47.856056000888501 ], [ -72.036462035553868, 48.013440900213297 ], [ -71.905453795303586, 48.01646283861713 ], [ -71.891901218725963, 47.801464984333364 ], [ -72.361723873416651, 47.810567474765456 ], [ -72.357206347890767, 48.013440900213297 ] ] ] } },
{ "type": "Feature", "properties": { "name": "Loisirs Rivière du Moulin" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -72.194575428959382, 48.33278115872843 ], [ -72.018391933450374, 48.33278115872843 ], [ -71.846725963467236, 48.251628525276693 ], [ -71.950629050562299, 48.107038644740094 ], [ -72.203610480011122, 48.107038644740094 ], [ -72.397864077623623, 48.221539261269051 ], [ -72.194575428959382, 48.33278115872843 ] ] ] } },
{ "type": "Feature", "properties": { "name": "L'Étoile-du-Nord" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -71.589227008492543, 47.649521925935176 ], [ -71.525981651130337, 47.734664642855655 ], [ -71.48532392139748, 47.649521925935169 ], [ -71.295587849310877, 47.637347332276697 ], [ -71.462736293768117, 47.585573652777313 ], [ -71.390455885354172, 47.475766052599219 ], [ -71.535016702182091, 47.552045722357242 ], [ -71.702165146639345, 47.491030857179695 ], [ -71.616332161647762, 47.591667334264848 ], [ -71.787998131630914, 47.655608158761908 ], [ -71.589227008492543, 47.649521925935176 ] ] ] } },
{ "type": "Feature", "properties": { "name": "Loisirs Lavoie et St-Jean-Baptiste" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -71.729270299794578, 48.010418784700107 ], [ -71.291070323784993, 48.004374022337799 ], [ -71.291070323784993, 47.777183877693901 ], [ -71.729270299794578, 47.786290622064854 ], [ -71.729270299794578, 48.010418784700107 ] ] ] } },
{ "type": "Feature", "properties": { "name": "Loisirs Diamant" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -71.693130095587605, 48.341790157179155 ], [ -71.286552798259123, 48.344792802893032 ], [ -71.449183717190522, 48.224548983994914 ], [ -71.277517747207369, 48.070827446446337 ], [ -71.751857927423927, 48.085918544287573 ], [ -71.507911549026844, 48.21551928490868 ], [ -71.693130095587605, 48.341790157179155 ] ] ] } },
{ "type": "Feature", "properties": { "name": "Sydenham" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -71.051641470913779, 47.710352336655504 ], [ -70.911598179611758, 47.710352336655504 ], [ -70.925150756189367, 47.619080121567436 ], [ -70.712827056473373, 47.616034965734443 ], [ -70.721862107525112, 47.448278226184989 ], [ -70.857387873301292, 47.448278226184989 ], [ -70.852870347775408, 47.552045722357249 ], [ -71.056158996439635, 47.552045722357249 ], [ -71.051641470913779, 47.710352336655504 ] ] ] } },
{ "type": "Feature", "properties": { "name": "Saint-Luc" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -71.110369302750115, 47.798430466372736 ], [ -70.902563128560018, 47.983211774835986 ], [ -70.699274479895777, 47.789325849015306 ], [ -71.110369302750115, 47.798430466372736 ] ] ] } },
{ "type": "Feature", "properties": { "name": "Loisirs du Fjord du Saguenay" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -70.988396113551573, 48.32977780546792 ], [ -70.812212618042579, 48.32977780546792 ], [ -70.807695092516681, 48.209498600656133 ], [ -70.631511597007702, 48.209498600656147 ], [ -70.636029122533571, 48.079882636349602 ], [ -71.146509506957088, 48.082900678850329 ], [ -71.151027032482972, 48.212509031269981 ], [ -70.983878588025689, 48.209498600656133 ], [ -70.988396113551573, 48.32977780546792 ] ] ] } }
]
}

View File

@@ -0,0 +1,4 @@
{"type":"FeatureCollection","features":[
{"type":"Feature","id":"CHE","properties":{"name":"Switzerland"},"geometry":{"type":"Polygon","coordinates":[[[9.594226,47.525058],[9.632932,47.347601],[9.47997,47.10281],[9.932448,46.920728],[10.442701,46.893546],[10.363378,46.483571],[9.922837,46.314899],[9.182882,46.440215],[8.966306,46.036932],[8.489952,46.005151],[8.31663,46.163642],[7.755992,45.82449],[7.273851,45.776948],[6.843593,45.991147],[6.5001,46.429673],[6.022609,46.27299],[6.037389,46.725779],[6.768714,47.287708],[6.736571,47.541801],[7.192202,47.449766],[7.466759,47.620582],[8.317301,47.61358],[8.522612,47.830828],[9.594226,47.525058]]]}},
{"type":"Feature","id":"LSNE","properties":{"name":"Lausanne"},"geometry":{"type":"Point","coordinates":[6.6339863,46.5193823]}}
]}

View File

@@ -0,0 +1,729 @@
{
"data": [{
"coords": {
"speed": 1.7330950498580933,
"accuracy": 5,
"altitudeAccuracy": 8,
"altitude": 238,
"longitude": 5.868668798362713,
"heading": 67.5,
"latitude": 45.64444874417562
},
"timestamp": 1394788264972
}, {
"coords": {
"speed": 1.9535436630249023,
"accuracy": 5,
"altitudeAccuracy": 8,
"altitude": 238,
"longitude": 5.868715401744348,
"heading": 69.609375,
"latitude": 45.64446391542036
},
"timestamp": 1394788266115
}, {
"coords": {
"speed": 2.1882569789886475,
"accuracy": 10,
"altitudeAccuracy": 8,
"altitude": 238,
"longitude": 5.868768962105614,
"heading": 67.5,
"latitude": 45.644484995906836
},
"timestamp": 1394788267107
}, {
"coords": {
"speed": 2.4942498207092285,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 237,
"longitude": 5.868825791409117,
"heading": 68.5546875,
"latitude": 45.64450435810316
},
"timestamp": 1394788267959
}, {
"coords": {
"speed": 2.7581217288970947,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 237,
"longitude": 5.868881698703271,
"heading": 69.609375,
"latitude": 45.64452149909515
},
"timestamp": 1394788268964
}, {
"coords": {
"speed": 3.3746347427368164,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 236,
"longitude": 5.868938528006774,
"heading": 70.3125,
"latitude": 45.644536712249405
},
"timestamp": 1394788270116
}, {
"coords": {
"speed": 3.597411870956421,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 236,
"longitude": 5.868992004549009,
"heading": 74.8828125,
"latitude": 45.644547943999655
},
"timestamp": 1394788271158
}, {
"coords": {
"speed": 3.6382505893707275,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 236,
"longitude": 5.869038775568706,
"heading": 73.828125,
"latitude": 45.64456005584974
},
"timestamp": 1394788271893
}, {
"coords": {
"speed": 3.65671443939209,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 236,
"longitude": 5.869091162463528,
"heading": 73.4765625,
"latitude": 45.644572335337884
},
"timestamp": 1394788272903
}, {
"coords": {
"speed": 3.7153592109680176,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 236,
"longitude": 5.869144219910604,
"heading": 73.125,
"latitude": 45.64458671030182
},
"timestamp": 1394788273914
}, {
"coords": {
"speed": 3.8041043281555176,
"accuracy": 5,
"altitudeAccuracy": 4,
"altitude": 236,
"longitude": 5.869205072527629,
"heading": 72.421875,
"latitude": 45.64460313883204
},
"timestamp": 1394788274901
}, {
"coords": {
"speed": 3.9588162899017334,
"accuracy": 5,
"altitudeAccuracy": 4,
"altitude": 236,
"longitude": 5.869268858810765,
"heading": 72.421875,
"latitude": 45.64461990263838
},
"timestamp": 1394788276140
}, {
"coords": {
"speed": 4.152309417724609,
"accuracy": 5,
"altitudeAccuracy": 4,
"altitude": 235,
"longitude": 5.869351252918941,
"heading": 78.046875,
"latitude": 45.64466122542102
},
"timestamp": 1394788276948
}, {
"coords": {
"speed": 4.49971866607666,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 236,
"longitude": 5.869433479389054,
"heading": 79.8046875,
"latitude": 45.64467040360499
},
"timestamp": 1394788277892
}, {
"coords": {
"speed": 4.824056148529053,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 235,
"longitude": 5.869504055013758,
"heading": 91.40625,
"latitude": 45.64466089014489
},
"timestamp": 1394788279211
}, {
"coords": {
"speed": 5.269814491271973,
"accuracy": 10,
"altitudeAccuracy": 6,
"altitude": 235,
"longitude": 5.869575049733621,
"heading": 91.40625,
"latitude": 45.64465967476893
},
"timestamp": 1394788279898
}, {
"coords": {
"speed": 5.4861016273498535,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 235,
"longitude": 5.86963213049422,
"heading": 95.2734375,
"latitude": 45.64465091568012
},
"timestamp": 1394788280935
}, {
"coords": {
"speed": 5.380503177642822,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 235,
"longitude": 5.869714859878523,
"heading": 75.5859375,
"latitude": 45.64468792178262
},
"timestamp": 1394788281930
}, {
"coords": {
"speed": 5.276519775390625,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 234,
"longitude": 5.869746124377353,
"heading": 55.1953125,
"latitude": 45.64467706721801
},
"timestamp": 1394788282909
}, {
"coords": {
"speed": 5.212399482727051,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 232,
"longitude": 5.8697939850444625,
"heading": 49.5703125,
"latitude": 45.64467899505574
},
"timestamp": 1394788284221
}, {
"coords": {
"speed": 5.174651622772217,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 232,
"longitude": 5.869789123540623,
"heading": 18.984375,
"latitude": 45.64469378911484
},
"timestamp": 1394788284924
}, {
"coords": {
"speed": 5.211904525756836,
"accuracy": 5,
"altitudeAccuracy": 4,
"altitude": 232,
"longitude": 5.869806222623093,
"heading": 10.1953125,
"latitude": 45.64473896757294
},
"timestamp": 1394788286251
}, {
"coords": {
"speed": 5.254780292510986,
"accuracy": 5,
"altitudeAccuracy": 4,
"altitude": 233,
"longitude": 5.86982952431391,
"heading": 18.6328125,
"latitude": 45.64478381075491
},
"timestamp": 1394788286927
}, {
"coords": {
"speed": 5.329030513763428,
"accuracy": 5,
"altitudeAccuracy": 4,
"altitude": 232,
"longitude": 5.869875792419417,
"heading": 33.75,
"latitude": 45.644830078860416
},
"timestamp": 1394788288221
}, {
"coords": {
"speed": 5.384955883026123,
"accuracy": 5,
"altitudeAccuracy": 4,
"altitude": 232,
"longitude": 5.869927508761985,
"heading": 46.7578125,
"latitude": 45.64486025371183
},
"timestamp": 1394788288935
}, {
"coords": {
"speed": 5.309582233428955,
"accuracy": 5,
"altitudeAccuracy": 4,
"altitude": 232,
"longitude": 5.869972854858143,
"heading": 47.109375,
"latitude": 45.644890596201314
},
"timestamp": 1394788290178
}, {
"coords": {
"speed": 5.250724792480469,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 231,
"longitude": 5.870029265066488,
"heading": 46.40625,
"latitude": 45.644932673355235
},
"timestamp": 1394788290890
}, {
"coords": {
"speed": 5.3057990074157715,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 231,
"longitude": 5.870077712466819,
"heading": 39.375,
"latitude": 45.644970224281444
},
"timestamp": 1394788291884
}, {
"coords": {
"speed": 5.431822299957275,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 231,
"longitude": 5.870133116846783,
"heading": 43.59375,
"latitude": 45.6450097449549
},
"timestamp": 1394788292885
}, {
"coords": {
"speed": 5.542125225067139,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 231,
"longitude": 5.870186509569986,
"heading": 43.59375,
"latitude": 45.645047421609654
},
"timestamp": 1394788294100
}, {
"coords": {
"speed": 5.647174835205078,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 231,
"longitude": 5.870246104901535,
"heading": 42.890625,
"latitude": 45.645093647805645
},
"timestamp": 1394788295157
}, {
"coords": {
"speed": 5.735793590545654,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 230,
"longitude": 5.870298156520231,
"heading": 42.5390625,
"latitude": 45.64514368776758
},
"timestamp": 1394788296124
}, {
"coords": {
"speed": 5.809989929199219,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 230,
"longitude": 5.870346436282499,
"heading": 43.59375,
"latitude": 45.64519154843469
},
"timestamp": 1394788296960
}, {
"coords": {
"speed": 5.877871036529541,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 228,
"longitude": 5.87034755932109,
"heading": 42.75193405151367,
"latitude": 45.645270362475216
},
"timestamp": 1394788298177
}, {
"coords": {
"speed": 5.937166690826416,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 228,
"longitude": 5.870402806867787,
"heading": 42.75193405151367,
"latitude": 45.645312142096095
},
"timestamp": 1394788298898
}, {
"coords": {
"speed": 6.071393966674805,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 229,
"longitude": 5.870464520921814,
"heading": 43.183074951171875,
"latitude": 45.64535851937182
},
"timestamp": 1394788299897
}, {
"coords": {
"speed": 6.329115390777588,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 230,
"longitude": 5.8705368384107715,
"heading": 43.183074951171875,
"latitude": 45.645412389093565
},
"timestamp": 1394788300957
}, {
"coords": {
"speed": 6.581554889678955,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 229,
"longitude": 5.870600162706978,
"heading": 43.183074951171875,
"latitude": 45.64545955929912
},
"timestamp": 1394788302211
}, {
"coords": {
"speed": 6.605470180511475,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 230,
"longitude": 5.870657211053185,
"heading": 43.183074951171875,
"latitude": 45.64550205482465
},
"timestamp": 1394788302917
}, {
"coords": {
"speed": 6.623170375823975,
"accuracy": 5,
"altitudeAccuracy": 4,
"altitude": 229,
"longitude": 5.870713613403495,
"heading": 43.183074951171875,
"latitude": 45.64554406917767
},
"timestamp": 1394788303929
}, {
"coords": {
"speed": 6.645580768585205,
"accuracy": 5,
"altitudeAccuracy": 4,
"altitude": 229,
"longitude": 5.870773011629353,
"heading": 43.183074951171875,
"latitude": 45.64558831489415
},
"timestamp": 1394788304902
}, {
"coords": {
"speed": 6.663600444793701,
"accuracy": 5,
"altitudeAccuracy": 4,
"altitude": 229,
"longitude": 5.87083890910435,
"heading": 43.183074951171875,
"latitude": 45.645637401898654
},
"timestamp": 1394788306035
}, {
"coords": {
"speed": 6.664675712585449,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 229,
"longitude": 5.870890033475007,
"heading": 43.183074951171875,
"latitude": 45.64567548463474
},
"timestamp": 1394788307080
}, {
"coords": {
"speed": 6.6489081382751465,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 228,
"longitude": 5.870943189474929,
"heading": 43.183074951171875,
"latitude": 45.645715080460064
},
"timestamp": 1394788308211
}, {
"coords": {
"speed": 6.551820755004883,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 228,
"longitude": 5.871005613698799,
"heading": 43.183074951171875,
"latitude": 45.64576158014743
},
"timestamp": 1394788308904
}, {
"coords": {
"speed": 6.467689514160156,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 229,
"longitude": 5.871058030061249,
"heading": 43.183074951171875,
"latitude": 45.64580062501799
},
"timestamp": 1394788310161
}, {
"coords": {
"speed": 6.3997955322265625,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 229,
"longitude": 5.871062579208228,
"heading": 43.183074951171875,
"latitude": 45.64580401381376
},
"timestamp": 1394788310957
}, {
"coords": {
"speed": 5.799798488616943,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 230,
"longitude": 5.8710817079554545,
"heading": 43.183074951171875,
"latitude": 45.64581826277647
},
"timestamp": 1394788312036
}, {
"coords": {
"speed": 4.424941062927246,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 230,
"longitude": 5.871121835629857,
"heading": 175.4296875,
"latitude": 45.645828271551544
},
"timestamp": 1394788312951
}, {
"coords": {
"speed": 4.3496222496032715,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 231,
"longitude": 5.8710026017471595,
"heading": 176.484375,
"latitude": 45.645752236602775
},
"timestamp": 1394788315227
}, {
"coords": {
"speed": 5.076380252838135,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 232,
"longitude": 5.871189236646398,
"heading": 176.1328125,
"latitude": 45.64553692475487
},
"timestamp": 1394788316970
}, {
"coords": {
"speed": 5.102786064147949,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 231,
"longitude": 5.871200384577616,
"heading": 171.2109375,
"latitude": 45.64548554368843
},
"timestamp": 1394788317965
}, {
"coords": {
"speed": 4.705626964569092,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 231,
"longitude": 5.871210945775612,
"heading": 164.1796875,
"latitude": 45.645453105723156
},
"timestamp": 1394788318956
}, {
"coords": {
"speed": 4.378190040588379,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 231,
"longitude": 5.87124749087344,
"heading": 126.2109375,
"latitude": 45.645433282522156
},
"timestamp": 1394788320197
}, {
"coords": {
"speed": 4.208680152893066,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 233,
"longitude": 5.871283365419014,
"heading": 125.859375,
"latitude": 45.6454103999265
},
"timestamp": 1394788320894
}, {
"coords": {
"speed": 4.072604179382324,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 233,
"longitude": 5.871314043184622,
"heading": 103.359375,
"latitude": 45.645410819021656
},
"timestamp": 1394788322169
}, {
"coords": {
"speed": 3.7680623531341553,
"accuracy": 5,
"altitudeAccuracy": 6,
"altitude": 234,
"longitude": 5.871355114510163,
"heading": 92.4609375,
"latitude": 45.645418111277415
},
"timestamp": 1394788322898
}, {
"coords": {
"speed": 3.537794351577759,
"accuracy": 10,
"altitudeAccuracy": 6,
"altitude": 234,
"longitude": 5.871393922721847,
"heading": 92.4609375,
"latitude": 45.64541693781097
},
"timestamp": 1394788323968
}, {
"coords": {
"speed": 3.3741507530212402,
"accuracy": 10,
"altitudeAccuracy": 6,
"altitude": 234,
"longitude": 5.8714455552453835,
"heading": 75.5859375,
"latitude": 45.645444011358215
},
"timestamp": 1394788324896
}, {
"coords": {
"speed": 3.3729660511016846,
"accuracy": 10,
"altitudeAccuracy": 6,
"altitude": 235,
"longitude": 5.87150791660498,
"heading": 70.3125,
"latitude": 45.64547209073384
},
"timestamp": 1394788325971
}, {
"coords": {
"speed": 3.463883876800537,
"accuracy": 10,
"altitudeAccuracy": 6,
"altitude": 235,
"longitude": 5.871554352348551,
"heading": 70.3125,
"latitude": 45.64548374157925
},
"timestamp": 1394788327122
}, {
"coords": {
"speed": 3.5247886180877686,
"accuracy": 10,
"altitudeAccuracy": 6,
"altitude": 235,
"longitude": 5.871567260479435,
"heading": 67.1484375,
"latitude": 45.645496733529164
},
"timestamp": 1394788328164
}, {
"coords": {
"speed": 3.455146551132202,
"accuracy": 10,
"altitudeAccuracy": 6,
"altitude": 235,
"longitude": 5.871608583262071,
"heading": 68.90625,
"latitude": 45.64550293613751
},
"timestamp": 1394788328985
}, {
"coords": {
"speed": 3.382997989654541,
"accuracy": 10,
"altitudeAccuracy": 8,
"altitude": 236,
"longitude": 5.871640518313154,
"heading": 78.75,
"latitude": 45.6454965658911
},
"timestamp": 1394788329900
}, {
"coords": {
"speed": 3.242330312728882,
"accuracy": 10,
"altitudeAccuracy": 8,
"altitude": 236,
"longitude": 5.871667759498462,
"heading": 92.4609375,
"latitude": 45.64548562750746
},
"timestamp": 1394788331120
}, {
"coords": {
"speed": 3.074465274810791,
"accuracy": 10,
"altitudeAccuracy": 8,
"altitude": 236,
"longitude": 5.871691312646374,
"heading": 110.0390625,
"latitude": 45.645468402696444
},
"timestamp": 1394788332219
}]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

2223
examples/data/osm/map.osm Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -50,8 +51,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=device-orientation" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=device-orientation" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,6 +1,5 @@
goog.require('ol.DeviceOrientation');
goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.dom.Input');
goog.require('ol.layer.Tile');
@@ -16,7 +15,7 @@ var map = new ol.Map({
source: new ol.source.OSM()
})
],
renderer: ol.RendererHints.createFromQueryData(),
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: view
});
@@ -25,12 +24,11 @@ var deviceOrientation = new ol.DeviceOrientation();
var track = new ol.dom.Input(document.getElementById('track'));
track.bindTo('checked', deviceOrientation, 'tracking');
deviceOrientation.on('propertychange', function(event) {
// event.key is the changed property name
var element = document.getElementById(event.key);
if (element) {
element.innerHTML = deviceOrientation.get(event.key);
}
deviceOrientation.on('change', function(event) {
$('#alpha').text(deviceOrientation.getAlpha() + ' [rad]');
$('#beta').text(deviceOrientation.getBeta() + ' [rad]');
$('#gamma').text(deviceOrientation.getGamma() + ' [rad]');
$('#heading').text(deviceOrientation.getHeading() + ' [rad]');
});
// tilt the map

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -48,8 +49,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=drag-and-drop-image-vector" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=drag-and-drop-image-vector" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,5 +1,4 @@
goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.format.GPX');
goog.require('ol.format.GeoJSON');
@@ -105,7 +104,7 @@ var map = new ol.Map({
})
})
],
renderer: ol.RendererHints.createFromQueryData(),
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: new ol.View2D({
center: [0, 0],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -48,8 +49,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=drag-and-drop" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=drag-and-drop" type="text/javascript"></script>
</body>
</html>

View File

@@ -103,7 +103,6 @@ var map = new ol.Map({
})
})
],
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: [0, 0],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -44,8 +45,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=drag-rotate-and-zoom" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=drag-rotate-and-zoom" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,5 +1,4 @@
goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.interaction');
goog.require('ol.interaction.DragRotateAndZoom');
@@ -16,7 +15,7 @@ var map = new ol.Map({
source: new ol.source.MapQuest({layer: 'sat'})
})
],
renderer: ol.RendererHints.createFromQueryData(),
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: new ol.View2D({
center: [0, 0],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -52,8 +53,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=draw-features" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=draw-features" type="text/javascript"></script>
</body>
</html>

View File

@@ -38,7 +38,6 @@ var vector = new ol.layer.Vector({
var map = new ol.Map({
layers: [raster, vector],
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: [-11000000, 4600000],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -43,8 +44,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=dynamic-data" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=dynamic-data" type="text/javascript"></script>
</body>
</html>

View File

@@ -14,7 +14,6 @@ var map = new ol.Map({
source: new ol.source.MapQuest({layer: 'sat'})
})
],
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: [0, 0],
@@ -48,6 +47,6 @@ map.on('postcompose', function(event) {
vectorContext.setImageStyle(imageStyle);
vectorContext.drawMultiPointGeometry(
new ol.geom.MultiPoint(coordinates), null);
map.requestRenderFrame();
map.render();
});
map.requestRenderFrame();
map.render();

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -43,8 +44,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=epsg-4326" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=epsg-4326" type="text/javascript"></script>
</body>
</html>

View File

@@ -26,8 +26,6 @@ var map = new ol.Map({
})
]),
layers: layers,
// The OSgeo server does not set cross origin headers, so we cannot use WebGL
renderer: ['canvas', 'dom'],
target: 'map',
view: new ol.View2D({
projection: 'EPSG:4326',

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -48,8 +49,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=export-map" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=export-map" type="text/javascript"></script>
</body>
</html>

View File

@@ -10,7 +10,6 @@ var map = new ol.Map({
source: new ol.source.OSM()
})
],
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: [0, 0],

64
examples/fractal.html Normal file
View File

@@ -0,0 +1,64 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Fractal Example</title>
<style>
.map {
background: whitesmoke;
}
#depth {
width: 100px;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Fractal Example</h4>
<p id="shortdesc">Example of a fractal.</p>
<label for="depth">
depth:&nbsp;
<input id="depth" type="range" min="0" max="9" step="1" value="5">
&nbsp;(<span id="count">#</span> points)
</label>
<div id="docs">
<p>See the <a href="fractal.js" target="_blank">fractal.js source</a> to see how this is done.</p>
</div>
<div id="tags">fractal, vector</div>
</div>
</div>
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=fractal" type="text/javascript"></script>
</body>
</html>

124
examples/fractal.js Normal file
View File

@@ -0,0 +1,124 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View2D');
goog.require('ol.geom.LineString');
goog.require('ol.layer.Vector');
goog.require('ol.source.Vector');
var radius = 10e6;
var cos30 = Math.cos(Math.PI / 6);
var sin30 = Math.sin(Math.PI / 6);
var rise = radius * sin30;
var run = radius * cos30;
var triangle = new ol.geom.LineString([
[0, radius], [run, -rise], [-run, -rise], [0, radius]
]);
var feature = new ol.Feature(triangle);
var layer = new ol.layer.Vector({
source: new ol.source.Vector({
features: [feature]
})
});
var map = new ol.Map({
layers: [layer],
target: 'map',
view: new ol.View2D({
center: [0, 0],
zoom: 1
})
});
function makeFractal(depth) {
var geometry = /** @type {ol.geom.LineString} */ (triangle.clone());
var graph = coordsToGraph(geometry.getCoordinates());
for (var i = 0; i < depth; ++i) {
var node = graph;
while (node.next) {
var next = node.next;
injectNodes(node);
node = next;
}
}
var coordinates = graphToCoords(graph);
document.getElementById('count').innerHTML = coordinates.length;
geometry.setCoordinates(coordinates);
feature.setGeometry(geometry);
}
function injectNodes(startNode) {
var endNode = startNode.next;
var start = startNode.point;
var end = startNode.next.point;
var dx = end[0] - start[0];
var dy = end[1] - start[1];
// first point at 1/3 along the segment
var firstNode = {
point: [start[0] + dx / 3, start[1] + dy / 3]
};
// second point at peak of _/\_
var r = Math.sqrt(dx * dx + dy * dy) / (2 * cos30);
var a = Math.atan2(dy, dx) + Math.PI / 6;
var secondNode = {
point: [start[0] + r * Math.cos(a), start[1] + r * Math.sin(a)]
};
// third point at 2/3 along the segment
var thirdNode = {
point: [end[0] - dx / 3, end[1] - dy / 3]
};
startNode.next = firstNode;
firstNode.next = secondNode;
secondNode.next = thirdNode;
thirdNode.next = endNode;
}
function coordsToGraph(coordinates) {
var graph = {
point: coordinates[0]
};
var length = coordinates.length;
for (var level = 0, node = graph; level < length - 1; ++level) {
node.next = {
point: coordinates[level + 1]
};
node = node.next;
}
return graph;
}
function graphToCoords(graph) {
var coordinates = [graph.point];
for (var node = graph, i = 1; node.next; node = node.next, ++i) {
coordinates[i] = node.next.point;
}
return coordinates;
}
var depthInput = document.getElementById('depth');
function update() {
makeFractal(Number(depthInput.value));
}
var updateTimer;
/**
* Regenerate fractal on depth change. Change events are debounced so updates
* only occur every 200ms.
*/
depthInput.onchange = function() {
window.clearTimeout(updateTimer);
updateTimer = window.setTimeout(update, 200);
};
update();

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -56,8 +57,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=full-screen-drag-rotate-and-zoom" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=full-screen-drag-rotate-and-zoom" type="text/javascript"></script>
</body>
</html>

View File

@@ -24,7 +24,6 @@ var map = new ol.Map({
})
],
// Use the canvas renderer because it's currently the fastest
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: [-33519607, 5616436],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -14,6 +15,9 @@
.map:-webkit-full-screen {
height: 100%;
}
.map:-ms-fullscreen {
height: 100%;
}
.map:full-screen {
height: 100%;
}
@@ -56,8 +60,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=full-screen" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=full-screen" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,5 +1,4 @@
goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.control');
goog.require('ol.control.FullScreen');
@@ -24,7 +23,7 @@ var map = new ol.Map({
})
})
],
renderer: ol.RendererHints.createFromQueryData(),
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: view
});

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -43,8 +44,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=geojson" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=geojson" type="text/javascript"></script>
</body>
</html>

View File

@@ -187,7 +187,6 @@ var map = new ol.Map({
}),
vectorLayer
],
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: [0, 0],

View File

@@ -0,0 +1,53 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Mobile Geolocation Tracking with Orientation</title>
<style type="text/css">
html, body, .map {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
#info {
position: absolute;
font-size: 0.7em;
top: 10px;
right: 10px;
background-color: lightgrey;
padding: 4px;
}
.button {
position: absolute;
bottom: 40px;
left: 10px;
}
</style>
</head>
<body>
<div id="map" class="map"></div>
<div id="info"></div>
<img id="geolocation_marker" src="data/geolocation_marker.png" />
<div class="button">
<button id="geolocate">Geolocate Me!</button>
<button id="simulate">Simulate</button>
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=geolocation-orientation" type="text/javascript"></script>
<div style="display: none;">
<div id="title">Geolocation tracking with orientation example</div>
<div id="shortdesc">Example of a geolocated and oriented map.</div>
<div id="tags">fullscreen, geolocation, orientation, mobile</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,222 @@
goog.require('ol.Geolocation');
goog.require('ol.Map');
goog.require('ol.Overlay');
goog.require('ol.View2D');
goog.require('ol.geom.LineString');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
// creating the view
var view = new ol.View2D({
center: ol.proj.transform([5.8713, 45.6452], 'EPSG:4326', 'EPSG:3857'),
zoom: 19
});
// creating the map
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
target: 'map',
view: view
});
// Geolocation marker
var markerEl = document.getElementById('geolocation_marker');
var marker = new ol.Overlay({
positioning: 'center-center',
element: markerEl,
stopEvent: false
});
map.addOverlay(marker);
// LineString to store the different geolocation positions. This LineString
// is time aware.
// The Z dimension is actually used to store the rotation (heading).
var positions = new ol.geom.LineString([], 'XYZM');
// Geolocation Control
var geolocation = new ol.Geolocation(/** @type {olx.GeolocationOptions} */ ({
trackingOptions: {
maximumAge: 10000,
enableHighAccuracy: true,
timeout: 600000
}
}));
geolocation.bindTo('projection', view);
var deltaMean = 500; // the geolocation sampling period mean in ms
// Listen to position changes
geolocation.on('change', function(evt) {
var position = geolocation.getPosition();
var accuracy = geolocation.getAccuracy();
var heading = geolocation.getHeading() || 0;
var speed = geolocation.getSpeed() || 0;
var m = Date.now();
addPosition(position, heading, m, speed);
var coords = positions.getCoordinates();
var len = coords.length;
if (len >= 2) {
deltaMean = (coords[len - 1][3] - coords[0][3]) / (len - 1);
}
var html = [
'Position: ' + position[0].toFixed(2) + ', ' + position[1].toFixed(2),
'Accuracy: ' + accuracy,
'Heading: ' + Math.round(radToDeg(heading)) + '&deg;',
'Speed: ' + (speed * 3.6).toFixed(1) + ' km/h',
'Delta: ' + Math.round(deltaMean) + 'ms'
].join('<br />');
document.getElementById('info').innerHTML = html;
});
geolocation.on('error', function() {
alert('geolocation error');
// FIXME we should remove the coordinates in positions
});
// convert radians to degrees
function radToDeg(rad) {
return rad * 360 / (Math.PI * 2);
}
// convert degrees to radians
function degToRad(deg) {
return deg * Math.PI * 2 / 360;
}
// modulo for negative values
function mod(n) {
return ((n % (2 * Math.PI)) + (2 * Math.PI)) % (2 * Math.PI);
}
function addPosition(position, heading, m, speed) {
var x = position[0];
var y = position[1];
var fCoords = positions.getCoordinates();
var previous = fCoords[fCoords.length - 1];
var prevHeading = previous && previous[2];
if (prevHeading) {
var headingDiff = heading - mod(prevHeading);
// force the rotation change to be less than 180°
if (Math.abs(headingDiff) > Math.PI) {
var sign = (headingDiff >= 0) ? 1 : -1;
headingDiff = - sign * (2 * Math.PI - Math.abs(headingDiff));
}
heading = prevHeading + headingDiff;
}
positions.appendCoordinate([x, y, heading, m]);
// only keep the 20 last coordinates
positions.setCoordinates(positions.getCoordinates().slice(-20));
// FIXME use speed instead
if (heading && speed) {
markerEl.src = 'data/geolocation_marker_heading.png';
} else {
markerEl.src = 'data/geolocation_marker.png';
}
}
var previousM = 0;
// change center and rotation before render
map.beforeRender(function(map, frameState) {
if (frameState !== null) {
// use sampling period to get a smooth transition
var m = frameState.time - deltaMean * 1.5;
m = Math.max(m, previousM);
previousM = m;
// interpolate position along positions LineString
var c = positions.getCoordinateAtM(m, true);
var view = frameState.view2DState;
if (c) {
view.center = getCenterWithHeading(c, -c[2], view.resolution);
view.rotation = -c[2];
marker.setPosition(c);
}
}
return true; // Force animation to continue
});
// recenters the view by putting the given coordinates at 3/4 from the top or
// the screen
function getCenterWithHeading(position, rotation, resolution) {
var size = map.getSize();
var height = size[1];
return [
position[0] - Math.sin(rotation) * height * resolution * 1 / 4,
position[1] + Math.cos(rotation) * height * resolution * 1 / 4
];
}
// postcompose callback
function render() {
map.render();
}
// geolocate device
var geolocateBtn = document.getElementById('geolocate');
geolocateBtn.addEventListener('click', function() {
geolocation.setTracking(true); // Start position tracking
map.on('postcompose', render);
map.render();
disableButtons();
}, false);
// simulate device move
var simulationData;
$.getJSON('data/geolocation-orientation.json', function(data) {
simulationData = data.data;
});
var simulateBtn = document.getElementById('simulate');
simulateBtn.addEventListener('click', function() {
var coordinates = simulationData;
var first = coordinates.shift();
simulatePositionChange(first);
var prevDate = first.timestamp;
function geolocate() {
var position = coordinates.shift();
if (!position) {
return;
}
var newDate = position.timestamp;
simulatePositionChange(position);
window.setTimeout(function() {
prevDate = newDate;
geolocate();
}, (newDate - prevDate) / 0.5);
}
geolocate();
map.on('postcompose', render);
map.render();
disableButtons();
}, false);
function simulatePositionChange(position) {
var coords = position.coords;
geolocation.set('accuracy', coords.accuracy);
geolocation.set('heading', degToRad(coords.heading));
var position_ = [coords.longitude, coords.latitude];
var projectedPosition = ol.proj.transform(position_, 'EPSG:4326',
'EPSG:3857');
geolocation.set('position', projectedPosition);
geolocation.set('speed', coords.speed);
geolocation.dispatchChangeEvent();
}
function disableButtons() {
geolocateBtn.disabled = 'disabled';
simulateBtn.disabled = 'disabled';
}

View File

@@ -4,18 +4,10 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<style>
.icon-flag {
font-size: 22px;
text-shadow: 2px 2px 3px #013;
}
.tooltip-inner {
white-space: nowrap;
}
</style>
<title>Geolocation example</title>
</head>
<body>
@@ -62,9 +54,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="../resources/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="loader.js?id=geolocation" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=geolocation" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,13 +1,10 @@
// FIXME use an ol.geom.Circle to display a circle with accuracy
// FIXME this circle will need to compensate for the pointResolution of the
// FIXME EPSG:3857 projection
goog.require('ol.Feature');
goog.require('ol.FeatureOverlay');
goog.require('ol.Geolocation');
goog.require('ol.Map');
goog.require('ol.Overlay');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.dom.Input');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
@@ -23,7 +20,6 @@ var map = new ol.Map({
source: new ol.source.OSM()
})
],
renderer: ol.RendererHints.createFromQueryData(),
target: 'map',
view: view
});
@@ -34,7 +30,8 @@ geolocation.bindTo('projection', view);
var track = new ol.dom.Input(document.getElementById('track'));
track.bindTo('checked', geolocation, 'tracking');
geolocation.on('propertychange', function() {
// update the HTML page when the position changes.
geolocation.on('change', function() {
$('#accuracy').text(geolocation.getAccuracy() + ' [m]');
$('#altitude').text(geolocation.getAltitude() + ' [m]');
$('#altitudeAccuracy').text(geolocation.getAltitudeAccuracy() + ' [m]');
@@ -42,22 +39,23 @@ geolocation.on('propertychange', function() {
$('#speed').text(geolocation.getSpeed() + ' [m/s]');
});
var marker = new ol.Overlay({
element: /** @type {Element} */ ($('<i/>').addClass('icon-flag').get(0)),
positioning: 'bottom-left',
stopEvent: false
});
map.addOverlay(marker);
// bind the marker position to the device location.
marker.bindTo('position', geolocation);
geolocation.on('change:accuracy', function() {
$(marker.getElement()).tooltip({
title: this.getAccuracy() + 'm from this point'
});
});
// handle geolocation error.
geolocation.on('error', function(error) {
var info = document.getElementById('info');
info.innerHTML = error.message;
info.style.display = '';
});
var accuracyFeature = new ol.Feature();
accuracyFeature.bindTo('geometry', geolocation, 'accuracyGeometry');
var positionFeature = new ol.Feature();
positionFeature.bindTo('geometry', geolocation, 'position')
.transform(function() {}, function(coordinates) {
return coordinates ? new ol.geom.Point(coordinates) : null;
});
var featuresOverlay = new ol.FeatureOverlay({
map: map,
features: [accuracyFeature, positionFeature]
});

View File

@@ -5,6 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -49,8 +50,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=getfeatureinfo" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=getfeatureinfo" type="text/javascript"></script>
</body>
</html>

View File

@@ -23,7 +23,6 @@ var viewProjection = /** @type {ol.proj.Projection} */
var map = new ol.Map({
layers: [wmsLayer],
renderer: 'canvas',
target: 'map',
view: view
});

View File

@@ -5,6 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -12,6 +13,10 @@
div.ol-logo {
left: 65px;
}
div.fill {
width: 100%;
height: 100%;
}
</style>
<script src="http://maps.google.com/maps/api/js?v=3&amp;sensor=false"></script>
<title>Google Maps integration example</title>
@@ -30,7 +35,10 @@
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div id="map" class="map">
<div id="gmap" class="fill"></div>
<div id="olmap" class="fill"></div>
</div>
</div>
</div>
@@ -50,8 +58,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=google-map" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=google-map" type="text/javascript"></script>
</body>
</html>

View File

@@ -12,9 +12,7 @@ goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var gmap = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(0, 0),
zoom: 1,
var gmap = new google.maps.Map(document.getElementById('gmap'), {
disableDefaultUI: true,
keyboardShortcuts: false,
draggable: false,
@@ -23,52 +21,44 @@ var gmap = new google.maps.Map(document.getElementById('map'), {
streetViewControl: false
});
var olmap = document.createElement('div');
olmap.style['width'] = '100%';
olmap.style['height'] = '100%';
gmap.controls[google.maps.ControlPosition.TOP_LEFT].push(olmap);
google.maps.event.addListenerOnce(gmap, 'tilesloaded', function() {
var vector = new ol.layer.Vector({
source: new ol.source.GeoJSON({
url: 'data/geojson/countries.geojson',
projection: 'EPSG:3857'
}),
style: new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.6)'
}),
stroke: new ol.style.Stroke({
color: '#319FD3',
width: 1
})
})
});
var center = gmap.getCenter();
var map = new ol.Map({
layers: [vector],
interactions: ol.interaction.defaults({
altShiftDragRotate: false,
dragPan: false,
touchRotate: false
}).extend([new ol.interaction.DragPan({kinetic: false})]),
renderer: 'canvas',
target: olmap,
view: new ol.View2D({
center: ol.proj.transform([center.lng(), center.lat()],
'EPSG:4326', 'EPSG:3857'),
zoom: gmap.getZoom()
})
});
var view = map.getView().getView2D();
view.on('change:center', function() {
var center = ol.proj.transform(view.getCenter(),
'EPSG:3857', 'EPSG:4326');
gmap.setCenter(new google.maps.LatLng(center[1], center[0]));
});
view.on('change:resolution', function() {
gmap.setZoom(view.getZoom());
});
var view = new ol.View2D();
view.on('change:center', function() {
var center = ol.proj.transform(view.getCenter(), 'EPSG:3857', 'EPSG:4326');
gmap.setCenter(new google.maps.LatLng(center[1], center[0]));
});
view.on('change:resolution', function() {
gmap.setZoom(view.getZoom());
});
var vector = new ol.layer.Vector({
source: new ol.source.GeoJSON({
url: 'data/geojson/countries.geojson',
projection: 'EPSG:3857'
}),
style: new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.6)'
}),
stroke: new ol.style.Stroke({
color: '#319FD3',
width: 1
})
})
});
var olMapDiv = document.getElementById('olmap');
var map = new ol.Map({
layers: [vector],
interactions: ol.interaction.defaults({
altShiftDragRotate: false,
pan: false,
rotate: false
}).extend([new ol.interaction.DragPan({kinetic: false})]),
target: olMapDiv,
view: view
});
view.setCenter([0, 0]);
view.setZoom(1);
olMapDiv.parentNode.removeChild(olMapDiv);
gmap.controls[google.maps.ControlPosition.TOP_LEFT].push(olMapDiv);

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -48,8 +49,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=gpx" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=gpx" type="text/javascript"></script>
</body>
</html>

View File

@@ -55,7 +55,6 @@ var vector = new ol.layer.Vector({
var map = new ol.Map({
layers: [raster, vector],
renderer: 'canvas',
target: document.getElementById('map'),
view: new ol.View2D({
center: [-7916041.528716288, 5228379.045749711],

View File

@@ -0,0 +1,52 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Earthquakes heatmap</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"><div id="info"></div></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Earthquakes heatmap</h4>
<p id="shortdesc">Demonstrates the use of a heatmap layer.</p>
<div id="docs">
<p>
This example parses a KML file and renders the features as a <code>ol.layer.Heatmap</code> layer.
</p>
<p>See the <a href="heatmap-earthquakes.js" target="_blank">heatmap-earthquakes.js source</a> to see how this is done.</p>
</div>
<div id="tags">heatmap, kml, vector, style</div>
</div>
</div>
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=heatmap-earthquakes" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
</body>
</html>

View File

@@ -0,0 +1,39 @@
goog.require('ol.Map');
goog.require('ol.View2D');
goog.require('ol.layer.Heatmap');
goog.require('ol.layer.Tile');
goog.require('ol.source.KML');
goog.require('ol.source.Stamen');
var vector = new ol.layer.Heatmap({
source: new ol.source.KML({
projection: 'EPSG:3857',
url: 'data/kml/2012_Earthquakes_Mag5.kml'
}),
radius: 5
});
vector.getSource().on('addfeature', function(event) {
// 2012_Earthquakes_Mag5.kml stores the magnitude of each earthquake in a
// standards-violating <magnitude> tag in each Placemark. We extract it from
// the Placemark's name instead.
var name = event.feature.get('name');
var magnitude = parseFloat(name.substr(2));
event.feature.set('weight', magnitude - 5);
});
var raster = new ol.layer.Tile({
source: new ol.source.Stamen({
layer: 'toner'
})
});
var map = new ol.Map({
layers: [raster, vector],
target: 'map',
view: new ol.View2D({
center: [0, 0],
zoom: 2
})
});

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -66,8 +67,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=hue-saturation" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=hue-saturation" type="text/javascript"></script>
</body>
</html>

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -54,8 +55,8 @@
<script src="jquery.min.js" type="text/javascript"></script>
<script src="../resources/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="loader.js?id=icon" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=icon" type="text/javascript"></script>
</body>
</html>

View File

@@ -23,6 +23,7 @@ var iconStyle = new ol.style.Style({
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
opacity: 0.75,
src: 'data/icon.png'
}))
});
@@ -45,7 +46,6 @@ var rasterLayer = new ol.layer.Tile({
var map = new ol.Map({
layers: [rasterLayer, vectorLayer],
renderer: 'canvas',
target: document.getElementById('map'),
view: new ol.View2D({
center: [0, 0],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -35,6 +36,7 @@
<div id="docs">
<p>See the <a href="igc.js" target="_blank">igc.js source</a> to see how this is done.</p>
</div>
<input id="time" type="range" value="0" steps="1"></input>
<div id="tags">complex-geometry, closest-feature, igc, opencyclemap</div>
</div>
<div class="span4 offset4">
@@ -48,8 +50,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=igc" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=igc" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,4 +1,6 @@
goog.require('ol.Attribution');
goog.require('ol.Feature');
goog.require('ol.FeatureOverlay');
goog.require('ol.Map');
goog.require('ol.View2D');
goog.require('ol.geom.LineString');
@@ -8,6 +10,7 @@ goog.require('ol.layer.Vector');
goog.require('ol.source.IGC');
goog.require('ol.source.OSM');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
@@ -47,6 +50,19 @@ var vectorSource = new ol.source.IGC({
]
});
var time = {
start: Infinity,
stop: -Infinity,
duration: 0
};
vectorSource.on('addfeature', function(event) {
var geometry = event.feature.getGeometry();
time.start = Math.min(time.start, geometry.getFirstCoordinate()[2]);
time.stop = Math.max(time.stop, geometry.getLastCoordinate()[2]);
time.duration = time.stop - time.start;
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
@@ -66,7 +82,6 @@ var map = new ol.Map({
style: styleFunction
})
],
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: [703365.7089403362, 5714629.865071137],
@@ -102,7 +117,7 @@ var displaySnap = function(coordinate) {
line.setCoordinates(coordinates);
}
}
map.requestRenderFrame();
map.render();
};
$(map.getViewport()).on('mousemove', function(evt) {
@@ -137,3 +152,34 @@ map.on('postcompose', function(evt) {
vectorContext.drawLineStringGeometry(line);
}
});
var featureOverlay = new ol.FeatureOverlay({
map: map,
style: new ol.style.Style({
image: new ol.style.Circle({
radius: 5,
fill: new ol.style.Fill({
color: 'rgba(255,0,0,0.9)'
}),
stroke: null
})
})
});
$('#time').on('input', function(event) {
var value = parseInt($(this).val(), 10) / 100;
var m = time.start + (time.duration * value);
vectorSource.forEachFeature(function(feature) {
var geometry = /** @type {ol.geom.LineString} */ (feature.getGeometry());
var coordinate = geometry.getCoordinateAtM(m, true);
var highlight = feature.get('highlight');
if (highlight === undefined) {
highlight = new ol.Feature(new ol.geom.Point(coordinate));
feature.set('highlight', highlight);
featureOverlay.addFeature(highlight);
} else {
highlight.getGeometry().setCoordinates(coordinate);
}
});
map.render();
});

View File

@@ -0,0 +1,65 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Image Filter Example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Image filter example</h4>
<p id="shortdesc">Apply a filter to imagery</p>
<select id="kernel" name="kernel">
<option>none</option>
<option selected>sharpen</option>
<option value="sharpenless">sharpen less</option>
<option>blur</option>
<option>shadow</option>
<option>emboss</option>
<option value="edge">edge detect</option>
</select>
<div id="docs">
<p>
Layer rendering can be manipulated in <code>precompose</code> and <code>postcompose</code> event listeners.
These listeners get an event with a reference to the Canvas rendering context.
In this example, the <code>postcompose</code> listener applies a filter to the image data.
</p>
<p>See the <a href="image-filter.js" target="_blank">image-filter.js source</a> for details on how this is done.</p>
</div>
<div id="tags">filter, image manipulation</div>
</div>
</div>
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=image-filter" type="text/javascript"></script>
</body>
</html>

146
examples/image-filter.js Normal file
View File

@@ -0,0 +1,146 @@
goog.require('ol.Map');
goog.require('ol.View2D');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.BingMaps');
var key = 'Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3';
var imagery = new ol.layer.Tile({
source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'})
});
var map = new ol.Map({
layers: [imagery],
target: 'map',
view: new ol.View2D({
center: ol.proj.transform([-120, 50], 'EPSG:4326', 'EPSG:3857'),
zoom: 6
})
});
var kernels = {
none: [
0, 0, 0,
0, 1, 0,
0, 0, 0
],
sharpen: [
0, -1, 0,
-1, 5, -1,
0, -1, 0
],
sharpenless: [
0, -1, 0,
-1, 10, -1,
0, -1, 0
],
blur: [
1, 1, 1,
1, 1, 1,
1, 1, 1
],
shadow: [
1, 2, 1,
0, 1, 0,
-1, -2, -1
],
emboss: [
-2, 1, 0,
-1, 1, 1,
0, 1, 2
],
edge: [
0, 1, 0,
1, -4, 1,
0, 1, 0
]
};
function normalize(kernel) {
var len = kernel.length;
var normal = new Array(len);
var i, sum = 0;
for (i = 0; i < len; ++i) {
sum += kernel[i];
}
if (sum <= 0) {
normal.normalized = false;
sum = 1;
} else {
normal.normalized = true;
}
for (i = 0; i < len; ++i) {
normal[i] = kernel[i] / sum;
}
return normal;
}
var select = document.getElementById('kernel');
var selectedKernel = normalize(kernels[select.value]);
/**
* Update the kernel and re-render on change.
*/
select.onchange = function() {
selectedKernel = normalize(kernels[select.value]);
map.render();
};
/**
* Apply a filter on "postcompose" events.
* @param {ol.render.Event} event Render event.
*/
imagery.on('postcompose', function(event) {
convolve(event.context, selectedKernel);
});
/**
* Apply a convolution kernel to canvas. This works for any size kernel, but
* performance starts degrading above 3 x 3.
* @param {CanvasRenderingContext2D} context Canvas 2d context.
* @param {Array.<number>} kernel Kernel.
*/
function convolve(context, kernel) {
var canvas = context.canvas;
var width = canvas.width;
var height = canvas.height;
var size = Math.sqrt(kernel.length);
var half = Math.floor(size / 2);
var inputData = context.getImageData(0, 0, width, height).data;
var output = context.createImageData(width, height);
var outputData = output.data;
for (var pixelY = 0; pixelY < height; ++pixelY) {
var pixelsAbove = pixelY * width;
for (var pixelX = 0; pixelX < width; ++pixelX) {
var r = 0, g = 0, b = 0, a = 0;
for (var kernelY = 0; kernelY < size; ++kernelY) {
for (var kernelX = 0; kernelX < size; ++kernelX) {
var weight = kernel[kernelY * size + kernelX];
var neighborY = Math.min(
height - 1, Math.max(0, pixelY + kernelY - half));
var neighborX = Math.min(
width - 1, Math.max(0, pixelX + kernelX - half));
var inputIndex = (neighborY * width + neighborX) * 4;
r += inputData[inputIndex] * weight;
g += inputData[inputIndex + 1] * weight;
b += inputData[inputIndex + 2] * weight;
a += inputData[inputIndex + 3] * weight;
}
}
var outputIndex = (pixelsAbove + pixelX) * 4;
outputData[outputIndex] = r;
outputData[outputIndex + 1] = g;
outputData[outputIndex + 2] = b;
outputData[outputIndex + 3] = kernel.normalized ? a : 255;
}
}
context.putImageData(output, 0, 0);
}

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -51,8 +52,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=image-vector-layer" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=image-vector-layer" type="text/javascript"></script>
</body>
</html>

View File

@@ -34,7 +34,6 @@ var map = new ol.Map({
})
})
],
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: [0, 0],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -67,8 +68,8 @@
<script src="jquery.min.js" type="text/javascript"></script>
<script src="../resources/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="loader.js?id=kml-earthquakes" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=kml-earthquakes" type="text/javascript"></script>
</body>
</html>

View File

@@ -53,7 +53,6 @@ var raster = new ol.layer.Tile({
var map = new ol.Map({
layers: [raster, vector],
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: [0, 0],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -55,8 +56,8 @@
<script src="jquery.min.js" type="text/javascript"></script>
<script src="../resources/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="loader.js?id=kml-timezones" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=kml-timezones" type="text/javascript"></script>
</body>
</html>

View File

@@ -60,7 +60,6 @@ var raster = new ol.layer.Tile({
var map = new ol.Map({
layers: [raster, vector],
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: [0, 0],

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@@ -48,8 +49,8 @@
</div>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=kml" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=kml" type="text/javascript"></script>
</body>
</html>

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