帝國cms MAPABC地圖標注[flash版地圖]建站知識
導讀:1建站知識帝國CMS模板網下面的帝國CMS教程欄目為您提供了帝國cms MAPABC地圖標注[flash版地圖]建設網站公司建設網站。
一、后臺建立字段為 [!--dbmap--] 添加完以后,修改dbmap字段在 [輸入表單替換html代碼]加入以下代碼
<style type="text/css"> .pop{position:absolute;left:0;top:30px;width:620px;height:440px;border:1px solid #ccc;} .pop_head{position:relative;height:20px;line-height:20px;background:#ccc} .pop_head a{position:absolute;right:8px;line-height:20px;color:#000;text-decoration:none} .pop_head a:hover{color:#f60;text-decoration:none} </style> <div style="position:relative"><a href="javascript:void(0);" onclick="show('pop')">我要標注圖</a> <input name="dbmap" type="text" id="dbmap" value="<?=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($r[dbmap]))?>" size=""> <div id="pop" class="pop" style="display:none"> <div class="pop_head"><a href="javascript:void(0);" onclick="hide('pop')">關閉</a>鼠標點擊目標地,可直接進行標注。</div> <div id="mapObj" class="view" style="width:620px;height:420px"></div> </div> </div>
二、修改模型,在模型中加入 (藍色部分為API密,可去code.mapabc.com申請,紅色部分為默認中心地址,可以在mapabc網站中查詢到。)
<script type="text/javascript" src="http://app.mapabc.com/apis?&t=flashmap&v=2.2&key=e356278634eb6375540bad8d10d749836ab9ce3d4dd74fa01f2b93c1418eeb54acaef376799f27e2"></script> <script type="text/javascript"> var mapObj = null; window.onload = function() { //設置地圖初始化參數對象 var mapOptions = new MMapOptions(); mapOptions.zoom = 10; //設置中心點為濟南 mapOptions.center = new MLngLat(112.21796,30.34725); mapOptions.zoom = 13; mapOptions.toolbar = DEFAULT; mapOptions.toolbarPos = new MPoint(0, 0); mapOptions.overviewMap = DEFAULT; //創建地圖對象 mapObj = new MMap("mapObj", mapOptions); registMouseAddMarker(); } function onClick(e) { var ll = new MLngLat(e.eventX,e.eventY); var marker = new MMarker(ll); marker.id = "marker"; mapObj.addOverlay(marker); var xy = marker.lnglat.lngX + "," + marker.lnglat.latY; document.getElementById("dbmap").value = xy; window.onclick(hide('pop'))企業網站建設; } 網站建設哪家好 function registMouseAddMarker() { mapObj.addEventListener(mapObj,MOUSE_CLICK,oseo網站關鍵詞優化nClick); } function unregistMouseAddMarker() { mapObj.removeEventListener(mapObj,MOUSE_CLICK,onClick); window.onclick(hide('pop')); } function show(o){ var o = document.getElementById(o); o.style.display = ""; } function hide(o){ var o = document.getElementById(o); o.style.display = "none"; } </script>
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-22 ,文章帝國cms MAPABC地圖標注[flash版地圖]建站知識主要講述地圖,帝國,帝國cms MAPABC地圖標注[flash版地網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_4805.html
- 上一篇:推薦兩組非常好用的代碼建站知識
- 下一篇:帝國CMS 6.0版 頂與踩的實現建站知識