New mojolicious plugin: leaflet.js

Started working on a new Mojolicious plugin for integrating the popular javascript mapping library leaflet.js. You can find it on metacpan or help with contributions at the github project page.

A quick synopsis of how to use it:

# Mojolicious
$self->plugin('Leafletjs');

# Mojolicious::Lite
plugin 'Leafletjs';

# In your template
<%= leaflet {
  name      => 'map1',
  latitude => '35.9239',
  longitude  => '-78.4611',
  zoomLevel => 18,
  markers   => [
    {   name      => 'marker1',
        latitude => '35.9239',
        longitude  => '-78.4611',
        popup     => 'A new message tada!',
    },
    {   name      => 'marker2',
        latitude => '35.9235',
        longitude  => '-78.4610',
        popup     => 'A second popup here!',
    }
  ],
}
%>

An example of a Mojolicious Lite application can be found in the examples directory on github

Creative Commons License
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

You may also like...