flutter-mapbox-gl / maps

A Mapbox GL flutter package for creating custom maps
Other
1.04k stars 503 forks source link

Usage of setGeoJsonFeature #1401

Closed lycs12 closed 7 months ago

lycs12 commented 9 months ago

I have still not found a way of using this function

Future setGeoJsonFeature( String sourceId, Map<String, dynamic> geojsonFeature) async { await _mapboxGlPlatform.setFeatureForGeoJsonSource( sourceId, geojsonFeature); }

I have my set up where setGeoJsonSource work perfectly from my understanding the setGeoJsonSource completely create a new GeoJsonData and update with the existing sourceId where as the setGeoJsonFeature is supposed to add/update the feature Example:

var geoJson = { "type": "Feature", "id": toAddLocation.last.authorId, "geometry": { "type": "Point", "coordinates": [ toAddLocation.last.liveLocationUpdates.last.longitude, Ï toAddLocation.last.liveLocationUpdates.last.latitude ] }, "properties": { "authorId": toAddLiveLocation.last.authorId, "iconImage": "assets/images/hangout-icon.png", "iconSize": (screenSize.height * 0.002) / 4.5 },

      await mapController.setGeoJsonFeature(
          geoJsonSourceIdForLiveLocation, geoJson);

From my understanding: if "id" is different it will add to existing source where as if its the same it will simply access it and change to what we have.

Problem: I cant make this function work even though my setGeoJsonSource is working perfectly.

Have anyone been able to use this function ?

stale[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.