mapbox / mapbox-plugins-ios

Experimental plugins to supercharge your maps ⚡️
ISC License
7 stars 8 forks source link

Geocoder Search Bar #14

Closed jmkiley closed 6 years ago

jmkiley commented 7 years ago

An iOS version of the mapbox-gl-geocoder would be helpful for developers. Could allow people to more easily incorporate MapboxGeocoder.swift.

It would require an additional dependency, so we would need to decide whether we want to support Carthage in this library.

It would likely be a UISearchBar with a 4-5 row UITableView that pops over the map, and return an array that can be mapped by the user.

cc @captainbarbosa @1ec5

1ec5 commented 7 years ago

It would be nice to keep the concept of map plugins focused to functionality that’s contained in the map itself. The functionality proposed here is akin to how the navigation SDK – as a separate library – vends its own UI that has a map view as its centerpiece. That isn’t really a consideration for mapbox-gl-geocoder, which is designed as an ornament in the map itself, similar to the compass button provided by the iOS SDK.

Another way of looking at it is that, on iOS, it would be more helpful to provide a view controller – perhaps a special version of UISearchController and UITableViewController that work together. By contrast, a standalone UISearchBar provides little additional functionality and would require the developer to manage integration with a UITableView themselves. Yet as soon as a library vends a view controller, it moves well beyond the scope of the map SDK, taking over the window instead of enhancing a particular view within the window.

jmkiley commented 7 years ago

Yeah. I think we need to explore whether we want to use the plugins repo to house plugins that solely use the Maps SDK, or to also include plugins intended to bridge the Maps SDK with other other Mapbox libraries (such as geocoding).

captainbarbosa commented 7 years ago

It would be nice to keep the concept of map plugins focused to functionality that’s contained in the map itself

Would it make more sense to include this functionality within MapboxGeocoder.swift directly instead?

1ec5 commented 7 years ago

Like the other service libraries, MapboxGeocoder.swift is currently designed to be a lightweight wrapper around the Geocoding API proper, akin to the functionality provided by the Mapbox JavaScript SDK. So far it seems that our non-UI libraries are language-oriented (e.g., Swift) whereas the UI libraries are platform-oriented (e.g., iOS).

At the risk of repo proliferation, a separate UI library could depend on MapboxGeocoder.swift as an implementation detail, just as the navigation SDK depends on MapboxDirections.swift as an implementation detail.

jmkiley commented 6 years ago

Android Places Plugin has landed. I have been working on a search bar with iOS on the side, but am still a little unsure about where it would live. There is also a case for including it as an example with the MapboxGeocoder.swift library, as @captainbarbosa mentioned.

Narek1994 commented 6 years ago

Hi, any news about the iOS version of build in search bar?

Ahmeddben commented 6 years ago

Android Places Plugin has landed. I have been working on a search bar with iOS on the side, but am still a little unsure about where it would live. There is also a case for including it as an example with the MapboxGeocoder.swift library, as @captainbarbosa mentioned.

Any update on this?

captainbarbosa commented 6 years ago

We currently don't have plan to introduce a geocoder search bar plugin for this repository while we focus on other roadmap priorities. We're considering including a search bar as an integrated component of MapboxGeocoder.swift or at least include an example there, but have no timeline on when this would be implemented.