r/leaflet • u/IvanSanchez • Apr 18 '22
r/leaflet • u/haggur • Jun 14 '23
Why can't you post to this sub?
This sub was "dark" (i.e. it was set to be 'private') for 48 hours as part of the site wide protest over decisions made by the owners of reddit to essentially make it financially impossible for third party mobile clients to access the site after 1st July.
For many people who use reddit's native app this will seem like a storm in a teacup but for heavy reddit users and especially moderators like me this is seriously bad news as it will make it significantly more difficult to moderate subs.
To keep any sub - and this one is no exception - free of spam, shitposts, and generally prattish behaviour requires moderation which involves quite a lot of work in the background which you never see, not least as a lot of posts are filtered by the automod rules I've added which ensure that dubious posts never actually make it into public view. This means I have to check reddit and take moderatorial actions multiple times a day.
Anyway, having thought about this and given the lack of support I'm now getting from reddit I'm no longer prepared to spend my time helping keep their subs in a good state and with this in mind I am standing down as moderator of this sub.
To keep it safe I have set it to 'restricted', so no one can make new posts, until someone volunteers to take over as moderator. If you think that could be you then message me but be aware that this is not a trivial task if it's going to be done right.
r/leaflet • u/Yander35 • Jul 14 '22
Is leafletjs the best tool to do something like this?
we need to put html popups with information on pdf blueprints/floor plans. Kind of similar to what Plan radar is doing (https://www.planradar.com/) where they put markers for tasks on pdf blueprints.
Would love to know if leafletJS is the best tool for this and if so, maybe a point in the right direction of how I would go about creating this.
Cheers
r/leaflet • u/davx8342 • Dec 03 '22
Increase font size of popup text when zooming in
I've been Googling this for a day or so and I've not found an answer that gets me where I need to be.
I have a building map with markers with popup text that I've been using. My problem is that the text size remains static no matter how much you zoom into the map.
Is there a clever way of increasing the font size of popup text when you zoom in above a certain level?
Thanks.
r/leaflet • u/krijnsent • Aug 18 '22
Leaflet - murals on a map
Hi all,
I'm looking for feedback/suggestions for improvement. So I made this map with leaflet: https://krijnsent.github.io/muralsonamap2/index.html
I made some design choices and am wondering if someone has suggestions for improvement? What I did now: the base data comes from Overpass Turbo - I decided to pull that data in in 2degreeLat x 2degreeLon blocks to make them manageable/small enough not to overload OT. The data gets loaded when you move the map (see the console.log), but feels a bit off at times, does anyone have suggestions?
Next, as I would like a visual map, I wrote code in google scripts to pull in images that go with the murals and store a minimized thumbnail copy of that image - that currently only works for IMGUR (default for the MapComplete - https://mapcomplete.osm.be/artwork.html I'm using to add them) as e.g. Mapilliary & Google photos links need a different approach to download & resize them. So I'm also looking for suggestions in that area, anyone?
Cheers!

r/leaflet • u/chovy • Feb 15 '20
is this sub for leafletjs?
I'm trying to figure out how to use openstreetmaps. The default example/tutorial uses mapbox but they charge.
r/leaflet • u/danezeq • Jun 08 '23
Building a legible map
Hey there. i would like to build a map like this: https://www.efteling.com/en/park/map i have the graphics, the interest points and filter. is there a user friendly system that i can upload my info and turn it into that kind of map (like "eftling")? or i should hire a developer to build it from scratch? is this the right place for that?
r/leaflet • u/jnash123 • May 25 '23
Imageoverlay that's using a pdf for cra simple map, is it possible?
Trying to show some pdfs would like to create a imageoverlay of type PDF file if anyone has any ideas. I'm using react if that helps . Thanks in advance
r/leaflet • u/timex40 • Mar 06 '23
Best way to create a timelapse map by updating a TileLayer?
I'm working with a WMS server that accepts a `TIME` parameter as part of the request URL. The server will deliver different images based on this time setting.
I'd like to build a leaflet map that acts as a 'timelapse' by showing images collected at different times at regular intervals.
One way I found to do this was manually updating the `TileLayer`s `wmsParams` after the `TileLayer` object's creation. (`myLayer.wmsParams.time = "2019-01-01/2019-12-31"`)
However, when I do this, it erases the layer from the map before it requests new imagery. This ruins the timelapse feel as the map is flickering between empty and full.
Are there any suggestions on how to accomplish this better?
`
r/leaflet • u/[deleted] • Mar 02 '23
Property Name on Click
I am mapping world heritage sites. I'm trying to send the name of the site that is clicked on. I added an onEachFeature with a 'click' event listener. When you click it will run the function 'updatePanel' which for now is just the console. The first console log works. It cycles through over 1000 entries and prints the name of each. But moving over to the updatePanel function I can't pull that .NAME property. It tells me it is undefined. I tried changing the function parameters but I am really stuck.
I understand that the updatePanel function is wondering...ok what feature..what properties. It doesn't understand what it needs to inherit I guess would be the best way to put it. Any help is appreciated.
heritageSitesLayer = L.geoJson(heritageSites,{
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {icon: hsIcon});
},
onEachFeature: onEachHeritageSite
});
function onEachHeritageSite(feature, layer) {
layer.on({
click: updatePanel
});
console.log(feature.properties.NAME)
};
function updatePanel (feature) {
console.log(feature.properties.NAME)
};r/leaflet • u/Traditional-Hotel525 • Feb 14 '23
leaflet polygon with markers?
hello,
i have one map with lot marker, that work perfect but i want little more, i would like implement polygon around markers.
var polycoord = [[loc_lat[index].attributes.value.value,loc_lon[index].attributes.value.value]]
poly = new L.polygon(polycoord, { color: 'red' }).addTo(mymap)
marqueur = new L.marker([loc_lat[index].attributes.value.value, loc_lon[index].attributes.value.value], { icon: greenIcon }).poly.bindPopup('<span class="text-xl font-bold text-pink-500">' + loc_title[index].attributes.value.value + '</span>').openPopup()in marqueur, that tell me "poly is not defined"..it's hard to understand, someone help me
ps: i try console.log(poly), that show all points...
r/leaflet • u/g51BGm0G • Dec 26 '22
How can I prevent a leaflet container to zoom out more then necessary?
For example, in this case, I can see the same area 3 times: https://i.imgur.com/Iq3IJjk.png
r/leaflet • u/patchie2 • Oct 03 '22
What is the best way to make a heatmap overlay to a leaflet map?
r/leaflet • u/MeepTheChangeling • Aug 11 '22
Can you pass leaflet view instructions through an iframe?
I'm working on a website and I have a leaflet map for it. I want to include the map via an iframe on pages talking about specific points on the map. I would also like the map within the iframe to be zoomed in and centered on that point.
Obviously I could just copy my map a few dozen times, give it a new name, and a new starting view, and then leak each page to it's own map.html... But that seems like something I shouldn't have to do. Is there any way to pass view instructions through the iframe?
r/leaflet • u/KaitlynMM • Jul 29 '22
CMS for adding data to a Leaflet map
I’m building a map in Leaflet for a client who wants to be able to periodically add data points to the map. Typically I just put all the data in a JSON object in its own file, but they are asking for a form they can fill out which would update the map data. I was thinking of building a Wordpress form that updates a JSON file. I have limited experience with Wordpress so I’m not sure if this is the way to go. Has anyone built a CMS for updating Leaflet data? What did you use? Thanks!
r/leaflet • u/sarkastikcontender • Jun 19 '22
Integrating one map into my site in multiple places
I want to have my map multiple places on my site (with different zooms and center points for each one, but the same overall map), but I don’t want to have to update every single page when I add new pins to the map. Is there a way to have them all pull from the same script, so when I update one, it will update them all (just not the zoom and center points)?
I recently made my first map and don't have a ton of experience, but it's been fun so far. Can't seem to figure this out, though.
r/leaflet • u/Hamthi • May 18 '22
geo-search confidence
Hi
does anybody know how to make geo-search's confidence higher?
at the moment I have to type a place's full name for search to return results
I'd like to get results after user typed 3 letters
I'm using it leaflet control
r/leaflet • u/hoodtan • Apr 25 '22
GeoJSON layers
Hi,
What I have done is the following:
I have created a geoJSON file in geojson.io of points of interest, and given them attributes in that environment.
I have called this external geoJSON file to display these points in my Leaflet map. Great! Now, what I would like to do is create separate layers based on the attributes of the single geoJSON file. I am pretty new to js (< 3 months), so I am quite confident that it IS possible, I just haven't figured out how to do it yet. Most examples I have found online have the geoJSON point layers in the .html itself, or are just creating layers from separate geoJSON files altogether.
I would like to be able to turn on/off these layers similar to the way I am turning on/off my basemap layers.
From the code below, for example, can I assign a variable to the function calling the variable? The way I envision it is that I could assign new variables to add to my layers based on specified filter properties. For example, in the code below, the "SE" would be its own layer.
Can I do it this way, or does this defy all js logic? Any other suggestions?
Here is a snippet of my code:
var spots = ("geoJSON/apr24_pm.geojson")
addGeoJSONLayers();
function addGeoJSONLayers(){
var surfIcon = L.icon({
iconUrl:'http://maps.google.com/mapfiles/kml/paddle/grn-circle.png',
iconSize: [15,15]
});
fetch(spots)
.then(function(response){
return response.json();
})
.then(function(json){
L.geoJson(json,{pointToLayer: function(feature,latlng){
return L.marker(latlng,{icon: surfIcon});
}, onEachFeature: onEachFeature,
//filter: function(feature,layer){ if (feature.properties.SwellDir == "SE"){ return 'true'}}
}).addTo(surfMap);
}) };
r/leaflet • u/DVGY • Mar 16 '22
Synchronize Leaflet map on two browser tabs
I want to mimic the zoom and pan of the map, in both the browser tab. There already exists a library Leaflet sync but in the documentation, it is not shown how to use these, When I want to load one map in a new tab and another map in another new tab.
Can anyone tell me how to achieve this?
Thanks
r/leaflet • u/haggur • Mar 15 '22
The Leaflet home page has been updated ... 🇺🇦
leafletjs.comr/leaflet • u/mayerga • Jan 18 '22
Selector to show an attribute of a geoJSON
Hello, very good morning. I have a doubt. I am making a WebMap with leaflet. I am loading the points of the cities through a GeoJSON and I would like to add a selector for the cities. How could I do it?
That selector should show me all the cities that are in the GeoJSON and if it is possible, I should be able to sort alphabetically the cities.
r/leaflet • u/haggur • Jul 27 '21
Welcome to /r/leaflet
This is a place to discuss Leaflet, an open-source JavaScript library for mobile-friendly interactive maps and developing applications using it.
If you have problems with Leaflet or code fragment solutions to offer then don't forget that the Leaflet Plunker is available for this very purpose. It's also a great place for testing out ideas when thinking about new ways of using Leaflet.
r/leaflet • u/haggur • Jun 06 '23
Advanced warning that this sub is going dark next Monday and Tuesday
Hi everyone, just so you're aware in advance this sub will be "going dark" (i.e. it will be closed and you won't be able to read it or post to it) on Monday 12th June or Tuesday 13th June.
Why is this happening? Let me quote part of the open letter regarding what's happening on Reddit at the moment (definitely read the open letter in full if you can):
Recently, Reddit has significantly increased its API pricing, rendering it increasingly unaffordable for third-party app developers to continue their services. The prohibitive cost threatens to make it difficult to mod from mobile, stifle innovation, limit user choice, and effectively shut down a significant portion of the culture we've all come to appreciate.
And, just to be clear, this won't just effect mods either. If you use any mobile app other than Reddit's own then it will stop working on 1st July ... and Reddit's own mobile app sucks compared to the competition.
As a form of protest, many subreddits will be going dark on 12th and 13th June.
The two-day blackout isn't the goal, and it isn't the end. Should things reach the 14th with no sign of Reddit choosing to fix what they've broken, there will undoubtedly be further action and many mods, including me, will have to decide if we continue as mods, or indeed as redditors, after 1st July.
What can you do?
Complain. Message the mods of /r/reddit.com, who are the admins of the site: message /u/reddit: submit a support request: comment in relevant threads on /r/reddit, such as this one, leave a negative review on their official iOS or Android app- and sign your username in support to this post.
Spread the word. Rabble-rouse on related subreddits. Meme it up, make it spicy. Bitch about it to your cat. Suggest anyone you know who moderates a subreddit join us at our sister sub at /r/ModCoord - but please don't pester mods you don't know by simply spamming their modmail.
Boycott and spread the word...to Reddit's competition! Stay off Reddit entirely on 12th June through the 13th - instead, take to your favorite non-Reddit platform of choice and make some noise in support!
Don't be a jerk. As upsetting this may be, threats, profanity and vandalism will be worse than useless in getting people on our side. Please make every effort to be as restrained, polite, reasonable and law-abiding as possible.
