总结的OSM 地图相关的分析
How OSM works:
![](https://images2015.cnblogs.com/blog/935807/201612/935807-20161201172027381-460909435.png)
![](https://images2015.cnblogs.com/blog/935807/201612/935807-20161201172108209-1654398565.png)
![](https://images2015.cnblogs.com/blog/935807/201612/935807-20161201172242943-1836102065.png)
From a known location(Latitude, Longitude) represented by
, calculate the x,y which stand for the specific tile number:
![](https://images2015.cnblogs.com/blog/935807/201612/935807-20161201172353631-198887222.png)
Icons were embedded in the .png picture file.
Icons were embedded in the .png picture file tranfered to web broswer. So, if we realy want to remove those icons. One possible way is to find a proper tile service, it might be operated by OSM or other 3rd party operators.
There are 2 tile services operated by OSM itself: osmStandard and osmHuman, both have icons in tiles. In itsofficial site http://www.openstreetmap.org/, they demostrate 4 kinds of map from 4 different tile services.
2 tile services are OSM self operated, others are from 3rd party tile service provider.
'osmStandard': {
'url': 'http://c.tile.openstreetmap.org/{z}/{x}/{y}.png' }, 'osmCycle': { 'url': 'http://c.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' }, 'osmTransport': { 'url': 'http://c.tile.thunderforest.com/transport/{z}/{x}/{y}.png' }, 'osmHuman': { 'url': 'http://tile-a.openstreetmap.fr/hot/{z}/{x}/{y}.png' } |
There are some tile services which base on OSM data in https://wiki.openstreetmap.org/wiki/Tile_servers,and some of them is free:
People or organization may need apply for tokens or register from them, then are allowed to use those 3rd party tile services. The risk is we don't know how long
the operator can manage their tile service in the future.
So, Keep those icons. still using the standard tile service from OSM since it is the biggest free community in the world.
And we import more other map tile service like Google map and Here map as more options. Such as below fast POC:
When user click the buttun on the up-right corner in the map view, user can select their desired Map provider, no need to consider the configuration, and it will render the same location with different style of map at once.
![](https://images2015.cnblogs.com/blog/935807/201612/935807-20161201172534193-1191793438.png)
![](https://images2015.cnblogs.com/blog/935807/201612/935807-20161201172611068-734773929.png)
![](https://images2015.cnblogs.com/blog/935807/201612/935807-20161201172659756-2051608606.png)