osm_flutter
osm_flutter copied to clipboard
change color theme of osm map
I want to change the color theme of the map, but I can not change the theme, can you help me? I wanna change the road and the streets in osm . and ...
in this plugin for now we use only raster tile map , to change the theme,their are lot of option,
- we should add support of vector map to this plugin and add way to change the style of the map ( for now we use vector map only in ios without changing of the style of the map ) or
- you create your own tile server using for example openmaptiles (https://openmaptiles.org/) and we add the support of custom server tile url
So what exactly do I do now?
if this feature you need it in your application , you need to create you own server tile or use use cloud service of openmaptiles with custom tile style, and for my plugin i will add way to customize server tile or take look at this library tangram es (https://github.com/tangrams/tangram-es) i used in ios support but contain some limitation that's why i didn't used for android you can create you own style look at this link (https://tangrams.readthedocs.io/en/main/Overviews/Styles-Overview/)
Why not add this feature to your package? Because I did not understand anything from the documents you sent and I desperately need this package, please help me
it's not that easy in near future i will add the support of custom server tile but i will try that in the future for now i'm focing in web support fixing urgen bug and ameliorate the plugin but i will try to do that soon
case "config#Theme": isThemeDark = call.arguments as! Bool let sceneUpdates = [TGSceneUpdate]() if(isThemeDark) { let localFile = Bundle.main.url(forResource: "dark", withExtension: "yaml") let sceneUrl = URL(fileURLWithPath: localFile?.path ?? "basic.yaml") mapView.loadSceneAsync(from: sceneUrl, with: sceneUpdates) }else{ let localFile = Bundle.main.url(forResource: "white", withExtension: "yaml") let sceneUrl = URL(fileURLWithPath: localFile?.path ?? "day.yaml") mapView.loadSceneAsync(from: sceneUrl, with: sceneUpdates) } result(200) break;
Hi, I made a theme change via the passed parameter isThemeDark. From flutter I transfer to the native code which theme to load. Theme are local.
what you did is for ios only and what he want is change tile of the map, that's avaiable only if you have your own tile server or use another tile server and i should add serverURL to make that possible that feature will be add it soon
off topic, have any ideas how to calculate and display the speed of movement? And changing the viewing angle?
you can calculate distance between 2 position and get diff time and after that divide the distance by the time (distance / time) to get approximatly the speed
use this
await controller.rotateMapCamera(degree);
to change the angle view of the camera
@liodali can you provide example how to use https://openmaptiles.org/ ?