change openstreetmap TYP in an android app? - openstreetmap

I use an OSM map in an android application using the osmdroid package and it works fine. The only thing I want to change is the visual appearance of the map to a typ, which is called "outdoor" style. I tried all the possibilities given in the setTileSource()-Function, but no map displays the map like in the piicture below. Is there a simple way to set a parameter somewhere to get the desired appearance of the map? I have seen some app's using this appearance. Thanks!
mv.setTileSource(TileSourceFactory.MAPNIK);
this is what I want to display

Related

Driving Navigation using google maps in flutter

I am using google maps in my flutter app, I have done drawn paths from one point to another using flutter_polyline_points, Now I want to get turn by turn navigation as mentioned in this attached picture, is this possible in flutter, or how I will achieve this
This is Google Map Turn by Turn Navigation View. You can launch it using Android Intent Plus lib
AndroidIntent mapIntent = AndroidIntent(
action:'action_view',
package: 'com.google.android.apps.maps',
data: 'google.navigation:q=$yourDestinationLat,$yourDestinationLng'
);
mapIntent.launch();
Read more at this link

Flutter | how to add custom Icons in Mapbox's markers/symbol

I was wondering how one could use his own icons in a Flutter-Mapbox plugins' marker?
There's no default marker icon (no provided icon - no marker),
and there's not enough documentation on how to use a custom image.
adding a symbol (marker) is as follows:
mapController.addSymbol(
SymbolOptions(
geometry:LatLng(0.0, 0.0), // location is 0.0 on purpose for this example
iconImage: "pin"
)
);
whereas the IconImage, a String, is the field which should contain the data about the icon (obviously), but the given example repository doesn't clarify the needed parameters (url, path etc.).
Providing a path to the assets doesn't work (unlike other widgets). In the example, they provide the IconImage field the value airport-15, and when running the app, it actually works, but I can't seem to find the resources' location (it's not in #drawables or my assets folder, or any other place in the project)
You have to create a custom style on using MapBox Studio.
Create a new dataset if not already exist
Create tileset
Create new style & select customize basic template
Create new layer, give it a name for example my_sym and add newly created datasource
Then click on type & change it to symbol
Now click on my_sym two times. (first one will close the option menu & second one will open a new menu with symbol properties
Click on icon tab & select new icon. You can also upload your own svg icon.
Click on publish
Click on share it will show you the urls.
Copy the type of url & set styleString property.
For more info follow steps here
https://docs.mapbox.com/help/tutorials/add-points-pt-1/
API reference:
https://docs.mapbox.com/mapbox-gl-js/api/
As of release 0.0.5 it will be possible to load custom icon images for your markers. The idea is to add the icon image to your assets folder (for example: assets/symbols/custom-icon.png). If you specify this image as an asset in your pubspec.yaml and set the iconImage in the SymbolOptions to this path it will be loaded automatically.
Regarding the airport-15, this is an icon provided by the Android implementation of the plugin. It is part of the Maki Icons used in Mapbox. Because these icons are part of the Android implementation you will not find as a Flutter asset or an Android resource of the example app.

how to load text layer in mapbox-gl style / tileset

I'd like to do exactly what https://api.mapbox.com/styles/v1/zugaldia/cimteac7b00mrb8m7okkkol8d.html?title=true&access_token=pk.eyJ1IjoienVnYWxkaWEiLCJhIjoiY2ltNnI0YXM0MDA0YXR5bHgxOTU0N2h5YyJ9.kBUkyDqT5S1gJOsMIAdJSw#11/38.8993/-77.0146 is doing.
It seems to use the MapBox GL tileset and style to place text on the map. It even shows more text at a zoomed in level.
How do we do that?
Can you point to a detailed example or video that shows the steps for loading the tileset (maybe from a GeoJSON file, etc)
Thanks.
It is really nice that we can do so much without javascript at all :)
This makes it easier for Android and iOS etc.
Notice the text for the School names:
Then when you zoom in, you see the text for the crime:
That is indeed a very nice map, he created it using Mapbox Studio uploading crime and school data as layer sources. You can learn more about creating your own map style by following along with the "design a map" guides. Once you've created a map you'll need to get the style ID by doing this:
(source: mapbox.com)
and then...
(source: mapbox.com)
Now you also mentioned using these maps within your Android or iOS app which is similar to using the api (link you gave above). Follow this example about including Mapbox studio style in your Android app. The example places the style url within XML like so:
<com.mapbox.mapboxsdk.maps.MapView
...
mapbox:style_url="mapbox://styles/<your-account-name>/<your-style-ID>"
/>
Hope this helps!

Mapbox uploading background image

I'm trying to change the background of my map and put an image instead of it.
I'm currently using map box studio so when I'm choosing a local path
(c\deskstop\toto.png), it is working on the software, so if I choose to upload my whole map style, and use my map on the internet, it doesn't work.
I choose to upload the picture in my website then I changed the URL of the path too ( toto.com\pictures\toto.png). but it is till not working
Does someone has already this problem with mapbox?

Android drawable resources: how to change color scheme based on version of application

I am trying to implement two different versions of the same application, the only difference being the color scheme. How would I go about displaying different drawables based on the version?
For example, let's say I have a Blue version and a Red version. I would like to use the same source code for both but have an easy way to convert between the two color schemes. I am confused on how I would tell Android that I want to use the Blue version (or Red) and have it access files perhaps in resources/drawables/Blue or resources/drawables/Red. I found the link below, but I don't understand how I can implement this using just one package. Is it possible?
Dynamically change the name of the resource file to be used?
Making resources theme dependent
One way to do it is simply have a SharedPreferences int, where if it is 0, the app is in "red mode" and 1, it is in "blue mode". The downside of this is that you have to change the scheme in each activity.