liodali / osm_flutter

OpenStreetMap plugin for flutter
https://pub.dev/packages/flutter_osm_plugin
MIT License
239 stars 98 forks source link

error displaying map in web #521

Closed derklaro closed 7 months ago

derklaro commented 7 months ago

displaying an osm map is currently not possible in web, as an error is thrown from removeUnecessaryStaff:

errors.dart:330 Uncaught (in promise) Error: TypeError: Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'.

The logging prior to that error message in the function gives:

<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">
  <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag">
    <path fill="#4C7BE1" d="M0 0h12v4H0z"></path>
    <path fill="#FFD500" d="M0 4h12v3H0z"></path>
    <path fill="#E0BC00" d="M0 7h12v1H0z"></path>
  </svg>
  " Leaflet"
</a>

The map controller is initilized using:

MapController.customLayer(
  initPosition: GeoPoint(
    latitude: 51.163375,
    longitude: 10.447683,
  ),
  customTile: CustomTile(
    urlsServers: [
      TileURLs(url: "https://tile.openstreetmap.de/"),
    ],
    tileExtension: ".png",
    sourceName: "osmGermany",
    maxZoomLevel: 20,
  ),
);

Using version 1.0.2. Let me know if there is any information missing 😄

liodali commented 7 months ago

i will check it i think i know why and i will do quick fix for it

liodali commented 7 months ago

try older version

derklaro commented 7 months ago

I previously was on 1.0.0-rc.6, that worked.

liodali commented 7 months ago

use 1.0.1 i will make fix for tonight

liodali commented 7 months ago

the new version 1.0.3 published

derklaro commented 7 months ago

works now, thanks 👍