<div>&gt; In addition, I&#39;d like to add support for highlighting regions in the</div><div>grid.  I&#39;ve got a plan for doing this, and while I don&#39;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&#39;s a tiles-only format - original geometries are never sent over in their full form. I&#39;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&#39;m not sure if I&#39;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">&lt;<a href="mailto:tschaub@opengeo.org">tschaub@opengeo.org</a>&gt;</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&#39;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&#39;ll need some tests to go along with this addition.  Beyond that,<br>
I&#39;ve got some suggestions about the layer API that I hope you&#39;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&#39;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&#39;d like to add support for highlighting regions in the<br>
grid.  I&#39;ve got a plan for doing this, and while I don&#39;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&#39;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 &lt;<a href="mailto:perrygeo@gmail.com">perrygeo@gmail.com</a>&gt; wrote:<br>
&gt; Hey all - I&#39;m excited to share my implementation of OpenLayers support<br>
&gt; for UTFGrids. I wanted to get some feedback before doing a pull<br>
&gt; request.<br>
&gt;<br>
&gt; Just a little background: UTFGrids are json &quot;hit grids&quot; used to<br>
&gt; provide a high degree of interactivity. For example, you can have<br>
&gt; mouseover events that display the attributes of the features *without*<br>
&gt; fetching additional data from the server. The best demo of the concept<br>
&gt; is probably <a href="http://mapbox.com/demo/visiblemap/" target="_blank">http://mapbox.com/demo/visiblemap/</a>.<br>
&gt;<br>
&gt; This functionality exists in the wax library and is largely deployed<br>
&gt; with ModestMaps. I&#39;ve ported it to native OpenLayers code to better<br>
&gt; integrate with OL event handlers and such. There are three additional<br>
&gt; components: a UTFGrid Layer, Control and Tile. It has both ajax and<br>
&gt; jsonp loading protocols, tries to keep a clear separation between the<br>
&gt; grid layers, the grid controls and callbacks which allows things like<br>
&gt; multiple handlers and multiple hit grids per map.<br>
&gt;<br>
&gt; Some example code:<br>
&gt;        var world_utfgrid = new OpenLayers.Layer.UTFGrid(<br>
&gt;            &#39;UTFGrid Layer&#39;,<br>
&gt;            &quot;<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>&quot;<br>
&gt;        );<br>
&gt;        map.addLayer(world_utfgrid);<br>
&gt;<br>
&gt;        var control = new OpenLayers.Control.UTFGrid({<br>
&gt;            &#39;div&#39;: &#39;attrsdiv&#39;,<br>
&gt;            &#39;layers&#39;: [world_utfgrid],<br>
&gt;            &#39;handlerMode&#39;: &#39;move&#39;<br>
&gt;        })<br>
&gt;        map.addControl(control);<br>
&gt;<br>
&gt;<br>
&gt; Some demos:<br>
&gt; <a href="http://labs.ecotrust.org/utfgrid/events.html" target="_blank">http://labs.ecotrust.org/utfgrid/events.html</a><br>
&gt; <a href="http://labs.ecotrust.org/utfgrid/multi.html" target="_blank">http://labs.ecotrust.org/utfgrid/multi.html</a><br>
&gt;<br>
&gt; and source:<br>
&gt; <a href="https://github.com/perrygeo/openlayers/tree/utfgrid" target="_blank">https://github.com/perrygeo/openlayers/tree/utfgrid</a><br>
&gt;<br>
&gt; Any thoughts on getting this into 2.12? This is my first substantial<br>
&gt; effort in extending OpenLayers so if you have any critiques or<br>
&gt; concerns that need to be addressed before a pull request would be<br>
&gt; considered, let me know.<br>
&gt; --<br>
&gt; ·´¯`·.¸. , . .·´¯`·.. &gt;&lt;((((º&gt;`·.¸¸.·´¯`·.¸.·´¯`·...¸&gt;&lt;((((º&gt;<br>
&gt; &quot;The best way to predict the future is to invent it.&quot;  -- Alan Kay<br>
&gt; Matthew T. Perry<br>
&gt; <a href="http://www.perrygeo.net" target="_blank">http://www.perrygeo.net</a><br>
&gt; <a href="http://viedevelo.wordpress.com" target="_blank">http://viedevelo.wordpress.com</a><br>
</div></div><div class="im HOEnZb">&gt; _______________________________________________<br>
&gt; Dev mailing list<br>
&gt; <a href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a><br>
&gt; <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>