nathan-gs / ha-map-card

A Map Card for Home Assistant
https://community.home-assistant.io/t/map-card-a-slightly-improved-map-card/693088
MIT License
15 stars 4 forks source link

Can't zoom enough #35

Closed vermut closed 1 month ago

vermut commented 1 month ago

Even native HA map allows more zoom. Ideally I'd like to have even more, as I'm tracking lawn mower and what to know precisely where it is on my lawn.

image

nathan-gs commented 1 month ago

That has something to do with the used tile layer, which you can customize. Each tile layer has other limits.

Easiest is to use the carto map HA uses.

vermut commented 1 month ago

As you see I'm on the defaults for both. Or I should enable Carto somehow for ha-map?

nathan-gs commented 1 month ago

For now maxZoom is 18 (as set by leaflet), unless you add a tilelayer with a higher maxZoom.

You can set the maxZoom of the tile layer using tile_layer_options, however you are still constrained with the max zoom level of the particular tilelayer.

vermut commented 1 month ago

Is there a way to use default tilelayer from builtin HA map? Because it allows more zoom as you can see on a screenshot

nathan-gs commented 1 month ago

This is how HA does it: https://github.com/home-assistant/frontend/blob/dev/src/common/dom/setup-leaflet-map.ts#L40

(as you can see, it uses maxZoom: 20 and a CARTOCDN map).

nathan-gs commented 1 month ago

Is there a way to use default tilelayer from builtin HA map? Because it allows more zoom as you can see on a screenshot

Yes, it's possible, however using these require complying to the specific licenses, that's why using the standard openstreetmap option of leaflet is a safe default.

nathan-gs commented 1 month ago
tile_layer_options:
  maxZoom: 20
nathan-gs commented 1 month ago

@vermut which lawnmower are you using?

vermut commented 1 month ago

OpenMower. Why? :)

nathan-gs commented 1 month ago

Just curious :)