File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 3535
3636 // 方式一:1.调用 mapboxgl.supermap.initMap,根据 SuperMap iServer 地图服务的地图信息,创建地图和底图
3737 mapboxgl . supermap
38- . initMap ( host + '/iserver/services/map-china/rest/maps/China' )
38+ . initMap ( host + '/iserver/services/map-china/rest/maps/China' , { mapOptions : { zoom : 4 } } )
3939 . then ( function ( result ) {
4040 var map = result . map ;
4141 map . addControl ( new mapboxgl . NavigationControl ( ) , 'top-left' ) ;
Original file line number Diff line number Diff line change 1212< body style =" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%; position: absolute;top: 0; ">
1313< div id ="map " style ="width: 100%;height:100% "> </ div >
1414< script type ="text/javascript ">
15- var resolutions = new Array ( 17 ) ;
16- var matrixIds = new Array ( 17 ) ;
17- for ( var z = 0 ; z < 17 ; ++ z ) {
18- resolutions [ z ] = 156543.033928041 / Math . pow ( 2 , z ) ;
19- matrixIds [ z ] = z ;
20- }
2115 var map = new ol . Map ( {
2216 target : 'map' ,
2317 // ol v7版本用法为ol.control.defaults.defaults; v6版本以下用法为ol.control.defaults
2418 controls : ol . control . defaults . defaults ( { attributionOptions : { collapsed : false } } )
2519 . extend ( [ new ol . supermap . control . Logo ( { link : "https://iclient.supermap.io" } ) ] ) ,
2620 view : new ol . View ( {
27- center : [ 0 , 0 ] ,
28- zoom : 0 ,
21+ center : [ 12782862.935188107 , 4544498.746315297 ] ,
22+ zoom : 5 ,
2923 multiWorld : true
3024 } ) ,
3125 layers : [ new ol . layer . Tile ( {
Original file line number Diff line number Diff line change 2424 controls : ol . control . defaults . defaults ( { attributionOptions : { collapsed : false } } )
2525 . extend ( [ new ol . supermap . control . Logo ( { link : "https://iclient.supermap.io" } ) ] ) ,
2626 view : new ol . View ( {
27- center : [ 0 , 0 ] ,
28- zoom : 0 ,
27+ center : [ 12782862.935188107 , 4544498.746315297 ] ,
28+ zoom : 5 ,
2929 multiWorld : true
3030 } ) ,
3131 layers : [ new ol . layer . Tile ( {
You can’t perform that action at this time.
0 commit comments