1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <!--********************************************************************
- * 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"/>
- <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7,IE=9,IE=10,IE=11"/>
- <title data-i18n="resources.title_a0mapPrint"></title>
- <style type="text/css">
- .editPane {
- position: absolute;
- right: 180px;
- top: 10px;
- 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_a0mapPrint"></h5>
- </div>
- <div class='panel-body' id='params'>
- <p></p>
- <div align='center' class='button-group'>
- <input type='button' id='btn1' class='btn btn-primary' data-i18n="[value]resources.btn_a0Print"
- onclick="doLargeFormatPrint()"/>
- </div>
- </div>
- </div>
- <div id="map" style="margin:0 auto;width: 100%;height: 100%; position: relative;"></div>
- <script type="text/javascript" include="bootstrap,widgets.alert" src="../js/include-web.js"></script>
- <script type="text/javascript" exclude="iclient-classic" include="LargeFormatPrints"
- 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";
- //定义layer图层,TiledDynamicRESTLayer:分块动态 REST 图层
- layer = new SuperMap.Layer.TiledDynamicRESTLayer("China", url, {
- transparent: true,
- cacheEnabled: true
- }, {maxResolution: "auto", useCanvas: false});
- //为图层初始化完毕添加addLayer()事件
- layer.events.on({"layerInitialized": addLayer});
- map = new SuperMap.Map("map", {
- controls: [
- new SuperMap.Control.LayerSwitcher(),
- new SuperMap.Control.OverviewMap(),
- new SuperMap.Control.ScaleLine(),
- new SuperMap.Control.Zoom(),
- new SuperMap.Control.Navigation({
- dragPanOptions: {
- enableKinetic: true
- }
- })
- ]
- });
- function addLayer() {
- map.addLayers([layer]);
- map.setCenter(new SuperMap.LonLat(9733502.481499, 4614406.969325), 4);
- }
- //A0大幅打印
- function doLargeFormatPrint() {
- var broz = SuperMap.Browser.name;
- if (broz == 'msie' && parseInt(SuperMap.Browser.version) < 9) {
- widgets.alert.showAlert(resources.msg_supportPrint, false);
- return;
- }
- //map.div.style.display = "none";
- var center = map.getCenter();
- var scale = map.getScale();
- LargeFormatPrint && LargeFormatPrint.excute(url, "3857", scale, center, "A0", map);
- }
- </script>
- </body>
- </html>
|