Get started with leaflet.pm CDN
MIT licensed
Perl module: Leaflet.pm - creates interactive maps using Leaflet library.
Tags:- leaflet
- polygon management
- geometry editing
- map data
- map overlay
- polygon
- geojson
- leaflet-draw
- data-field-geojson
- ui-leaflet-draw
Stable version
Copied!
How to start using leaflet.pm CDN
perl
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Curl;
use JSON;
my $curl = WWW::Curl->new();
my $url = 'https://api.openweathermap.org/data/2.5/weather?q=London&appid=YOUR_API_KEY';
$curl->get($url);
my $response = $curl->content();
my $json = JSON->new()->decode($response);
my $lat = $json->{coord}{lat};
my $lon = $json->{coord}{lon};
use Leaflet::PM qw(:all);
my $map = Map->new(
container => 'mapid',
center => [$lat, $lon],
zoom => 13,
);
my $tile_layer = TileLayer->new(
provider => 'OpenStreetMap',
);
$map->add_layer($tile_layer);
my $marker = Marker->new(
position => [$lat, $lon],
);
$map->add_layer($marker);
$map->fit_bounds([$marker->get_position()]);
$curl->cleanup();
Copied!
Copied!
All versions
0.10.0
0.10.1
0.10.2
0.11.0
0.11.1
0.12.0
0.12.1
0.12.2
0.12.3
0.12.4
0.13.0
0.14.0
0.15.0
0.16.0
0.17.0
0.17.1
0.17.2
0.17.3
0.18.0
0.19.0
0.20.0
0.21.0
0.22.0
0.23.0
0.23.1
0.24.0
0.24.1
0.25.0
0.5.0
0.5.1
0.5.2
0.5.3
0.5.4
0.5.5
0.5.6
0.5.7
0.5.8
0.5.9
0.6.0
0.6.1
0.6.2
0.6.3
0.6.4
0.6.5
0.6.6
0.6.7
0.7.0
0.7.1
0.8.0
0.9.0
0.9.1
1.0.0
1.0.1
1.1.0
1.2.0
1.2.1
1.2.2
2.0.0
2.0.1
2.0.2
2.0.3
2.1.0
2.1.0-beta.11
2.1.0-beta.12
2.1.0-beta.14
2.1.0-beta.7
2.1.0-beta.8
*** 2.2.0