javalent / obsidian-leaflet

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

3.21.2: Overlays transparency loss #182

Closed Moonbase59 closed 3 years ago

Moonbase59 commented 3 years ago

With 3.21.2, my (previously working) maps suddenly show much less transparency on the overlays:

Auswahl_076

The maps have:

overlayColor: 'rgba(218, 165, 32, .6)'
valentine195 commented 3 years ago

Can you check if there are actually multiple overlays there?

Edit: in the dev console

Moonbase59 commented 3 years ago

Somehow looks like. I clicked the top one in the lower map, and the marked plus the "light blue" one (where the cursor is) seem dups:

1_077

valentine195 commented 3 years ago

Are these markers created on the map or via the code block?

Moonbase59 commented 3 years ago

All via other notes, wait, I’ll copy the codeblock for you:

## Nearby

People, locations and events within `=[[-Current Location]].nearby` around location `=[[-Current Location]].location` (`=[[-Current Location]].address`).

```leaflet
id: Main Map
markerFolder: People
markerFolder: Locations
markerFolder: Events
#markerFolder: -Inbox
height: 500px
lat: 48.23875
long: 10.37595
minZoom: 1
maxZoom: 18
defaultZoom: 12
unit: km
distanceMultiplier: 1.3
overlayTag: nearby
overlayColor: 'rgba(218, 165, 32, .6)'
coordinates: [[-Current Location]]
zoomTag: nearby
zoomDelta: 1
geojson:
  #- [[geo-bayern.geojson]]
  - [[geo-bayern-landkreise.geojson]]
  #- [[geo-lk-günzburg.geojson]]
  - [[Kneipp-Rundweg Krumbach.geojson]]
  - [[Lehrpfad Krumbach.geojson]]
  - [[Walderlebnispfad Krumbach.geojson]]
  - [[Gewässer-Informations-Erlebnis-Pfad Münsterhausen.geojson]]
  - [[Krumbach Oberes Gemeindeholz & Weiher.geojson]]
  - [[Krumbach Oberes Gemeindeholz.geojson]]
  - [[Kleine Runde Kellerweg.geojson]]
#linksTo: [[note]] #markers from all notes linking TO this note
#linksFrom: [[note]] #markers from all notes linking FROM this note
#verbose: true
valentine195 commented 3 years ago

Just to make sure, can you look in your data.json file and see if there are any overlays associated with that map id?

Moonbase59 commented 3 years ago

data.json.zip sent. Contains lots of multiple entries.

valentine195 commented 3 years ago

Fixed in 3.21.3

Duplicated overlays should automatically be removed (one will remain, though - will have to manually clear it if that is not desirable)

Moonbase59 commented 3 years ago

So I started out with a "Main Map" in data.json that had (manually) the overlays array emptied.

Map worked fine, removed the complete "Main Map" entry.

Added a mutable marker, map shows up correctly in data.json.

Removed that, complete map entry vanishes from data.json.

All good, thanks!