watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvewf5dw4wnte2/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center ">
The. aspx code is as follows:
<%@ page language= "C #" autoeventwireup= "true" codefile= "Insert map. Aspx.cs" inherits= "Insert Map"%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title></title>
<script type= "Text/javascript" src= "Http://api.map.baidu.com/api?
V=2.0&AK=NORAEOYTCENXSBGQ7PY9QBRL "> </script>
<body>
<form id= "Form1" runat= "Server" >
<div>
<div id= "Div_baidumap" style= "height:600px; width:600px; border:1px solid silver; "></div>
<script type= "Text/javascript" >
var map = new Bmap.map ("Div_baidumap");
Map.centerandzoom (New Bmap.point (116.321565, 39.979607), 11);
0. Control settings
Pan Zoom
Map.addcontrol (New Bmap.navigationcontrol ());
Mouse wheel zoom in and zoom out
Map.enablescrollwheelzoom ();
//...
1. Join Click to listen
Map.addeventlistener ("click", Function (e) {
Alert (e.point.lng + "," + E.point.lat);
// });
2. Adding a static identity
var _p = new Bmap.point (116.321565, 39.979607);
var _m1 = new Bmap.marker (_p);
Map.addoverlay (_M1);
3. Animation
_m1.setanimation (bmap_animation_bounce);
4. Pop-up form
var _info1 = new Bmap.infowindow ("Imeson headquarters");
_m1.addeventlistener ("MouseOver", function () {This.openinfowindow (_INFO1);});
_m1.addeventlistener ("Mouseout", function () {This.closeinfowindow (_INFO1);});
5. Label Tips
var _opts = {position: _p, Offset:new bmap.size (25,-10)}
var _lab = new Bmap.label ("corporate headquarters", _opts);
Map.addoverlay (_lab);
_lab.setstyle ({color: "Orange", FontSize: "14px", padding: "6px"});
6. Define your own identity
var _icon = new Bmap.icon (".. /app_imgs/logo40.png ", New Bmap.size (40, 40));
var _m2 = new Bmap.marker (_p, {icon: _icon});
Map.addoverlay (_M2);
</script>
</div>
</form>
</body>
Effects such as the following:
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
Page insert Baidu Map (using the Baidu Map API)