– Data Ninja 10/1/2016
I wrote HTML5 to give web designers who know HTML/CSS (but not not jquery and javascript) an easy way to create sophisticated leaflet/mapbox streetmaps for their web pages, without writing a single line of javascript code.
The technique used in this script is to leverage jquery’s class selector functionality – e.g. $(‘.myclass’)… – to create custom tags. By eliminating the dot ‘.’ in the class selector search string, jquery grabs any tag with a tag name that matches what is specified in a ‘dot-less’ class selector entry.
For instance, to create the custom tag, this script starts by using the following code – ‘$(“streetmap”)… that finds every instance of the streetmap tag on a web page, reads its attributes – ‘data-…’ – and renders the streetmap accordingly.
Now, with a single javascript declaration at the top of any webpage, streetmaps leveraging leaflet/mapbox advanced features – including markers, heatmaps, markerclusters, polygons and other shapes – can be rendered with straight HTML.
Eliminating the need for programming altogether!
I hope non-programmers and programmers alike find this script useful. Drop me a note if you have any questions.
HTML5 Streetmaps – available NOW at codecanyon.net! Click here!
Data Ninja
my codecanyon portfolio: click here