osm_flutter icon indicating copy to clipboard operation
osm_flutter copied to clipboard

change color theme of osm map

Open HamiidrezaRamezani opened this issue 3 years ago • 11 comments

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 ...

HamiidrezaRamezani avatar Sep 26 '21 07:09 HamiidrezaRamezani

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

liodali avatar Sep 26 '21 09:09 liodali

So what exactly do I do now?

HamiidrezaRamezani avatar Sep 26 '21 12:09 HamiidrezaRamezani

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/)

liodali avatar Sep 26 '21 14:09 liodali

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

HamiidrezaRamezani avatar Sep 26 '21 17:09 HamiidrezaRamezani

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

liodali avatar Sep 26 '21 20:09 liodali

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.

djazlog avatar Dec 06 '21 12:12 djazlog

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

liodali avatar Dec 06 '21 12:12 liodali

off topic, have any ideas how to calculate and display the speed of movement? And changing the viewing angle?

djazlog avatar Dec 06 '21 12:12 djazlog

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

liodali avatar Dec 06 '21 13:12 liodali

use this
await controller.rotateMapCamera(degree);
to change the angle view of the camera

liodali avatar Dec 06 '21 13:12 liodali

@liodali can you provide example how to use https://openmaptiles.org/ ?

anton-yarish avatar Jun 26 '23 07:06 anton-yarish