码迷,mamicode.com
首页 > 其他好文 > 详细

KMLLayer

时间:2019-07-12 11:12:16      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:text   height   round   url   cti   code   ext   led   tun   

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
    <style>
        html, body, #map {
            padding:0;
            margin:0;
            height:100%;
            width:100%;
        }
    </style>
    <script src="http://js.arcgis.com/3.9/"></script>
    <script type="text/javascript">
        var map;

        require([
        "esri/map",
        "esri/layers/ArcGISTiledMapServiceLayer",
        "esri/layers/KMLLayer",
        "dojo/domReady!"
        ], function (
        Map, ArcGISTiledMapServiceLayer, KMLLayer
        ) {
            var agoServiceURL = "http://server.arcgisonline.com/arcgis/rest/services/ESRI_StreetMap_World_2D/MapServer";
            var agoLayer = new ArcGISTiledMapServiceLayer(agoServiceURL);
            map = new Map("map", {
                center: [-122.393, 40.593],
                zoom: 12
            });
            map.addLayer(agoLayer);

            var kmlUrl = "http://www.ci.redding.ca.us/KML/SacRiverTrail.kml";
            var kml = new KMLLayer(kmlUrl);
            map.addLayer(kml);
        });
    </script>
</head>
<body class="tundra">
    <div id="map">
    </div>
</body>
</html>

 

KMLLayer

标签:text   height   round   url   cti   code   ext   led   tun   

原文地址:https://www.cnblogs.com/Jeely/p/11174798.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!