umap-project / leaflet.measurable Goto Github PK
View Code? Open in Web Editor NEWMeasure control for Leaflet made with Leaflet.Editable
Measure control for Leaflet made with Leaflet.Editable
Firstly, I add some strings to my project:
<meta charset="utf-8"/>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v1.0.0-beta.2/leaflet.css" />
<link rel="stylesheet" type="text/css" href="Leaflet.Measurable.css">
<script src="http://cdn.leafletjs.com/leaflet/v1.0.0-beta.2/leaflet.js"></script>
<script src="http://code.jquery.com/jquery-1.11.0.js"></script>
<script src="Leaflet.Editable.js"></script>
<script src="Leaflet.Measurable.js"></script>
<style type="text/css">
.body {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
color: #333;
background-color: #fff
}
#map { height: 100%;
width:100%;
position: absolute;
z-index: 100;
padding: 0px;
left:0;
top: 0
}
</style>
As I understand measure Control need Leaflet.Editable.js
Secondly, I add map
var map = L.map('map').setView([60,30], 8);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
Using my previouse expearence adding control looks like this:
map.addControl(new L.MeasureControl());
But there is nothing happened. There was no errors. It looks like browser dont know what to do with this plugin: "Ok, I see your plugin, but I do not got your idea, what you want from me".
Also I didn't find any hints of adding control like this
var map = new L.Map('map', {
MeasureControl: true,
MeasureControl.options: {
position: 'topright'
}
});
or
var Map = L.map('map', options);
var measureControl = L.Control.Measure(options);
measureControl.addTo(Map);
So, how to add this plugin to map?
Thank you in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.