zoukankan      html  css  js  c++  java
  • second application:use an arcgis.com webmap

    <!DOCTYPE html>
      <html>
      <head>
      <title>Create a Web Map</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
    
      <link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css">
      <style>
        html,body,#mapDiv,.map.container{
          padding:0;
          margin:0;
          height:100%;
        }
        #legendDiv{
          background-color: #fff;
          position: absolute !important;
          z-index: 99;
          top:10px;
          right:20px;
        }
      </style>
    
      <script>var dojoConfig = { parseOnLoad: true };</script>
      <script src="http://js.arcgis.com/3.13compact/"></script>
      <script>
        var map,
            webmapId = "1a40fa5cc1ab4569b79f45444d728067";
        
        require([
          "esri/map",
          "esri/arcgis/utils",
          "esri/dijit/Legend",
          "dojo/domReady!"
          ], function (Map, arcgisUtils, Legend) {
            arcgisUtils.createMap(webmapId, "mapDiv").then(function (response) {
            map = response.map;
    
            var legend = new Legend({
                map: map,
                layerInfos:(arcgisUtils.getLegendLayers(response))
            }, "legendDiv");
            
            legend.startup();
        });
        });
      </script>
    
      </head>
    
      <body>
        <div id="mapDiv"></div>
        <div id="legendDiv"></div>
      </body>
      </html>
    dojoConfig :是否在DOM和所有初始化完成后由dojo.parser解析页面
    webmapid:arcgis.com发布地图服务的id。
    startup():
  • 相关阅读:
    程序员如何利用空闲时间挣零花钱
    常见的数据交互之跳转页面传值
    一个能让cin和scanf 一样快的方法:
    HDU 4901 DP
    POJ 2823 线段树 Or 单调队列
    POJ 3264 线段树 ST
    POJ 3468 线段树+状压
    POJ 2777 线段树
    QQ 临时会话+图标 HTML代码
    POJ 1463 Strategic game
  • 原文地址:https://www.cnblogs.com/tiandi/p/4412748.html
Copyright © 2011-2022 走看看