Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Missing coordinates in MGLPolylineFeature #6538

Closed
rmnblm opened this issue Sep 30, 2016 · 1 comment
Closed

Missing coordinates in MGLPolylineFeature #6538

rmnblm opened this issue Sep 30, 2016 · 1 comment
Labels
iOS Mapbox Maps SDK for iOS

Comments

@rmnblm
Copy link

rmnblm commented Sep 30, 2016

Platform: iOS 10, Swift 3
Mapbox SDK version: 3.4.0-alpha.4

I'm currently facing a problem with above solution: The function mapView.visibleFeatures(in:) correctly returns all features inside my touchable square. The problem is: there are some coordinates missing in the MGLPolylineFeature depending on the zoom level I'm currently at. See examples below:

ZoomLevel between 12-13

line1

<MGLPolylineFeature: 0x1740be1e0; count = 81; bounds = { sw = {47.1, 8.6}, ne = {47.1, 8.6}}>

ZoomLevel between 13-14

line2

<MGLPolylineFeature: 0x1742b5480; count = 66; bounds = { sw = {47.1, 8.6}, ne = {47.1, 8.6}}>

Is this a bug or am I doing something wrong? 🙈

@1ec5
Copy link
Contributor

1ec5 commented Sep 30, 2016

As noted in the documentation:

Features come from tiled vector data or GeoJSON data that is converted to tiles internally, so feature geometries are clipped at tile boundaries and features may appear duplicated across tiles. For example, suppose the specified rectangle intersects with a road that spans the screen. The resulting array includes those parts of the road that lie within the map tiles covering the specified rectangle, even if the road extends into other tiles. The portion of the road within each map tile is included individually.

Unfortunately, this means that the returned feature can’t correspond to an entire annotation. You’ll have to do some custom logic to match the returned feature to the original annotation.

@1ec5 1ec5 added the iOS Mapbox Maps SDK for iOS label Sep 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

3 participants