Example app leveraging two libraries, a modified version of leaflet-canvas-geojson and a modified version of Leaflet-Fullcanvas to render geojson featureCollections as HTML5 canvas elements.
npm install -g bower
bower install
- Add sample data to the root and reference it in
map.js
-->layer_config
object - Run a local sever to make ajax request for geojson and point localhost to the index.html file
createNonPointLayers
uses leaflet-canvas-geojson's.renderer = function()
. If no customized rendering takes place, it'll use the libraries default styles.- Custom functions exists for both polygons and line strings/polylines
createPointLayers
uses thedrawSource: function()
method for style customizations in Leaflet-Fullcanvas
Like the style customizations, click events can be customized to show the feature attributes.
createNonPointLayers
uses theonClick: function()
methodcreatePointLayers
uses theclickedPoints: function()
method
- Both point and non-point layers can be extended with a filter method
filter: function(features) {
- Example includes a basic filter function (one should probably create their own)
- A z-index higher than 5 for the point canvas layer is needed
.leaflet-tile-pane.points { z-index: 6; }