88< body style =" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100% ">
99< div id ="map " style ="width: 100%;height:100% "> </ div >
1010< script type ="text/javascript ">
11- var map , url = ( window . isLocal ? window . server : "http://support.supermap.com.cn:8090" ) + "/iserver/services/map-jingjin/rest/maps/京津地区地图" ;
12- new ol . supermap . MapService ( url ) . getMapInfo ( function ( serviceResult ) {
13- var mapJSONObj = serviceResult . result ;
14- map = new ol . Map ( {
15- target : 'map' ,
16- controls : ol . control . defaults ( { attributionOptions : { collapsed : false } } )
17- . extend ( [ new ol . supermap . control . Logo ( ) ] ) ,
18- view : new ol . View ( {
19- extent :[ 114.59 , 37.7 , 119.51 , 42.31 ] ,
20- center : [ 116.85 , 39.79 ] ,
21- zoom : 0 ,
22- projection : 'EPSG:4326'
23- } )
24- } ) ;
25- options = ol . source . TileSuperMapRest . optionsFromMapJSON ( url , mapJSONObj ) ;
26- var layer = new ol . layer . Tile ( {
27- source : new ol . source . TileSuperMapRest ( options )
28- } ) ;
29- map . addLayer ( layer ) ;
11+ var map , url = ( window . isLocal ? window . server : "http://support.supermap.com.cn:8090" ) + "/iserver/services/map-world/rest/maps/World" ;
12+ map = new ol . Map ( {
13+ target : 'map' ,
14+ controls : ol . control . defaults ( { attributionOptions : { collapsed : false } } )
15+ . extend ( [ new ol . supermap . control . Logo ( ) ] ) ,
16+ view : new ol . View ( {
17+ center : [ 0 , 0 ] ,
18+ zoom : 2 ,
19+ projection : 'EPSG:4326'
20+ } )
3021 } ) ;
22+ var layer = new ol . layer . Tile ( {
23+ source : new ol . source . TileSuperMapRest ( {
24+ url : url ,
25+ wrapX : true
26+ } ) ,
27+ projection : 'EPSG:4326'
28+ } ) ;
29+ map . addLayer ( layer ) ;
3130</ script >
3231</ body >
3332</ html >
0 commit comments