iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
989 stars 552 forks source link

Request: add map layer from Baidu #245

Closed jonatkins closed 11 years ago

jonatkins commented 11 years ago

Baidu Map (map.baidu.com) was requested as an option. Not sure if it's possible - can't find any (english) documentation for developers or existing Leaflet tile layer code.

jacklau1803 commented 11 years ago

i was the guy who talked about Baidu map on G+ thanks for responsing They have open API and it's free http://developer.baidu.com/map/ They have only Chinese page but you can use google translate..... I hope it helps......

jacklau1803 commented 11 years ago

and if you want to use it on Android you need to apply a key http://developer.baidu.com/map/android-mobile-apply-key.htm here is the page for applying key

jacklau1803 commented 11 years ago

http://lbsyun.baidu.com/apiconsole/key?application=key page for applying the key of js apk...... or you can use my friend's key:37ce9915d6bc369d5937565b2b6364f1

jacklau1803 commented 11 years ago

http://developer.baidu.com/map/jsdemo.htm a example for developing press the button to get code 您的源码=your key

tingozhu commented 11 years ago

use http://api.map.baidu.com/staticimage?center={long},{lat}[&width={width}&height={height}]&zoom={zoom} to get static png

Xelio commented 11 years ago

In the FAQ, Baidu mention that they have map shifted(encoded with GCJ-02 and BD-09) in China area. Would it suitable for use in Ingress? http://developer.baidu.com/map/question.htm#qa0013

jonatkins commented 11 years ago

Nothing listed so far is suitable for this.

We need either

  1. A custom Leaflet TileLayer plugin, in the style of the Google, Bing and Yandex ones here https://github.com/shramov/leaflet-plugins
  2. A documented way of referencing map tiles. (e.g. MapQuest have this - http://developer.mapquest.com/web/products/open/map)

The static image URL might seem close to this, but is not suitable.

JayXon commented 11 years ago

@Xelio About map in China, only MapQuest OSM and Google Satellite are correct in IITC for now. All the others have this shift thing. Take a look at this: http://www.ingress.com/intel?ll=39.903115,116.390731&z=17&pll=39.903115,116.390731 These portals should be in Tiananmen Square, but in Google Roads they are shown about 500 meters west.

Xelio commented 11 years ago

But that retarded Baidu added one more level of shifting, make it different to Google Map AND MapQuest OSM.

JayXon commented 11 years ago

Yeah, so I don't think is a good idea to add Baidu map layer for now. If we have time, we should fix this shift thing in Google Map first.

jonatkins commented 11 years ago

The shifting in google maps seems to be an issue with google maps itself, not IITC - the stock intel website does exactly the same.

Report a bug to Niantic, or maybe even the google maps team, and once they have it fixed we can duplicate it in IITC if it doesn't just fall into place.

Xelio commented 11 years ago

That's not bug. The shifting is requested by China government.

JayXon commented 11 years ago

I don't think google will fix this. It's a political problem. If you want to provide map service in China, you have to get a license for that and then the government will give you some kind of a formula so that you can have real GPS location shifted so that it will looks right in the shifted map(no one have the real map), but since google has quit China in 2010, this won't gonna happen.

jacklau1803 commented 11 years ago

google.cn map also works good in china.......ditu.google.cn but baidu maybe works better because sometimes Google might be blocked.

tingozhu commented 11 years ago

there's a repo fixed the map offset of google map in china

https://github.com/brightman/lbs

might be helpful

jonatkins commented 11 years ago

I'm going to close this issue now. Doesn't look like there's any solution for this that'll work any better than the existing google maps layers. The Open Street Map based layers work better as they don't have the offset coordinate issues.

jacklau1803 commented 11 years ago

But the OSM doesn't show details of streets in China

JayXon commented 11 years ago

Here is a piece of c sharp code that is said to be able to transfer normal GPS coords to China's coords. But I haven't tried it yet. Hope it helps. https://on4wp7.codeplex.com/SourceControl/changeset/view/21455#353936

Kamapcuc commented 10 years ago

Some improvements: https://github.com/Kamapcuc/BaiduWGS84

dwandw commented 10 years ago

可以加高德地图的数据