maplibre / flutter-maplibre-gl

Customizable, performant and vendor-free vector and raster maps, flutter wrapper for maplibre-native and maplibre-gl-js (fork of flutter-mapbox-gl/maps)
https://pub.dev/packages/maplibre_gl
Other
215 stars 117 forks source link

make feature tap detection work for features with a null id on ios (same as android) #357

Closed lunaticcoding closed 9 months ago

lunaticcoding commented 9 months ago

Feature Id nullable on android but not on iOS.

On android the feature id can be null which works fine in our app but on iOS clicking on points of interest the reaction is the same as clicking elsewhere on the map.

In the android code Screenshot 2023-12-12 at 13 42 00

null is a valid value. I adapted the iOS code to allow for the same behaviour.

m0nac0 commented 9 months ago

Sounds reasonable, thanks for contributing.

Do you happen to have tested if null ids also work on web?

lunaticcoding commented 9 months ago

you're welcome :)

I just tried taking a look at web:

@JS()
@anonymous
class FeatureJsImpl {
  external dynamic get id;
  external set id(dynamic id);
  external String get type;
  external GeometryJsImpl get geometry;
  external dynamic get properties;
  external String get source;
  external factory FeatureJsImpl({
    dynamic id,
    String? type,
    GeometryJsImpl geometry,
    dynamic properties,
    String? source,
  });
}

As far as I can tell web seems to already support/allow null. I however have little experience with flutter web plugins.

lunaticcoding commented 9 months ago

@m0nac0 is it possible to get this merged soon? :) We need it for a client project.

m0nac0 commented 9 months ago

Thanks again for contributing!