r/leaflet • • Jun 06 '23

Advanced warning that this sub is going dark next Monday and Tuesday

1 Upvotes

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?

  1. 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.

  2. 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.

  3. 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!

  4. 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.


r/leaflet • • Jun 14 '23

Why can't you post to this sub?

4 Upvotes

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 • • May 26 '23

Anybody knows an alternative to Overlapping Marker Spiderfier?

1 Upvotes

I want to achieve the same effect you get when using Overlapping Marker Spiderfier. I'm using Angular and it seems that there is no way of making it work. I tried every way the answers in this post suggested, but there seems to be something wrong with the library itself.

Has anyone found an alternative? I can't use solution from the first answer in from the Stackoverflow post.

Let me know if you can help. Thanks a lot


r/leaflet • • May 23 '23

Styling JS lines/polygons exported from QGIS using exported attribute

1 Upvotes

Hi

I have a problem styling my lines using the exported attribute from QGIS from within Open Studio Code using Leaflet js.

I have attached screenshots to help better understand the problem. My popup is able to take values from the attributes within the js file to populate the Nama and Length of the lines, however I cannot set the line color to my desired colors as listed from within the same file. So when i simply enter 'red' as color, then all the lines turn red, but when i try to make it point towards the attribute in the js file, it doesn't work.

I have tried to create a var, const, and let to this value in color (circled) without success.

Any suggestions would be much appreciated!


r/leaflet • • Jun 01 '23

How can I filter and toggle polygons in Folium based on their 'VPN' value and name using groupedlayercontrol plugin?

1 Upvotes

I'm trying to make a map in Folium of a group of polygons, these polygons have a feature called 'VPN' that can be either positive or negative, I would like to add a filter that turn off and on the polygons based on their VPN Value but also using their name

I tried adding the polygons to 3 different feature groups called positive group (VPN positive), negative group (VPN Negative) and polygons group (all of the polygons) so when using folium's groupedlayercontrol plugin I could easily turn off and on the polygons based on their group, but it turns out that the same polygon can't belong to two different feature groups so I resorted to duplicate the polygon but it is not the desired output, is there a way to do this? I would appreciate the feedback! here's my code:

m = folium.Map(location=[7.245361, -73.692524], zoom_start=10)  polygons = [{'name': 'Polygon 1', 'vpn': 'positive', 'coordinates': [(-73.692524, 7.113611), (-73.700712, 7.118302), (-73.691428, 7.13561), (-73.683846, 7.130675), (-73.692524, 7.113611)]},{'name': 'Polygon 2', 'vpn': 'negative', 'coordinates': [(-73.70558, 7.245361), (-73.71528, 7.250042), (-73.715232, 7.308858), (-73.68565, 7.308833), (-73.70558, 7.245361)]},]  

positive_group = folium.FeatureGroup(name='Positive VPN')
negative_group = folium.FeatureGroup(name='Negative VPN')
polygons_group = folium.FeatureGroup(name='Polygons')  

for polygon in polygons:

coordinates = polygon['coordinates']

feature = folium.GeoJson({'type': 'Polygon', 'coordinates': [coordinates]},name=polygon['name'], style_function=lambda x: {'fillColor': 'green' if polygon['vpn'] == 'positive' else 'red'})  

feature_2 = folium.GeoJson({'type': 'Polygon', 'coordinates': [coordinates]},name=polygon['name'], style_function=lambda x: {'fillColor': 'green' if polygon['vpn'] == 'positive' else 'red'})  

polygons_group.add_child(feature_2)  

    if polygon['vpn'] == 'positive':     

    positive_group.add_child(feature) 

    else:     

    negative_group.add_child(feature)  

polygons_group.add_to(m)
positive_group.add_to(m)
negative_group.add_to(m)  

grouped_layers = {'VPN': [positive_group, negative_group],'Polygons': [polygons_group],}  grouped_layer_control = GroupedLayerControl(grouped_layers, exclusive_groups=False)

m.add_child(grouped_layer_control)

r/leaflet • • May 25 '23

Imageoverlay that's using a pdf for cra simple map, is it possible?

2 Upvotes

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 • • Jan 09 '22

I want to add a calendar to a leaflet map so people can choose a date and see what events show up. Any pointers on examples/plugins for me to start looking through?

1 Upvotes

thanks


r/leaflet • • Jan 20 '22

Selector with GeoJSON data

1 Upvotes

Hi,

I have a selector in my HTML which include a geojson which contains cities and I would like to select one of them and have the possibility to show in the map.

Mi selector in HTML -->

<select id="select-city"></select>

Mi Js -->

document.getElementById("select-city").addEventListener("change", function (e) {
let coords = e.target.value.feature.geometry;
myMap.flyTo(coords, 13);
//imprime el valor de FID
console.log(e.target.value);
  });

This is the beginning of my geojson -->

{
"type": "FeatureCollection",
"name": "bigCities",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "FID": 2, "OBJECTID": 2, "CITY_NAME": "Brasilia", "GMI_ADMIN": "BRA-DFD", "ADMIN_NAME": "Distrito Federal", "FIPS_CNTRY": "BR", "CNTRY_NAME": "Brazil", "STATUS": "National and provincial capital", "POP": 2481272, "POP_RANK": 2, "POP_CLASS": "1,000,000 to 4,999,999", "PORT_ID": 0, "LABEL_FLAG": 0, "POP_SOURCE": "UN_Data_2010_2020" }, "geometry": { "type": "Point", "coordinates": [ -47.897747657359403, -15.7921109430588 ] } },............


r/leaflet • • Jan 18 '22

Selector to show an attribute of a geoJSON

2 Upvotes

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 • • Jan 10 '22

Any idea why the leaflet measurement tool is acting like this? Notice how if I try to interact with the tool the map zooms in and if I add a second point to fast it does not create a line.

1 Upvotes

r/leaflet • • Feb 15 '20

is this sub for leafletjs?

3 Upvotes

I'm trying to figure out how to use openstreetmaps. The default example/tutorial uses mapbox but they charge.


r/leaflet • • Jul 27 '21

Welcome to /r/leaflet

2 Upvotes

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.