Skip to content

Conversation

@KG3RK3N
Copy link
Contributor

@KG3RK3N KG3RK3N commented Dec 4, 2020

I have implemented the click event for any layer types. For that, I have the methods "onMapEvent" & "offMapEvent" from android also implemented for iOS and the method "queryRenderedFeatures" works now like mapbox gl js. The old overlays for lines and circles was removed because thats not more necessary.

I would wait for merge of PR #8 to fix merge issues if needed, make last tests and add some demo code.

Usage sample:

// click event
this.mapbox.onMapEvent('click', 'line-layer-1', (response) => {
  console.log('line layer clicked', response); // response is array of geojson features
});

// queryRenderedFeatures
this.mapbox.queryRenderedFeatures(
  { lat: 52.3701494345567, lng: 4.823684692382513 },
  { layers: ['circle-with-source-object'], filter: ['all', ['==', '$id', '2']] }
)
.then((result) => console.log('query rendered features', JSON.stringify(result)));

@KG3RK3N KG3RK3N marked this pull request as ready for review December 7, 2020 20:25
@cvietor cvietor merged commit 908dbd4 into nativescript-community:master Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants