123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <!--********************************************************************
- * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- *********************************************************************-->
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title data-i18n="resources.title_navigation"></title>
- </head>
- <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
- <div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
- <script type="text/javascript" include="bootstrap,widgets.alert" src="../js/include-web.js"></script>
- <script type="text/javascript" exclude="iclient-classic" src="../../dist/classic/include-classic.js"></script>
- <script type="text/javascript">
- var host = window.isLocal ? window.server : "https://iserver.supermap.io";
- var map, layerWorld;
- var url = host + "/iserver/services/map-world/rest/maps/World";
- map = new SuperMap.Map("map", {
- controls: [ //初始化Map类,添加控件到map
- new SuperMap.Control.Navigation({
- dragPanOptions: { //传给 DragPan 控件的属性
- enableKinetic: true //设置使用拖拽动画,默认为false
- },
- autoActivate: true, //添加到地图的控件是否自动生效,默认为true
- documentDrag: true, //允许拖拽地图,使地图能够平移到视图窗口外。默认为false
- handleRightClicks: true, //是否响应右键点击,默认为false
- //zoomBoxEnabled:false, //是否允许用户绘制缩放框,默认为true
- zoomBoxKeyMask: 4, //同时按下Alt时绘制缩放框,默认为SuperMap.Handler.MOD_SHIFT,默认值为1
- //zoomWheelEnabled:false, //是否允许用户滑动鼠标滚轴缩放地图,默认为true
- pinchZoomOptions: { //传给 PinchZoom 控件的属性
- autoActivate: false //将该类添加到地图上时,自动激活该控件,默认为true
- }
- })], allOverlays: true
- },notice());
- function notice() {
- widgets.alert.showAlert(resources.msg_navigation,true,300,false,0.8);
- }
- layerWorld = new SuperMap.Layer.TiledDynamicRESTLayer("World", url, {
- transparent: true,
- cacheEnabled: true
- }, {maxResolution: "auto"}); //获取图层服务地址
- layerWorld.events.on({"layerInitialized": addLayer});
- //将地图加入map
- function addLayer() {
- map.addLayer(layerWorld);
- map.setCenter(new SuperMap.LonLat(0, 0), 2);
- }
- </script>
- </body>
- </html>
|