I am using Bingmap API to show location of some building. The broblem I faced is when display building in HongKong, the pushpin show wrong location.
After researching, I released that Bing map, and other online mapping services are able to publish maps in compliance with Chinese law because they conform to China’s so called GCJ-02 coordinate system, also referred to as Mars Coordinates.
GCJ-02 is based on the familiar WGS84 coordinate system, except that
it is said to use an encryption algorithm to shift the coordinates by
a few hundred meters from their true locations. As a result, GCJ-02
maps appear entirely self-consistent, but the actual coordinates of
any given location are slightly offset from reality.
But Google map show right position in Hong Kong.So my question is there any way to fix for Bing Map API in this case?
Bing map version :
Google map version :
Its difficult to say what the issue may be. I suspect that the address is rendering with the offset, but the base maps being displayed are not offset. If you are in china the maps will be in Chinese and offset. If using the developer API's set the market/culture to zh-CN.
Related
I want to know if there is any way to get a city/suburb/postal code's outer boundary coordinates, so as to be able to draw a polygon on the map.
I have read through the google maps API documentation (Places, Maps, and Routes) and I can't find anywhere where they provide this information.
Native in google maps if you search for a city google maps will draw a polygon around the city edges. Drawing the polygon is not the issue I just want to know how to get the polygon points for any given location.
I have searched and all the available answers are either very old or provided only a community maintained polygon database, that is not guaranteed to have your location mapped.
So my question is, do google maps APIs expose some function to get these coordinates, or is there some reputable well maintained service where this information can be obtained from?
I am using it in a flutter applicant making use of google_maps_flutter.
These are some of the resources and other links I found but seem dated.
Resource 1
Resource 2
Googles Docs
Please please help.
I'm not sure that the Google Maps API offers this functionality, but I trust that you've dug through enough of their documentation to find that they don't.
I suggest looking at Nominatim, which queries data from OSM (OpenStreetMap). They're free to use and community-driven - which can be both awesome and scary (eg. you can't assume "permanent ID"s for the things you query)
Relevant Links:
https://nominatim.org/release-docs/latest/api/Overview/
https://nominatim.openstreetmap.org/ui/search.html
Otherwise, you could also try looking for other tools that allow you to download datasets of boundary coordinates (eg: GADM) but you'd have to find one that has the level of granularity you need and read up on their usage policies (most disallow use for commercial purposes).
Unfortunately the world of GIS and digital cartography is one that can get pretty complicated and that I'm no expert in, but I hope this helps somewhat.
Listing other resources I've found that are rather outdated, but could still be helpful:
Google Maps how to Show city or an Area outline
Add "Search Area" outline onto google maps result
So basically, I want to have a button where I can begin the tracking, and when I click the second time, the driven route should be displayed on the map and the driven distance (in kilometres) should be displayed.
I searched up the Internet but found no solution on that.
I would be happy if anyone could help me, thanks.
For as far as I'm concerned this can not be achieved via a Google Maps API.
Like Andy replied in a comment on your question, you can keep track of the coordinates from the Geolocator package (https://pub.dev/packages/geolocator) and compute the distance between each sequential point (Maps Toolkit provides these functions: https://pub.dev/packages/maps_toolkit).
Add these up and you have an approximation of the distance. How more often you keep track of the location, how more accurate it will be.
Keep in mind: if you track based on time, the approximation may be less accurate due the (higher) speed of the device that's travelling. I'd suggest you adjust the interval of point-tracking based on the speed.
Not getting much luck tracking this down through their official support channels.
Does MapBox have known data quality issues in certain geographies.
Take for example the following address in Hong Kong
12 Cloud View Road, Hong Kong
Google Maps has no problem finding this location by this address
Mapbox on the other hand, does not find it. See: https://docs.mapbox.com/search-playground/#
I've tried numerous things including specifying the Country/WorldView filtering options, but still no joy. And I can't find anything in the mapbox documentaiton that talks about coverage of various nations or address languages.
I need to make a decision on whether to go with Google Maps (significantly more expensive for our needs) vs. MapBox (doesn't seem to support what we require in certain territories).
I'm using leaflet map in my ionic application.
On offline, by default, open street map layer loads but when changing the zoom level, the map disappears.
How can I get the map to show when zoomed offline?
You need to download (pre-cache) the tile images to work with offline mode.
Download the tiles at the zoom levels you want. Map data is quite large and so you may want to limit to a small subset of zoom levels, or a geographic boundary (a city, country, etc.)
OSM's specific tile usage policy is here: http://wiki.openstreetmap.org/wiki/Tile_usage_policy But the part that applies to your app is this:
In particular, downloading significant areas of tiles at zoom levels
17 and higher for offline or later usage is forbidden without prior
consultation with a System Administrator.
That page also lists numerous "free" tile providers. Because I expect it to change "significantly" over time, I'm not gonna copy and paste it for you.
Unless you enter into some kind of contract/agreement with the tile provider, you may need to render your own or find a different tile service that will allow you to pre-cache tiles.
The details for downloading map data that can be rendered as tiles can be found on the OSM website: http://wiki.openstreetmap.org/wiki/Downloading_data
There are multiple ways to get the data from OSM, but these services and options will undoubtedly change over time so I think it safest to just refer to their website (google "download open street map data" if above link is broken).
I have used a .NET library called BruTile to manage the tile cache. But basically it is just a bunch of image files organized in a zoom/grid structure.
It would also be good for you to google search topics such as "ionic leaflet tile cache" and "pre cache map tiles ionic" and such. There isn't a lot out there yet, but this is a growing area of development.
Thoughts regarding mobile apps
If you are deploying to mobile devices it probably doesn't make sense to deploy the pre-cached tiles because (a) they will become out of date and require constant upkeep, and (b) large file size resulting in slow downloads. It would be better to download tiles while online after the app is installed.
Windows and Android phones both allow download of offline map data in their maps apps. It may be possible to leverage that data. Otherwise you would make your app work similarly: prompt user to download maps for their region, and then find a way to reasonably specify the region (geographic area) for which they need maps. It is also a good idea to let the user know how much data will be downloaded for metered data plans and device storage.
It also would be better for you to use a server other than the OSM servers, such as a paid Microsoft or MapQuest or Bing account. The OSM servers aren't capable of handling production load across every SPA that wants maps to work offline. Better to rely on the device's capabilities and built-in maps app if possible. Amazon and Azure (for example) services may be feasible for this. If you wrote your own program to run as a service on your own sever it could pre-cache tiles from the tile service (thus reducing your usage fees and server load) and then the apps would just get map data from your server. This also gives you the opportunity to get creative with your own custom tiles.
I want to create a web interface where I can adjust my own "street" data to match aerial images of streets so that it is more accurate. I will have someone who is on the street, will see that it is inaccurately represented on my map and then they will go to the web interface to update it.
I understand that Waze used Bing aerial tiles to do this in their map editor (https://www.waze.com/editor/) before they were acquired by Google. Is this sort of function still available from Bing?
My worry is that maps like Google or OpenStreetMaps do not allow for you to "trace" their aerial tiles. Although this is a question of legality in the case of Bing, I am more interested in suggestions for mapping services that would allow me to integrate this functionality into my web interface.
Note: I am not taking answers here as legal advice. I understand that I am legally liable for whatever I chose to do, I am just looking for suggestions on an aerial map I could use for my project.
Thanks :)
It depends on what the base map data is. Bing Maps already provides OpenStreetMaps with aerial imagery which can be used to trace roads in their editor tool. I can't see OpenStreetMaps disabling this any time soon as long as Bing continues to provide them with access to the aerial imagery.
Send me an email at richbrun at microsoft.com and we can discuss in more detail.