ArcGIS API for JavaScript(4.x)初始化地图

  require([
    'esri/Map',
	'esri/views/MapView',
	"esri/geometry/Extent",
	"esri/geometry/SpatialReference",	
     ], function (
     Map,MapView,Extent,SpatialReference
     ) {
     //如果自定义切图底图则不需要basenap
 		var map  = new Map({basemap:'osm'});
        var mapView = new MapView({
            //center: [84.87, 42.57], // long, lat
            container: "containid",
            map: map,
            constraints: {
              minZoom: 3,
              maxZoom: 18,
              snapToZoom: false
            },
            zoom: 1
        });
        //地图初始化范围
        mapView.extent = new Extent(8181888.285583924,  4073662.410032952, 10729665.6017059,
      6305376.552373809, new SpatialReference({wkid: 3857}));
       // esri移除水印
        mapView.ui.remove(['attribution']);
        //放大缩小按钮
        mapView.ui.move("zoom", "top-right");
        //矢量服务设置比例
        mapView.scale = 240000
})
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值