Skip to content

cutting-room-floor/metatip-DEAD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metatip

Advanced tooltips for Leaflet.

Styles & content tooltip content is sanitized with sanitize-caja linkified with linky, and formatted into elements of your choice.

Editing interface the edit tab turns property/value combinations into an editable table.

example

gjLayer.on('click', metatip(map).config({
    fields: {
        name: {
            elem: 'h1'
        }
    }
}));

api

metatip(map)

Create a metatip event handler, suitable as a click handler on a Leaflet layer.

metatip.config(configObject)

Configure the metatip handler with field definitions of the form

{
    fieldname: {
        // one of h1, h2, h3, span, p, img, a, pre
        elem: 'elementtype'
    }
}

`metatip.on('event', handler)

In which event is one of del, save, config, and the handler accepts a data object.

technicals

Requires d3js and a recent Leaflet or MapBox.js build.