<div>> In addition, I'd like to add support for highlighting regions in the</div><div>grid. I've got a plan for doing this, and while I don't want to hold<br>up inclusion of the existing functionality, I do think the highlight<br>
functionality might inform a bit more how things could be structured.<br><br>Highlighting is a bit of an unusual question with UTFGrid. It's a tiles-only format - original geometries are never sent over in their full form. I've written a quick proof of concept, glower: <a href="http://mapbox.com/glower/#">http://mapbox.com/glower/#</a> which does an overlay of canvas tiles over normal tiles and implements some simple edge-squaring, anti-aliasing (by hand :/ ), and such. The OpenLayers implementation - I'm not sure if I've seen whether it loads all tiles by default or lazy-loads (as the other implementations do), but basically you need to resolve tile boundaries and do a bit of odd logic for figuring out which features are equal.</div>
<div><br><div class="gmail_quote">On Sat, Feb 25, 2012 at 6:35 PM, Tim Schaub <span dir="ltr"><<a href="mailto:tschaub@opengeo.org">tschaub@opengeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey Matt,<br>
<br>
Thanks for this great contribution. It's been high on my list of<br>
desires to get UTFGrid support into OpenLayers, and it looks like you<br>
have done a nice job of it.<br>
<br>
After a quick preliminary review, I do have a few comments. First,<br>
we'll need some tests to go along with this addition. Beyond that,<br>
I've got some suggestions about the layer API that I hope you'll be<br>
amenable to. I think it would make sense to provide a method on the<br>
layer to get attribute data for a map location. This functionality is<br>
currently in the control, but can see situations where it would be<br>
useful to access this and awkward to have to add a control. I'll<br>
provide a pull request for this and some additional tweaks. Note that<br>
my pull request will look a lot smaller if you merge the latest master<br>
into your utfgrid branch.<br>
<br>
In addition, I'd like to add support for highlighting regions in the<br>
grid. I've got a plan for doing this, and while I don't want to hold<br>
up inclusion of the existing functionality, I do think the highlight<br>
functionality might inform a bit more how things could be structured.<br>
<br>
I'll leave more comments on your pull request.<br>
<br>
Tim<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Feb 16, 2012 at 12:08 PM, Matt Perry <<a href="mailto:perrygeo@gmail.com">perrygeo@gmail.com</a>> wrote:<br>
> Hey all - I'm excited to share my implementation of OpenLayers support<br>
> for UTFGrids. I wanted to get some feedback before doing a pull<br>
> request.<br>
><br>
> Just a little background: UTFGrids are json "hit grids" used to<br>
> provide a high degree of interactivity. For example, you can have<br>
> mouseover events that display the attributes of the features *without*<br>
> fetching additional data from the server. The best demo of the concept<br>
> is probably <a href="http://mapbox.com/demo/visiblemap/" target="_blank">http://mapbox.com/demo/visiblemap/</a>.<br>
><br>
> This functionality exists in the wax library and is largely deployed<br>
> with ModestMaps. I've ported it to native OpenLayers code to better<br>
> integrate with OL event handlers and such. There are three additional<br>
> components: a UTFGrid Layer, Control and Tile. It has both ajax and<br>
> jsonp loading protocols, tries to keep a clear separation between the<br>
> grid layers, the grid controls and callbacks which allows things like<br>
> multiple handlers and multiple hit grids per map.<br>
><br>
> Some example code:<br>
> var world_utfgrid = new OpenLayers.Layer.UTFGrid(<br>
> 'UTFGrid Layer',<br>
> "<a href="http://tiles.example.com/world_utfgrid/${z}/${x}/${y}.json" target="_blank">http://tiles.example.com/world_utfgrid/${z}/${x}/${y}.json</a>"<br>
> );<br>
> map.addLayer(world_utfgrid);<br>
><br>
> var control = new OpenLayers.Control.UTFGrid({<br>
> 'div': 'attrsdiv',<br>
> 'layers': [world_utfgrid],<br>
> 'handlerMode': 'move'<br>
> })<br>
> map.addControl(control);<br>
><br>
><br>
> Some demos:<br>
> <a href="http://labs.ecotrust.org/utfgrid/events.html" target="_blank">http://labs.ecotrust.org/utfgrid/events.html</a><br>
> <a href="http://labs.ecotrust.org/utfgrid/multi.html" target="_blank">http://labs.ecotrust.org/utfgrid/multi.html</a><br>
><br>
> and source:<br>
> <a href="https://github.com/perrygeo/openlayers/tree/utfgrid" target="_blank">https://github.com/perrygeo/openlayers/tree/utfgrid</a><br>
><br>
> Any thoughts on getting this into 2.12? This is my first substantial<br>
> effort in extending OpenLayers so if you have any critiques or<br>
> concerns that need to be addressed before a pull request would be<br>
> considered, let me know.<br>
> --<br>
> ·´¯`·.¸. , . .·´¯`·.. ><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º><br>
> "The best way to predict the future is to invent it." -- Alan Kay<br>
> Matthew T. Perry<br>
> <a href="http://www.perrygeo.net" target="_blank">http://www.perrygeo.net</a><br>
> <a href="http://viedevelo.wordpress.com" target="_blank">http://viedevelo.wordpress.com</a><br>
</div></div><div class="im HOEnZb">> _______________________________________________<br>
> Dev mailing list<br>
> <a href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><br>
<br>
<br>
<br>
--<br>
</div><span class="HOEnZb"><font color="#888888">Tim Schaub<br>
OpenGeo <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
</font></span><div class="HOEnZb"><div class="h5">Expert service straight from the developers.<br>
_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><br>
</div></div></blockquote></div><br></div>