tlserver / flutter_map_location_marker

A flutter map plugin for displaying device current location.
https://pub.dev/packages/flutter_map_location_marker
BSD 3-Clause "New" or "Revised" License
97 stars 81 forks source link

Web Support #52

Closed RedHappyLlama closed 1 year ago

RedHappyLlama commented 1 year ago

Hi,

Flutter_Map supports Flutter Web, but seemingly this plug-in does not support Flutter Web? Are there any plans to add in this supportability?

Many thanks!

tlserver commented 1 year ago

It already supported web, but pub dev cannot correctly show the web badge because it import flutter_compass, which do not support web, as default implementation.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

JaffaKetchup commented 1 year ago

@tlserver See https://dart.dev/tools/pub/pubspec#platforms

yvs2014 commented 1 year ago

Trying to run on the web-platform, it complains on flutter_map_location_marker itself (if I got it correctly)

Error: PlatformException(UNSUPPORTED_OPERATION, getLastKnownPosition is not supported on the web platform., null, null) dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49 throw_ packages/geolocator_web/geolocator_web.dart 70:7 getLastKnownPosition packages/geolocator/geolocator.dart 54:35 getLastKnownPosition packages/flutter_map_location_marker/src/data_stream_factory.dart 66:48 <fn>

yvs2014 commented 1 year ago

quick fix by ignoring PlatformException thrown by getLastKnownPosition https://github.com/yvs2014/flutter_map_location_marker/commit/89e2e180e7073632e64e085240b85a3d0fadd026

not sure if that's enough, but it displays a location marker on map running on the web-platform