maplibre / maplibre-native

MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms.
https://maplibre.org
BSD 2-Clause "Simplified" License
1.03k stars 299 forks source link

Android Documentation: Clarify using `MapLibreMapOptions` #2526

Closed louwers closed 2 months ago

louwers commented 3 months ago

In the documentation, I have been able to found that we can apply map options (https://maplibre.org/maplibre-native/android/api/-map-libre%20-native%20-android/org.maplibre.android.maps/-map-libre-map-options/index.html).

From the documentation: Defines configuration MapLibreMapOptions for a MapLibreMap. These options can be used when adding a map to your application programmatically (as opposed to via XML). If you are using a MapFragment, you can pass these options in using the static factory method newInstance(MapLibreMapOptions). If you are using a MapView, you can pass these options in using the constructor MapView(Context, MapLibreMapOptions). If you add a map using XML, then you can apply these options using custom XML tags.

Great, but without a few sample code (XML, programmatically, etc) this is not really usefull. If I want to use XML, is it another tag included in the tag <org.maplibre.android.maps.MapView ... /> or an attribute or something else? Because I'm a Kotlin/Android Platform beginner, I have no idea on how to add a map programmatically to an Activity! Moreover, I have not been able to found the factory method mentioned. We don't need a full app to show these cases, just a sample app using map options. Using XML declaration and code commented method to use the programmatic method. Of course, the same app can be used to demonstrate something more complicated! Like what comes next... ;-)

Suggestion from @lepigocher

Bounty direction: https://github.com/maplibre/maplibre/issues/191

jDilshodbek commented 3 months ago

I would like to work on this ticket

jDilshodbek commented 2 months ago

2024-07-24 15 29 09

louwers commented 2 months ago

This bounty can be paid out.

jDilshodbek commented 2 months ago

invoice link :https://opencollective.com/maplibre/expenses/213230