Commit Graph

12691 Commits

Author SHA1 Message Date
Tim Schaub
66d5d1d277 Export setStyle for vector layer 2014-02-13 10:25:17 -07:00
Tim Schaub
f4585331f2 Add setStyle and getStyle to ol.Feature
As with vector layers and feature overlays, feature style can be set by calling
setStyle.  Calling getStyle returns what was passed to setStyle.  Internally, we call getStyleFunction.
2014-02-13 10:25:17 -07:00
Tim Schaub
477c369f6c As with the vector layer, feature overlays have getStyle and setStyle 2014-02-13 10:25:17 -07:00
Tim Schaub
a1f714f7dc Add setStyle and getStyle methods to ol.layer.Vector
The setStyle method accepts a single style, an array of styles, or a style function.  The getStyle method returns what was set.  Internally, we use the getStyleFunction method which always returns a function.  When calling setStyle, a change event is dispatched (fixes #1671).
2014-02-13 10:25:17 -07:00
Tim Schaub
a185fc963d Tests for get/setStyleFunction
It would be nice to also test the following:

    it('does not return user set property with the same name', function() {
      var feature = new ol.Feature({
        whatever: 'some value',
        styleFunction: 'another value'
      });
      expect(feature.getStyleFunction()).to.be(undefined);
    });

Unfortunately, in uncompiled code (or if we export `setStyleFunction`) this does not work.  Same goes for user set `id` properties (this will set our internal `id_` property).  See #1672.
2014-02-13 10:25:17 -07:00
Tim Schaub
620a38d3e9 Avoid clashing with user property names
Features are records with any number of user set values.  Separate from this, we rely on feature properties like the feature identifier and feature style.  The two (user properties and our internal properties) should not be mixed.
2014-02-13 10:25:17 -07:00
Tim Schaub
10d5073732 Give the draw interaction a style option 2014-02-13 10:25:17 -07:00
Tim Schaub
76f6961f83 Delete style option before passing to base 2014-02-13 10:25:16 -07:00
Tim Schaub
c64c24d3dc Common code for creating a style function 2014-02-13 10:25:16 -07:00
Tim Schaub
6abb691224 Give feature overlays a style option 2014-02-13 10:25:16 -07:00
Tim Schaub
b309c44020 Give vector image source a style option 2014-02-13 10:25:16 -07:00
Tim Schaub
1072f6dfa7 Use style option in vector layer examples
Providing a styleFunction option still works because the layer property is still named styleFunction.
2014-02-13 10:25:16 -07:00
Tim Schaub
5c21f24df5 Add tests for vector layer 2014-02-13 10:25:16 -07:00
Tim Schaub
499ba4ac8f Add a style option for vector layers
This can be a single ol.style.Style, and array of styles, or a style function.
2014-02-13 10:25:16 -07:00
Bart van den Eijnden
990a852d4f Merge pull request #1675 from bartvde/wmts-example-fix
WMTS example is broken (r=@twpayne)
2014-02-13 16:25:59 +01:00
Bart van den Eijnden
56a39e936f Use APOLLO imagery WMTS in the WMTS example 2014-02-13 16:14:39 +01:00
Tom Payne
03beeafc21 Merge pull request #1681 from twpayne/line-dash
Fix management of line dash state
2014-02-13 15:40:39 +01:00
Tom Payne
dfc57e9db4 Fix handling of line dash state in ol.render.canvas.Immediate 2014-02-13 15:30:04 +01:00
Tom Payne
32e527458b Merge pull request #1694 from twpayne/protocol-relative-url
Use protocol relative URL in tile sources
2014-02-13 15:26:38 +01:00
Tom Payne
c31d423717 Merge pull request #1695 from twpayne/fix-render-node-leak
Save replay group, even if empty
2014-02-13 15:25:56 +01:00
Tom Payne
a178712f6b Only replay replay group if it is not empty 2014-02-13 14:47:47 +01:00
Tom Payne
5b8e85afbd Save replay group, even if it is empty 2014-02-13 14:36:59 +01:00
Tom Payne
02b4e7cced Use protocol relative URL in ol.source.Stamen 2014-02-13 13:48:06 +01:00
Tom Payne
bb7a1c11f6 Use protocol relative URL in ol.source.MapQuest 2014-02-13 13:47:13 +01:00
Frédéric Junod
0007b5e3ec Merge pull request #1692 from fredj/osm-tiles
Use protocol relative URL for OSM tiles
2014-02-13 12:14:59 +01:00
Frederic Junod
4cb4ab89db Use protocol relative URL for OSM tiles 2014-02-13 11:21:27 +01:00
ahocevar
20402a6e71 Merge pull request #1684 from ahocevar/ie-cursor
Changing pointer cursor in examples is broken
2014-02-12 23:30:06 +01:00
Tom Payne
5cc3983cdb Fix handling of line dash state in ol.render.canvas.Replay 2014-02-12 17:59:11 +01:00
Tom Payne
a74da436d2 Use ol.BrowserFeature.HAS_CANVAS_LINE_DASH in ol.render.canvas.Replay 2014-02-12 17:57:29 +01:00
Tom Payne
1924e2b9b3 Add detection of canvas line dash support 2014-02-12 15:56:01 +01:00
Antoine Abt
196f6cccfd Merge pull request #1689 from tonio/fix_modify
Check for geometries type instead of `instanceof`
2014-02-12 15:51:32 +01:00
Antoine Abt
f8a748d7f4 Fix MultiPoint modify 2014-02-12 15:26:57 +01:00
Antoine Abt
56a1f053ff Check geometry type instead of instanceof 2014-02-12 15:25:47 +01:00
Antoine Abt
715966a8d1 Add MultiPoint to modify example 2014-02-12 15:24:32 +01:00
Éric Lemoine
709c17192a Merge pull request #1686 from elemoine/icon-example
Show how to use ol.Feature#setStyleFunction in the icon example
2014-02-12 14:40:24 +01:00
Éric Lemoine
581b2d345d Show how to use ol.Feature#setStyleFunction in the icon example 2014-02-12 14:26:00 +01:00
ahocevar
e6e8037269 Merge pull request #1685 from ahocevar/google-no-rotation
Turn off rotation because Google does not support it
2014-02-12 12:25:45 +01:00
ahocevar
aa8bbe4c7b Turn off rotation because Google does not support it 2014-02-12 12:16:18 +01:00
ahocevar
b7757e6a1d Allow application developers to modify cursors
With this change, cursors can be set on the map target again.
2014-02-12 11:09:59 +01:00
Antoine Abt
0764ea99ee Merge pull request #1654 from tonio/vector-api-modify
Add Modify Interaction
2014-02-11 16:59:43 +01:00
Tom Payne
e0765240a2 Merge branch 'ie-compat' of git://github.com/Intermedix/ol3 into Intermedix-ie-compat 2014-02-11 16:54:39 +01:00
Frédéric Junod
b0698443ab Merge pull request #1679 from fredj/layer-swipe
Use 'input' event for HTML input range
2014-02-11 15:41:43 +01:00
Frederic Junod
cd8977fca1 Use 'input' event for HTML input range 2014-02-11 15:20:21 +01:00
Bart van den Eijnden
ee33cbc525 Merge pull request #1650 from bartvde/apidoc
missing link in api doc (r=@ahocevar)
2014-02-11 15:02:12 +01:00
Bart van den Eijnden
304e7c7df7 Add properties found in objectliterals.jsdoc to the API 2014-02-11 14:49:04 +01:00
Antoine Abt
03624b5f78 Check segment writers existence 2014-02-11 14:36:54 +01:00
Éric Lemoine
433fab0cbf Merge pull request #1678 from oterral/fix_exports
Add exports
2014-02-11 14:06:57 +01:00
oterral
3a7c80dfda Remove exports from ol.style.Image 2014-02-11 13:13:51 +01:00
oterral
8edcc7e161 Add exports for ol.style.Text 2014-02-11 12:33:12 +01:00
oterral
f122778c6d Add exports for ol.style.Icon 2014-02-11 12:20:00 +01:00