最简单的GIS代码分享

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://211.136.131.242:8087/api/map.js?key=您的密钥"></script>
<title>展示一张加载所有控件的siteMap效果的地图</title>
<style type="text/css">
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;}
.anniu{position:absolute;right:100px;top:10px;width:110px !important;height:auto;background-color:#000000;z-index:8888;}
</style>


</head>
<body>

 <div id="div_map" style="width:100%;height:100%;"></div>
 <div class="anniu">
 <input type="button" value="地图" onclick="test1()" />  <input type="button" value="卫星" onclick="test()" >
    </div>
 
<script type="text/javascript">
 var map=null;
 
  map=new STMapObj("div_map");
  map.locateMap(new STMapPoint(121.47613,31.229812),2);

  map.setZoomCompVisible(true);
  map.setScaleCompVisible(true);
   
 function test(){
   map.layerControl("raser",true);//设置卫星图层可见  raser
 }

 function test1(){
  map.layerControl("raser",false);//设置卫星图层可见  raser
}

</script>
<div style="display: none">
<script type="text/javascript">
var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cspan id='cnzz_stat_icon_1000501913'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s11.cnzz.com/z_stat.php%3Fid%3D1000501913' type='text/javascript'%3E%3C/script%3E"));
</script>
</div>
</body>
</html>

                                                   查看代码运行效果

你可能感兴趣的:(map,地图,GIS开发,室内地图开发)