cccreator / GIS

Gis releated
1 stars 0 forks source link

Arcgis API For js #2

Open cccreator opened 6 years ago

cccreator commented 6 years ago
<script>
        var map;
        require(["esri/map"], function (Map) {
            map = new Map("map", {
                basemap: "streets", //显示的地图样式 此处为地图,basemap: "satellite", //实景图
                center: [-80.94, 33.646], //地图加载后,初始位置
                zoom: 8, //放大级别,值越大放大的比例就越大
                slider: false,
                maxZoom: 18,//地图最大缩放级别
                minZoom: 1, //地图最小缩放级别
                logo: false  //不显示Esri的logo
            });

            //加载地图服务
            var myTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer(
                    "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
            map.addLayer(myTiledMapServiceLayer);//添加到地图中
        });
    </script>

对于basemap,可以这样用:

basemap: basemap1, 
var basemap1 = {
            baseMapLayers: [
                {url: mapConfig.mapCompreShow}
            ],
            title: mapConfig.cityName,
            id: mapConfig.cityCode
        };
cccreator commented 6 years ago
cccreator commented 6 years ago