ThinkGeo.com    |     Documentation    |     Premium Support

Interactive choropleth maps using Leaflet, convert ThinkGeo styles?

WebAPI edition using Leaflet:
What I have seen from the ThinkGeo samples are basically non-interactive tiles and they seem to work very good. But we need to implement stuff like hovering a shape, highlighting a shape etc.

Looking at general non-ThinkGeo samples of Leaflet they support a custom styling API and render it to SVG (see http://leafletjs.com/examples/choropleth/).

I have noticed that ThinkGeo can return GeoJSON for Leaflet. I understand, that if I used the standard APIs of Leaflet I could add styles and build interactive choropleth maps. However I thought it could be possible to use the styles defined with ThinkGeo at the server and convert them to Leaflet styles.

Is that possible?

If it’s possible with OpenLayers (or with the MVC edition) that would be fine, too.

Maybe a strange workaround: but I could also imagine to render all shapes on the server (with ThinkGeo styling) and return the GeoJSON for leaflet, which renders it transparent only. Sort of an HTML map. Maybe a known best practice?

Hi Andreas,

Our web edition and mvc edition should support the feature you mentioned like when hovering a shape, highlight it.

But the feature is supported by client side library.

So if you are using WebAPI Edition, you should want to implement that by your custom code, our server side only return the shapes you need, but for the special feature, you should research the client side library for support.

Our WebAPI mainly provide GIS features, it have more agile, and need more custom code at the same time.

For example you can return tile images from server side, or you can get the features included by target extent and return them and styling them by your styles.

Regards,

Don

How is the interactive overlay (it’s in the main sample also) implemented in the MVC edition? From DOM inspector it looks like OpenLayers is used internally. Are ThinkGeo server-side styles converted to OpenLayer-styles or is this a custom ThinkGeo javascript implementation?

Hi Andreas,

I think if we need render the shape by the Openlayers, it should had been converted to Openlayers object, I think the server side should sent the objects back by JSON.

Our web & MVC edition is extent by OpenLayers, we write many custom JS code. But most Openlayers APIs should works well.

Regards,

Don