plot_plotSymbol.html 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!--********************************************************************
  2. * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  3. *********************************************************************-->
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <meta charset="UTF-8">
  8. <title data-i18n="resources.title_plotSymbol"></title>
  9. <style type="text/css">
  10. #map {
  11. position: absolute;
  12. left: 250px;
  13. right: 0px;
  14. height: 100%;
  15. }
  16. #plottingPanel {
  17. float: left;
  18. background: #ffffff;
  19. width: 250px;
  20. height: 100%;
  21. border: 1px solid #3473b7;
  22. }
  23. </style>
  24. </head>
  25. <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
  26. <div id="toolbar" class="panel panel-primary" style="position: absolute;top: 15px;right: 60px;text-align: center;z-index: 9999;border-radius: 4px;">
  27. <div class='panel-heading' id="panelheading">
  28. <h5 class='panel-title text-center' data-i18n="resources.title_plotSymbol" style=" color: #ffffff;font-size: 16px;"></h5></div>
  29. <div class='panel-body content' id="panelbodycontent" >
  30. <div align='right' class='button-group'>
  31. <input type="button" class="btn btn-default" data-i18n="[value]resources.btn_cancelMarker" onclick="PlottingDrawCancel()"/>&nbsp;&nbsp;
  32. <input type="button" class="btn btn-default" data-i18n="[value]resources.btn_clearPlot" onclick="clearLayers()"/>
  33. </div>
  34. </div>
  35. </div>
  36. <div id="plottingPanel">
  37. <div class="easyui-panel" style="position:absolute;top:0px;bottom:0px;left:0px;right:0px;padding:5px; width: 100%;">
  38. <div class="easyui-tabs" style="width: 100%;height: 100%">
  39. <div id="plotPanel" data-i18n="[title]resources.text_drawPanel" style="overflow: hidden"></div>
  40. </div>
  41. </div>
  42. </div>
  43. <div id="map">
  44. </div>
  45. <script type="text/javascript" include="bootstrap,plottingPanel" src="../js/include-web.js"></script>
  46. <script type="text/javascript" include="iclient-plot-leaflet" src="../../dist/leaflet/include-leaflet.js"></script>
  47. <script type="text/javascript" include="PlotPanel" src="../js/plottingPanel/PlottingPanel.Include.js"></script>
  48. <script type="text/javascript">
  49. var host = window.isLocal ? window.server : "https://iserver.supermap.io";
  50. var url = host + "/iserver/services/map-china400/rest/maps/China_4326";
  51. var serverUrl = host + "/iserver/services/plot-jingyong/rest/plot/";
  52. var map;
  53. map = L.map('map', {
  54. preferCanvas: true,
  55. crs: L.CRS.EPSG4326,
  56. center: [35, 104],
  57. maxZoom: 18,
  58. zoom: 3
  59. });
  60. L.supermap.tiledMapLayer(url).addTo(map);
  61. var plottingLayer = L.supermap.plotting.plottingLayer("plot", serverUrl);
  62. plottingLayer.spatialAnalystUrl=host+"/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst";
  63. plottingLayer.addTo(map);
  64. var drawControl = L.supermap.plotting.drawControl(plottingLayer);
  65. drawControl.addTo(map);
  66. var editControl = L.supermap.plotting.editControl();
  67. editControl.addTo(map);
  68. L.supermap.plotting.initPlotPanel("plotPanel", serverUrl, drawControl);
  69. function clearLayers(){
  70. plottingLayer.removeAllFeatures();
  71. }
  72. function PlottingDrawCancel(){
  73. drawControl.handler.disable();
  74. }
  75. $(document).ready(function(){
  76. $('#panelheading').click(function(){
  77. $('#panelbodycontent').toggle();
  78. });
  79. });
  80. </script>
  81. </body>
  82. </html>