mapbox / mapbox/mapbox-maps-flutter
[BUG] when I load a vector tile layer, I hit on a feature,I can't get correct feature info
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
https://youtu.be/XmmtFKXeKf4
`MapWidget(
onMapCreated: (map) async {
mapboxMap = map;
map.logo.updateSettings(LogoSettings(
position: OrnamentPosition.BOTTOM_RIGHT, marginBottom: -100));
map.attribution
.updateSettings(AttributionSettings(marginBottom: -100));
map.location.updateSettings(LocationComponentSettings(enabled: true,pulsingEnabled: true));
var json = jsonEncode(_mapBoxStyle());
await mapboxMap?.loadStyleJson(json);
// loadMapConifg(map);
},
onTapListener: (e) {
mapboxMap
?.queryRenderedFeatures(
RenderedQueryGeometry(
value: json.encode(e.encode()),
type: Type.SCREEN_COORDINATE),
RenderedQueryOptions(layerIds: ["3926"]))
.then((value) {
if (value.length > 0) {
print(value[0]?.feature);
}
});
},
mapOptions: MapOptions(pixelRatio: 1),
cameraOptions: CameraOptions(
bearing: 0,
pitch: 0,
zoom: 14.3,
center: Point(coordinates: Position(125.201, 48.9394)).toJson()),
resourceOptions: ResourceOptions(
accessToken: )),
);`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the MapWidget onTapListener and the queryRenderedFeatures call shown in the issue, then review the linked video and the RenderedQueryGeometry and RenderedQueryOptions values used for layer "3926". Reproduce the tap on the vector tile layer and verify that the returned feature information matches the tapped feature.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100