LoginSignup
2
2

More than 3 years have passed since last update.

leafletを鍛える。

Last updated at Posted at 2018-09-13

概要

googlemapは、出禁なので、leafletを鍛えてみた。
クリックをやってみた。

写真

image

サンプルコード

var map = L.map('map').setView([37.9, 140.1], 13);
mapLink = '<a href="http://openstreetmap.org">OpenStreetMap</a>';
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '&copy; ' + mapLink + ' Contributors',
    maxZoom: 18,
}).addTo(map);
map.options.singleClickTimeout = 250;
map.on('singleclick', function(e) {
    L.popup().setLatLng(e.latlng).setContent('map singleclick at ' + e.latlng).openOn(map);
});

成果物

以上。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2