Commit Graph

27 Commits

Author SHA1 Message Date
ahocevar
8c0f1f979a Store the feature's commonly used id
To not clobber the feature's attributes, this is a separate
member property.
2013-05-23 11:16:17 -05:00
Frederic Junod
db34b37716 getFeatureInfo examples: listen to click events
This make the examples works on touch devices.
2013-05-22 12:30:31 +02:00
Frederic Junod
7d544e0868 Pass layers as array instead of ol.Collection 2013-05-21 12:35:02 +02:00
ahocevar
53b85c99ae map#getFeatureInfo does not return anything
Thanks @elemoine for catching this.
2013-05-09 22:32:40 +02:00
ahocevar
7b256c3ec6 Asynchronous API for map#getFeatureInfo
This change allows us to use feature info services on the
server. It will also be useful for the GetFeature control to
get results from a WFS.
2013-05-09 22:26:55 +02:00
ahocevar
d2c81db06a Info box instead of tooltip as suggested by @fredj 2013-04-30 14:15:39 +02:00
ahocevar
cc1b70c74b Giving the map a getFeatureInfoForPixel method
This method is an entry point for getting feature information.
Renderers can use a hit canvas or defer to a layer (source) to
get matching features for a pixel.

For now this is only implemented for vector layers, and it uses
a bbox query because we cannot refine the result because of
missing geometry intersection functions yet.
2013-04-30 13:32:16 +02:00
Tom Payne
81712a28a3 Fix whitespace errors in examples 2013-04-08 13:24:10 +02:00
Tom Payne
02196c94b5 Redefine ol.Coordinate to be Array.<number> 2013-04-05 12:30:37 +02:00
Tim Schaub
374e436872 Picking a color that shows up more clearly on bluemarble 2013-03-19 11:54:50 -06:00
Tim Schaub
251d6fc488 Example touch-ups
The strokeStyle property is now spelled strokeColor.  There is no sense in setting opacity to 1.5.  Moving map initialization up.
2013-03-19 06:38:50 -06:00
Éric Lemoine
51625b8008 Make vector-layer example ignore XHR errors
This is a workaround for our check-example.js PhantomJS script to work with this example. Without this check-example.js fails because xhr.status is 0. I tried to give the explicit file:/// scheme as indicated in https://groups.google.com/d/msg/phantomjs/wFGme0pE-Tk/WUjU5s-27NwJ, but that didn't work for me.
2013-03-15 15:46:40 +01:00
Éric Lemoine
a34adc6f62 Add countries.json to examples data dir
The examples cannot use files located in the test dir, or they won't work when hosted as GitHub pages.
2013-03-15 14:25:05 +01:00
Bruno Binet
9b1c389c80 Remove unused goog.require directives 2013-03-14 11:39:43 +01:00
ahocevar
f5b53740e6 Define map at the top 2013-03-12 08:28:24 +01:00
Tim Schaub
7f62b26c80 New example style 2013-03-07 23:48:23 -07:00
Tim Schaub
ee75c4b90e Use new projection getter 2013-03-07 23:48:10 -07:00
Tim Schaub
5ce114c1b6 Style in example 2013-03-07 22:29:00 -07:00
Tim Schaub
f961930823 Render countries from GeoJSON
This reveals a number of issues that still need to be addressed.
2013-03-06 19:24:53 -07:00
Tim Schaub
12bee3178e Moving the feature management to the layer
The source will be responsible for fetching vector data.
2013-03-05 12:46:55 +01:00
Tim Schaub
d3c4869917 Work with new ol.projection package 2013-03-03 16:09:00 +01:00
Tim Schaub
d642628545 Example syntax 2013-02-20 00:21:08 -07:00
Tim Schaub
735f490f56 Treating geometry as just another attribute
The first set geometry is considered the default.  As an added bonus, we're back to a single argument constructor.  Later, we could allow a schema to be set.  This would be done before setting values (calling constructor with no args).
2013-02-20 00:02:50 -07:00
ahocevar
61e4452c83 Adding missing and removing unused goog.requires 2013-02-06 16:26:24 +01:00
Tim Schaub
4e3f984796 Properly rendering features to canvas tiles
It looks like this approach will work well for panning (as anticipated).  For animated zooming, it is not going to work as is.  It looks like the canvas tile generation is too much for this type of animation loop.  Though there are clearly still areas for optimization:

 * Don't create new tiles while animating between zoom levels.  Using existing tiles only while animating should bring a significant performance gain.
 * Simple spatial index for tiles - each tile coord in the matrix could have a feature lookup object (keyed by id).  This needs to account for rendered dimension (as witnessed by the point being cut by a tile).  Given that the current example uses only three features, adding the spatial index should only be a minor improvement.
 * Reuse a fixed set of canvas tiles that are generated at construction (and increased/decreased with view size changes).
 * If a fixed set of tiles is not used, at least new ones could be cloned from existing ones (minor).
 * Do some profiling to look for more ideas.

In addition, world-wrapping needs addressed.  I don't think this renderer is the right (or at least the only) place to address this.  And the cache of tiles needs to be managed for real.  But hey, at least we've got a working tiled vector renderer now.
2013-01-24 21:57:12 -07:00
Tim Schaub
8d5a45d827 Set up example for debugging 2013-01-24 16:51:10 -07:00
Tim Schaub
c50fcecf42 Vector rendering example
There is a ton of room for optimization here.  The vector layer renderer should only render dirty areas and could maintain a cache of rendered canvas tiles.  The vector source could have a simple spatial index for features (by tile coord).  Need to also discuss how to work with this animation framework (to avoid the excess work while waiting for tiles to load on every other layer).
2013-01-22 01:46:27 -07:00