javalent / obsidian-leaflet

Adds interactive maps to Obsidian.md using Leaflet.js
486 stars 30 forks source link

Bug: Open Street Map is blocking requests for tile map #286

Closed HEmile closed 2 years ago

HEmile commented 2 years ago

I haven't tried this in a while, but since today at least I'm not able to load the OSM tile map both in Leaflet and in Map view. I'm getting Access denied. See https://operations.osmfoundation.org/policies/tiles/

See:

image
rossoj85 commented 2 years ago

I just started having the same issue tonight. I incorporated map view into obsidian on my Ipad and desktop. Ipad is still working fine but I am not getting maps on my desktop. I am wondering if it is a block on the plugin's themselves, or on my individual machine.

HEmile commented 2 years ago

Some alternatives for people finding this issue as well. Probably will also work for Leaflet https://github.com/esm7/obsidian-map-view/issues/59#issuecomment-1066789021

valentine195 commented 2 years ago

Yes, they will. I'm debating switching to Stamen's terrain map by default. I'm trying to figure out why Obsidian mobile via Safari gets through but Obsidian Desktop does not. I'm assuming it has something to do with the request headers being sent, but I'm not sure what.

valentine195 commented 2 years ago

It actually looks like OSM has blocked the default user agent sent by Obsidian: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) obsidian/0.13.23 Chrome/91.0.4472.164 Electron/13.6.2 Safari/537.36

Not really a way around that, spoofing it is against the TOS. Guess OSM in Obsidian is dead.

HEmile commented 2 years ago

I see, that's a shame, but it was against the TOS so to be expected at some point. I reposted that info in the map view repo.

I like the Stamen one, although I think the CartoDB tile server is a bit less 'opinionated' or sth?

valentine195 commented 2 years ago

Yes, but Stamen's server does not have usage limits as far as I can tell - just an attribution requirement.

As noted in the issue for Obsidian Map View, CartoDB has a 75k "MapView" limit. I can't find the page now, but I have seen before that CartoDB considers each tile loaded as more than 1 mapview, and thus loading a single tile layer could eat up quite a bit of that quota. Again, though, I can't find that usage page anymore... might not be the case any longer.

You can change the default tile server in Leaflet, anyway. I was picking Stamen because it didn't have those limits.

HEmile commented 2 years ago

As noted in the issue for Obsidian Map View, CartoDB has a 75k "MapView" limit

Yes, per month though:

Limitations: free usage for up to 75,000 mapviews per month, none-commercial services only. For bigger usage and other cases contact CARTO sales for enterprise service key.

https://github.com/CartoDB/basemap-styles

You're probably right that it will drop quickly with intensive use, though.

nigels-com commented 10 months ago

Looks like the Stamen tiles are disappearing soon. https://maps.stamen.com/stadia-partnership/ Screenshot_20231021_151720

My personal workaround is to use a maptiler account for free basemap tiles. https://www.maptiler.com/