Combining Google Maps and Google Ditu

Ditu (地圖, 地图) means map in Chinese. China has long been missing from the global Google Maps. Zooming into the China border, only patches of grey blocks are shown, occasionally with blue lines here and there indicating rivers and lakes, and worst of all, maps are just unavailable after you have drilled down deep enough.

Usually this doesn’t pose any problems as Google China serves China maps (and only China maps) at Google 地图, which provides all the functionalities of the global Google Maps website, sans satellite images. This is annoying nevertheless, it’d be the best if users can see maps of China seamlessly when they’re viewing, without jumping out from and then type in another URL just to view some data that’s still backwardly regarded by the Chinese authority as confidential and sensitive.

“Hybrid” mode for China maps is another feature that would be handy to Chinese users. Satellites images are already available but just not being shown on Since hybrid mode requires a special layer of map tiles, specially they have a transparent background so that the satellite images can show through underneath the maps, without post-processing map data provided by Mapabc this is not achievable. By Google’s terms of usage of the map data, processing the maps and then re-distribute is not legal. We can only use some freely redistributable map data such as from

Hooking up with maps from Google China is not difficult, actually that’s much easier than I thought because Google Maps API already have the mechanism to add a new map type for showing custom map data. My proof-of-concept is shown below, press the “Ditu” button at the top right hand corner and you’ll see maps delivered from

Ideally, this “mashup” should best be implemented using the new Google Mapplets, this will give users the best user experience as they only need to add a mapplet and then Google China maps will be embedded to the map window automatically, users are not required to go to this page. But since Google Mapplets doesn’t support adding new map types due to security concerns, this currently is not an option. Frankly, I don’t see there’s any security concerns by supporting new map types.

Don’t be surprised if you notice that the satellite images do not align with the Google China maps, because Google China intentionally shifted the latter to please the Chinese authority. Did it say that the maps are regarded as national security?

7 thoughts on “Combining Google Maps and Google Ditu”

  1. Anthony, thanks for the post. Can you provide step-by-step instructions for combining Google Maps and Google Ditu?

  2. Hi Anthony,

    Can you please contact me by email. I am very interested to recreate the mashup as above with a ditu button, but I am running into some problems regarding the code.
    I woul appreciate it if you could point me in the right direction or pass me on your code snippet.
    I am interested in creating routes like the point and click method using google maps.

  3. Hi Anthony,

    I used your code and successfully done a mashup. But as you said, the Ditu Google map is shifted, can you suggest a way that we can plot a GPS location of WGS84 on a ditu map? Even though would you simply suggest a company or a government department that we can talk to?

    Anyway, well done to your contribution.

    Many thanks,

  4. The reason that the Google Ditu is shifted is because of government security restrictions. As noted by Anthony, the shift is dependent on the Gzoom levels (particularly zoom levels 17,18…). However, I am unaware if both Google Maps and Google Ditu have the same projection. Assuming it is, then you can overlay points on Google Ditu correctly.
    I am pretty sure that Google Maps projection is reflected as 900913 or Google Spherical Mercator. This means, you can still georeference a WGS84(lon/lat) point taken from your Garmin or any GPS equipment in Google Maps. I could go on and on here, but instead just read my blog post, “OpenLayers + Google Spherical Mercator”, . If you need more information, you can contact me offlist.

    Anthony, interesting posts you have here! Looking forward to reading more of your posts while Im still in Beijing.


Leave a Reply

Your email address will not be published.

four + = 7

This site uses Akismet to reduce spam. Learn how your comment data is processed.