Baidu map offline API and map data download tool-early adopters

Source: Internet
Author: User

Last made a Google Map offline API and map data download tool, see: http://www.cnblogs.com/liongis/archive/2012/04/27/2474194.html

A friend asked me if I could create an offline package for Baidu map. Recently, I took some time to figure it out. It took me half a day to figure it out, but there are still some problems, there is a problem running in IE browser. It is displayed in Google browser.

The offline package contains 4-6 levels of data in China, and there are no images or 3D data.

CodeAs follows:

 1   <!  Doctype html  >  2   <  Html  >  3   <  Head >  4   <  Meta  HTTP-equiv  = "Content-Type"  Content  = "Text/html; charsets = UTF-8"   />  5   <  Title  > Baidu offline demo </  Title  > 6   <  Script  Type  = "Text/JavaScript"  SRC  = "JS/apiv1.3.min. js"  > </  Script  >  7   <! --  Script Type = "text/JavaScript" src = "http://api.map.baidu.com/api? V = 1.3 "> </script  -->  8  <  Link  REL  = "Stylesheet"  Type  = "Text/CSS"  Href  = "Bmap.css"  />  9   </  Head  >  10   <  Body  > 11   <  Div  Style  = "Width: 520px; Height: 340px; Border: 1px solid gray"  ID  = "Container"  > </  Div  >  12   </  Body  >  13   </  Html >  14   <  Script  Type  = "Text/JavaScript"  >  15   VaR  Map  =   New  Bmap. Map (  " Container  "  , {Maptype: bmap_normal_map });  //  Set a satellite map as a base map  16   VaR  Point  =   New  Bmap. Point (  116.404 ,  39.915  );  //  Create coordinate points  17   Map. centerandzoom (point,  5  );  //  Initialize the map and set the coordinates of the center and the map level.  18  19   //  Map. addcontrol (New bmap. maptypecontrol ());  20   Map. addcontrol (  New  Bmap. navigationcontrol ());  21   Map. enablescrollwheelzoom ();  //  Enable scroll wheel zoom in and out.  22  Map. enablekeyboard ();  //  Enable the keyboard operation.  23   //  Map. setcurrentcity ("Beijing"); // you must set the city to be displayed on the map.  24   </  Script  > 

Apijs1.3.min. js under the JS directory is an offline package of Baidu Map

The maptile directory contains map data of 4-6 levels in China. The data is stored in Z/x/y.

If you think there are too few map data, you can use the following Baidu map data download tool to download it:

Download Page:

You can view the downloaded data in the maptile directory.

 

Solemnly declare that map data is owned by map providers.ProgramFor learning purposes only.

Baidu map offline package: baidumapv1.3.zip

Baidu map data download tool: mapcachev0.1.zip

This version is just an attempt, but there are still some problems:

1. The map cannot be displayed normally under IE.

2. offline data is only supported for maps, and images and 3D data are not supported yet.

3. Other functions are not tested.

Interested friends can discuss and learn together.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.