Comments (4)
Hi, first of all, I don't know how to active the measuring tool in your site and looking at the code behind it seems as that library is not there, is it there?
I have not tested with mapbox. could you point out what the problem you get is!
from leaflet.editablehandlers.
Hi odelphia
Sorry the delay, I had a sick daughter for a few days.
The link you mention here does not exist, I get an error page when it is
being loaded (Error 404 - Not Found).
Looking at your code, nothing seems strange, but it is hard to tell when I
can't test it or get an error name/message.
Maybe could you try testing the measuring tool with only one layer and see
if that works. At least that way we can figure out if the problem is the
two layers.
Let me know how it goes
On Thu, Nov 6, 2014 at 5:49 PM, odelphia [email protected] wrote:
hi keyjote - thank you for the feedback.
Yes, the js and css are all loaded. see this please:
http://erichsen-group.com/demoland/taylorpeterh/index19.htmlThe problem is that the layer toggling does not work. Code snippet below.
You will see I am calling at least 2 mapbox json layers as overlay on the
bottom.
var cloudmadeUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png',cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
var main = new L.Map('map', {layers: [cloudmade], center: new L.LatLng(54,
-0.3), zoom: 6});var measuringTool;
var optionsMeasureLabel = {
minWidth: 50,
autoPan: false,
closeButton: false,
className: 'measuring-label'
};
$('#measuring-tool').click(function() {
if ($(this).hasClass('active')) {
$(this).removeClass('active');
if (measuringTool) {
measuringTool.disable();
}
} else {
// only 1 option can be active
$('.btn.btn-primary.active').click();
$(this).addClass('active');
if (!measuringTool) {
measuringTool = new L.MeasuringTool(main);
}
measuringTool.enable();
}
});main.layers({ 1: { api: 'http://a.tiles.mapbox.com/v3/inosys.1cpsycqc.jsonp', center: { ease: 1000 } }, 2: { api: 'http://a.tiles.mapbox.com/v3/mapster88.1.jsonp', center: { ease: 1000 } },
—
Reply to this email directly or view it on GitHub
#10 (comment)
.
Daniel
from leaflet.editablehandlers.
Thank you. I got it working. I was applying both js calls for mapbox and leaflet. Thanks again for providing the tool – its very nice!
C
From: keyjote [mailto:[email protected]]
Sent: Tuesday, November 11, 2014 11:13 AM
To: kartena/Leaflet.EditableHandlers
Cc: odelphia
Subject: Re: [Leaflet.EditableHandlers] Measuring tool not functioning (#10)
Hi odelphia
Sorry the delay, I had a sick daughter for a few days.
The link you mention here does not exist, I get an error page when it is
being loaded (Error 404 - Not Found).
Looking at your code, nothing seems strange, but it is hard to tell when I
can't test it or get an error name/message.
Maybe could you try testing the measuring tool with only one layer and see
if that works. At least that way we can figure out if the problem is the
two layers.
Let me know how it goes
On Thu, Nov 6, 2014 at 5:49 PM, odelphia [email protected] wrote:
hi keyjote - thank you for the feedback.
Yes, the js and css are all loaded. see this please:
http://erichsen-group.com/demoland/taylorpeterh/index19.htmlThe problem is that the layer toggling does not work. Code snippet below.
You will see I am calling at least 2 mapbox json layers as overlay on the
bottom.
var cloudmadeUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png',cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
var main = new L.Map('map', {layers: [cloudmade], center: new L.LatLng(54,
-0.3), zoom: 6});var measuringTool;
var optionsMeasureLabel = {
minWidth: 50,
autoPan: false,
closeButton: false,
className: 'measuring-label'
};
$('#measuring-tool').click(function() {
if ($(this).hasClass('active')) {
$(this).removeClass('active');
if (measuringTool) {
measuringTool.disable();
}
} else {
// only 1 option can be active
$('.btn.btn-primary.active').click();
$(this).addClass('active');
if (!measuringTool) {
measuringTool = new L.MeasuringTool(main);
}
measuringTool.enable();
}
});main.layers({
1: { api: 'http://a.tiles.mapbox.com/v3/inosys.1cpsycqc.jsonp',
center: { ease: 1000 }
},2: {
api: 'http://a.tiles.mapbox.com/v3/mapster88.1.jsonp',
center: { ease: 1000 }
},—
Reply to this email directly or view it on GitHub
#10 (comment)
.
Daniel
—
Reply to this email directly or view it on GitHub #10 (comment) . https://github.com/notifications/beacon/ABPzsK0Ib7pTqUYDVr3zdA6PmnhbHqmUks5nMlcngaJpZM4C3g09.gif
from leaflet.editablehandlers.
glad you got it working
have a good one
from leaflet.editablehandlers.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leaflet.editablehandlers.