datamaps is also delivered as a jQuery/Zepto plugin, as shown in this example (in addition to a Backbone view).
datamaps will add datamap
to an existing version of jQuery if it's on the page. Otherwise, if there is no jQuery/Zepto, it will add a global copy of Zepto for you to use.
Add a container div to the page and select with jQuery/Zepto and call the datamap
function. Pass customization options to datamap
.
This example shows a custom popup function (any JS templating language that compiles to a function like _.templates and handlebars).
The custom template has two model objects