Skip to content

Bounds in TileLayerOptions Causes Exception #11

Description

@torourke55

Code:
var southWest = new LatLng(14.0, 32.0);
var northEast = new LatLng(32.0, 54.0);
Tuple<LatLng, LatLng>? bounds = Tuple.Create<LatLng, LatLng>(southWest, northEast);
//Create Tile Layer
var tileLayerOptions = new TileLayerOptions()
{
Attribution = "© <a href="https://www.openstreetmap.org/copyright\">OpenStreetMap contributors",
MinZoom = 6,
MaxZoom = 13,
Bounds = bounds,
};

Exception:
Microsoft.JSInterop.JSException: Cannot read properties of undefined (reading 'lat')
TypeError: Cannot read properties of undefined (reading 'lat')
at s.overlaps (https://unpkg.com/leaflet@1.9.4/dist/leaflet.js:5:12148)
at e._isValidTile (https://unpkg.com/leaflet@1.9.4/dist/leaflet.js:5:114581)
at e._update (https://unpkg.com/leaflet@1.9.4/dist/leaflet.js:5:113973)
at e._setView (https://unpkg.com/leaflet@1.9.4/dist/leaflet.js:5:112013)
at e._resetView (https://unpkg.com/leaflet@1.9.4/dist/leaflet.js:5:111354)
at e.onAdd (https://unpkg.com/leaflet@1.9.4/dist/leaflet.js:5:106987)
at e._layerAdd (https://unpkg.com/leaflet@1.9.4/dist/leaflet.js:5:67662)
at e.whenReady (https://unpkg.com/leaflet@1.9.4/dist/leaflet.js:5:43287)
at e.addLayer (https://unpkg.com/leaflet@1.9.4/dist/leaflet.js:5:67885)
at e.addTo (https://unpkg.com/leaflet@1.9.4/dist/leaflet.js:5:67005)
at Microsoft.JSInterop.JSRuntime.d__16`1[[Microsoft.JSInterop.IJSObjectReference, Microsoft.JSInterop, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions