javalent / obsidian-leaflet

Adds interactive maps to Obsidian.md using Leaflet.js
481 stars 29 forks source link

[Bug]: Former gpx map disappeared #378

Closed erex closed 1 year ago

erex commented 1 year ago

The bug tracker is ONLY used for reporting bugs.

Version Check

Windows: 10 Obsidian installer version: 1.1.15 Obsidian version: 1.2.6

Plugin version: 5.5.7

What is the expected behavior?

Map containing traces of gpx files in Scotland

What is the current behavior?

This (partial) code block image produces this result image

What are the A-to-Z Steps to Reproduce your Bug?

Full code block below

id: anything
tileServer: https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
osmLayer: false
height: 1200px
defaultZoom: 7
maxZoom: 18
unit: meters
lat: 56
long: -3
gpxColor: #338855
gpx: 
  - [[dufftown.gpx]]
  - [[01-MAY-21.gpx]]
  - [[15-MAY-21.gpx]]
  - [[16-MAY-21.gpx]]
  - [[17-MAY-21.gpx]]
  - [[18-MAY-21.gpx]]
  - [[29-MAY-21.gpx]]
  - [[01-JUN-21.gpx]]
  - [[05-JUN-21.gpx]]
  - [[12-JUN-21.gpx]]
  - [[15-JUN-21.gpx]]
  - [[16-JUN-21.gpx]]
  - [[17-JUN-21.gpx]]
  - [[10-JUL-21.gpx]]
  - [[11-JUL-20.gpx]]
  - [[18-AUG-20.gpx]]
  - [[19-AUG-20.gpx]]
  - [[30-AUG-20.gpx]]
  - [[07-SEP-19.gpx]]
  - [[08-SEP-19.gpx]]
  - [[07-DEC-19.gpx]]
  - [[Track_04-SEP-18 031305 PM.gpx]]
  - [[Track_06-SEP-18 124659 PM.gpx]]
  - [[Track_07-SEP-18 024604 PM.gpx]]
  - [[Track_08-JUL-18 125328 PM 2.gpx]]
  - [[Track_10-JUN-18 012641 PM.gpx]]
  - [[Track_14-APR-18 123709 PM.gpx]]   
  - [[Track_14-APR-19 015422 PM.gpx]] 
  - [[Track_14-MAR-20 103108 AM.gpx]]
  - [[Track_15-AUG-18 030021 PM.gpx]]
  - [[Track_15-JUN-19 035440 PM.gpx]]
  - [[Track_15-MAR-20 125727 PM.gpx]]
  - [[Track_16-MAR-20 110641 AM.gpx]]
  - [[Track_17-MAY-19 020101 PM.gpx]]
  - [[Track_19-JAN-19 040027 PM.gpx]]
  - [[Track_19-MAY-19 020951 PM.gpx]]
  - [[Track_22-APR-19 035124 PM.gpx]]
  - [[Track_22-JUN-19 041851 PM.gpx]]
  - [[Track_23-JUN-18 030934 PM.gpx]]
  - [[Track_28-APR-19 011501 PM.gpx]]
  - [[Track_28-JUL-19 024913 PM.gpx]]
  - [[SATURD-19.gpx]]
  - [[MONDAY-19.gpx]]
  - [[TUESDAY-19.gpx]]
  - [[THURSD-19.gpx]]  
  - [[Track_01-DEC-18 123304.gpx]]
  - [[Track_04-JAN-19 122939 PM.gpx]]
  - [[Track_01-AUG-20 021753 PM.gpx]]
  - [[Track_25-DEC-19 120617 PM.gpx]]
  - [[Track_18-JUL-20 121018 PM.gpx]]
  - [[Track_17-AUG-20 034742 PM.gpx]]
  - [[Track_27-MAR-21 010539 PM.gpx]]
  - [[Track_03-APR-21 034457 PM.gpx]]
  - [[Track_25-APR-21 122453 PM 1.gpx]]
  - [[170722 Blairgowrie & Castle Glasclune.gpx]]
  - [[carnethy hill pentlands.gpx]]
  - [[Track_07-APR-18 124749 PM.gpx]]
  - [[Track_07-JUL-13 011629 PM.gpx]]
  - [[Track_10-JAN-18 030629 PM.gpx]]
  - [[Track_12-JAN-18 125519 PM.gpx]]
  - [[Track_17-FEB-19 122630 PM.gpx]]
  - [[Track_17-MAY-18 034109 PM.gpx]]
  - [[Track_18-MAY-19 123715 PM.gpx]]
  - [[Track_19-MAY-18 041317 PM.gpx]]
  - [[Track_21-MAY-19 024742 PM.gpx]]
  - [[Track_27-MAR-21 010539 PM.gpx]]
  - [[Track_CHORIE-16 035651 PM.gpx]]
  - [[Track_PERJUL-16 022320 PM.gpx]]
  - [[Track_28-AUG-21 030109 PM.gpx]]
  - [[Track_26-SEP-21 120235 PM.gpx]]
  - [[Track_26-NOV-21 032931 PM.gpx]]
  - [[Track_27-NOV-21 020347 PM.gpx]]
  - [[190627 Priestlaw Hill.gpx]]
  - [[Track_27-APR-22 013430 PM.gpx]]
  - [[Track_08-MAY-22 014130 PM.gpx]]
  - [[Track_15-MAY-22 031528 PM.gpx]]
  - [[Track_16-MAY-22 011545 PM.gpx]]
  - [[Track_17-MAY-22 022035 PM.gpx]]
  - [[Track_18-MAY-22 021548 PM.gpx]]
  - [[Track_04-APR-22 124623 PM.gpx]]
  - [[Track_17-JUN-22 014053 PM.gpx]]
  - [[Track_06-JUL-22 014922 PM.gpx]]
  - [[Track_28-JUL-22 043822 PM.gpx]]
  - [[Track_04-AUG-22 022920 PM.gpx]]
  - [[Track_07-AUG-22 023802 PM.gpx]]
  - [[Track_11-AUG-22 124256 PM.gpx]]
  - [[Track_18-AUG-22 021430 PM.gpx]]
  - [[Track_27-AUG-22 021850 PM.gpx]]
  - [[Track_26-SEP-22 025411 PM.gpx]]
  - [[Track_29-OCT-22 014032 PM.gpx]]
  - [[Track_18-DEC-22 010054 PM.gpx]]
  - [[Track_20-DEC-22 032010 PM.gpx]]
gpxMarkers:
  start: tack

Error Codes

Console content

plugin:obsidian-leaflet-plugin:483 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'contentEl')
    at ra.registerMapEvents (plugin:obsidian-leaflet-plugin:483:2912)
    at ra.postprocessor (plugin:obsidian-leaflet-plugin:483:414)
    at app.js:1:1152244
    at t.postProcess (app.js:1:1219347)
    at t.postProcess (app.js:1:1218175)
    at h (app.js:1:1139989)
    at e.onRender (app.js:1:1140249)

This map has been working fine for >1 year (since the gpx feature was introduced). I have tried to downgrade plugin versions from 5.5.7 back as far as 5.5.2 without success.

Screenshots and Video

Screenshots provided above, showing nothing but a blank hole where the map should exist.

FYI: I am also unable to get the Obsidian map view plugin to work either, after previously working.

valentine195 commented 1 year ago

@erex does this map work if you remove the gpx?

erex commented 1 year ago

I'm afraid the answer is "no" does not display any map, same as before.

valentine195 commented 1 year ago

tileServer: https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png

OSM doesn't allow Obsidian anymore (they restricted the user agent).

You will have to use a different tile server.

erex commented 1 year ago

That's a shame as my use case is tracking hillwalking excursions. I see; that would explain it. I'll find another server.

valentine195 commented 1 year ago

@erex Sorry for not specifying - you can just remove that line. I switched to a different tile map provider.

Edit: remove these two lines:

tileServer: https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png osmLayer: false

erex commented 1 year ago

Thanks for the help, employing your edits my gpx locations are again visible on a map. You can consider the issue closed.

Out of curiousity, might the demise of openstreetmap linkage also be the cause of the failure of the Map View plugin to fail to show search results?

image

I've done a quick search of the Obsidian forum, but see no mention of problems with Map View

erex commented 1 year ago

Hmmm, further digging on the MapView Github site reveals an issue of incompatibility between Leaflet and MapView, discovered last month

https://github.com/esm7/obsidian-map-view/issues/154#issuecomment-1500915565

Following advice from that issue, disabling Leaflet brings MapView back to life.

sigrunixia commented 1 year ago

We'll see if there is anything we can do regarding the issue with Map view, which I started #384 for. In interim, since your issue is resolved, I will close this.