Upload the-express frame of the German map

Source: Internet
Author: User

1. First to register a gold map, and then become a developer

2. Get your own key value in the console

3. Add the following code to the page where you want to display the map

<script type= "Text/javascript" src= "Https://cache.amap.com/lbs/static/addToolbar.js" ></script>
<script src= "//webapi.amap.com/ui/1.0/main.js" ></script>
<div id= "Container" style= "height:600px" ></div>

<script>

var ToolBar;
var custommarker = new Amap.marker ({
Offset:new Amap.pixel (-14,-34),//position relative to base point
Icon:new Amap.icon ({//Complex icon
Size:new Amap.size (27, 36),//Icon size
Image: "Http://webapi.amap.com/images/custom_a_j.png",//Large map address
Imageoffset:new Amap.pixel (-28, 0)//drawing position relative to large map
})
});
var map = new Amap.map (' container ', {
Resizeenable:true,
Zoom:11,
Center: [116.397428, 39.90923]
});
Amap.plugin ([' Amap.toolbar ', ' amap.scale ', ' Amap.overview '),
function () {
Map.addcontrol (New Amap.toolbar ());

Map.addcontrol (New Amap.scale ());

Map.addcontrol (New Amap.overview ({isopen:true}));
});

</script>

4. Add a page header after login

<link rel= "stylesheet" href= "Http://cache.amap.com/lbs/static/main1119.css"/>
<script src= "http://webapi.amap.com/maps?v=1.4.2&key= your Key value" ></script>

Upload a german map-express frame

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.