Original: "Baidu Map API" How to make a Map of Warcraft!! --cs map can also, hahaha
Summary:
Do You play Warcraft? Do you know how to make a Map of Warcraft?
Come and see this article!
---------------------------------------------
First, the preparation of the Production of Warcraft map
In fact, you just need to prepare some maps of the tile map, you can.
Using the slicing tool, put a complete picture (preferably larger, clearer) and cut into small pieces. ( I'll post the download link for this tool next week.) Leave a suspense, haha. )
Official Announcement Graph Tool Link: http://openapi.baidu.com/Tools/TileCutter.rar
Second, understand the Baidu Map API map Layer Interface
constructor function |
Describe |
TileLayer([opts:TileLayerOptions]) |
Create an instance of a map layer. |
Interface Address: Http://openapi.baidu.com/map/classReference.html#anchor6_TileLayer
Using this interface, you can spread the tiled map tiles on the original Baidu map.
varTilelayer= NewBmap.tilelayer ();
Tilelayer.gettilesurl= function(Tilecoord, zoom) {
varx=tilecoord.x;
vary=Tilecoord.y;
varURL= 'images/tiles/' +Zoom+ '/tile' +x+ '_' +y+ '. PNG';
returnURL;
}
Third, limit the display level of the map
If you only cut a level 1-4 map, your warcraft map should only show level 1-4.
So, make a limit to the map's display. Look at the first line of the source code below.
You also need to specify a custom map type to see the second line of the source code.
The third line, add the Fishbone control, will only show level 1-4 yo ~ because the first line controls the Minzoom and Maxzoom.
varMyMap= NewBmap.maptype ('MyMap', Tilelayer, {minzoom:1, Maxzoom:4});
varMap= NewBmap.map ('Container', {maptype:mymap});
Map.addcontrol (NewBmap.navigationcontrol ());
----------------------------------------------------------------------------------
Example: http://openapi.baidu.com/map/exam/example.html?v=1.2&7_20#7&20
"Baidu Map API" How to make a Map of Warcraft!! --cs map can also, hahaha