vrijdag 18 juni 2010

Custom Renderer in OpenLayers

For a new project for the Dutch government (the project is run by Geonovum) we are creating a viewer based on OpenLayers. The project is called GEOZET and it is an abbreviation in Dutch. In English it means something like "geographical view and search engine". We in the above sentence is a team of developers in Java, Javascript and HTML/CSS. I am focussing on the javascript part together with someone else.

The requirements are quite tough, and they deal a lot with accessibility.

So using the keyboard people must be able to step through the features in the map, which kind of rules out the standard renderers available in OpenLayers. That's why I ended up creating my own renderer which creates anchors, with a lot of help from Maarten van Oudenniel (the HTML/CSS guru in the project team) who came up with the actual HTML structure which I have to render and the corresponding CSS. The structure differs for normal features and for clustered features since for clusters there is a label with the amout of subfeatures in the cluster.

Maarten also came up with a good way to print such a map using normal browser print, the features in the map will become white squares with a number, and below the map a list will be shown with the actual information from the features. Something I had never thought about doing. Downside is that next to the feature structure in the map, we also have to keep an unordered list synchronized which will only be shown when printing. But this is because no separate print button is allowed in the application.

In a future post I'll tell you more about the internals of the renderer.

Geen opmerkingen:

Een reactie posten