123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <!--********************************************************************
- * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- *********************************************************************-->
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title data-i18n="resources.title_changeControlsSkin"></title>
- <style type="text/css">
- .editPane {
- position: absolute;
- right: 50px;
- top: 50px;
- text-align: center;
- background: #FFF;
- z-index: 1000;
- }
- </style>
- </head>
- <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
- <div class='panel panel-primary editPane' id='editPane' style="z-index: 99999">
- <div class='panel-heading'>
- <h5 class='panel-title text-center' data-i18n="resources.text_changeControlsSkin"></h5>
- </div>
- <div class='panel-body' id='params'>
- <div align='center' class='button-group'>
- <input type='button' id='btn1' class='btn btn-primary' data-i18n="[value]resources.text_input_value_change" onclick="changeSkin()"/>
- </div>
- </div>
- </div>
- <div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
- <script type="text/javascript" include="bootstrap" 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 map, layer,
- host = window.isLocal ? window.server : "https://iserver.supermap.io",
- url = host + "/iserver/services/map-china400/rest/maps/China";
- function addMap() {
- //初始化地图
- map = new SuperMap.Map("map", {
- controls: [
- new SuperMap.Control.Navigation(),
- new SuperMap.Control.OverviewMap,
- new SuperMap.Control.Zoom()
- ]
- });
- //初始化图层
- layer = new SuperMap.Layer.TiledDynamicRESTLayer("China", url, null, {maxResolution: "auto"});
- //监听图层信息加载完成事件
- layer.events.on({"layerInitialized": addLayer});
- }
- addMap();
- //异步加载图层
- function addLayer() {
- map.addLayer(layer);
- map.setCenter(new SuperMap.LonLat(0, 0), 4);
- }
- //切换LayerSwitcher OverviewMap Zoom Skin风格 系统提供白色和蓝色两种配色方案,系统默认为白色
- function changeSkin() {
- map.destroy();
- SuperMap.Control.SKIN = SuperMap.Control.SKIN === "BLUE" ? "WHITE" : "BLUE";
- addMap();
- }
- </script>
- </body>
- </html>
|