index.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>P4A web - HS Layers</title>
  6. <meta name="description" content="">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  8. <meta name="apple-mobile-web-app-capable" content="yes" />
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
  10. </head>
  11. <body>
  12. <div style="height:30em; width: 100%">
  13. <div id="hs-app" hs ng-app="hs" ng-controller="Main" style="position: relative; width: 100%; height: 100%; padding: 0; border: 0; margin: 0;"> </div>
  14. </div>
  15. <script>
  16. function styleFunction(feature, number) {
  17. console.log(feature.get('Name'));
  18. if(feature.get('Name')) {
  19. return new ol.style.Style({
  20. fill: new ol.style.Fill({
  21. color: 'rgba(255, 128, 123, 0.2)'
  22. }),
  23. stroke: new ol.style.Stroke({
  24. color: '#e49905',
  25. width: 2
  26. }),
  27. image: new ol.style.Circle({
  28. fill: new ol.style.Fill({
  29. color: 'rgba(255, 128, 123, 0.2)'
  30. }),
  31. stroke: new ol.style.Stroke({
  32. color: '#e49905',
  33. width: 2
  34. }),
  35. radius: 5
  36. }),
  37. });
  38. } else {
  39. return new ol.style.Style({
  40. fill: new ol.style.Fill({
  41. color: 'rgba(255, 0, 0, 0.2)'
  42. }),
  43. stroke: new ol.style.Stroke({
  44. color: '#e41905',
  45. width: 2
  46. }),
  47. image: new ol.style.Circle({
  48. fill: new ol.style.Fill({
  49. color: 'rgba(255, 0, 0, 0.2)'
  50. }),
  51. stroke: new ol.style.Stroke({
  52. color: '#e41905',
  53. width: 2
  54. }),
  55. radius: 5
  56. }),
  57. });
  58. }
  59. }
  60. function getLRUser() {
  61. return (0);
  62. }
  63. function hslayersNgConfig(ol) {
  64. return {
  65. sizeMode: "container",
  66. sidebarClosed: true,
  67. useIsolatedBootstrap: true,
  68. useProxy: true,
  69. //proxyPrefix: "/proxy/",
  70. panelsEnabled: {
  71. composition_browser: false,
  72. toolbar: false,
  73. mobile_settings: true,
  74. draw: false,
  75. datasource_selector: false,
  76. layermanager: false,
  77. print: true,
  78. saveMap: false,
  79. language: false,
  80. permalink: false,
  81. feature_crossfilter: false,
  82. compositionLoadingProgress: false
  83. },
  84. default_layers: [
  85. new ol.layer.Tile({
  86. source: new ol.source.OSM({
  87. url: 'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png'
  88. }),
  89. title: "Wikimedia Map",
  90. base: true,
  91. visible: true,
  92. removable: false
  93. }),
  94. new ol.layer.Vector({
  95. title: "Partners",
  96. style: styleFunction,
  97. hoveredKeys: ['Name', 'description'],
  98. hoveredKeysTranslations: {'Name': 'Name', 'description': 'Description'},
  99. source: new ol.source.Vector({
  100. format: new ol.format.GeoJSON(),
  101. url: "./data/Plan4All_Members.geojson" //"https://raw.githubusercontent.com/jmacura/testing/master/partners-dummy.geojson"
  102. }),
  103. cluster: true
  104. })
  105. ],
  106. default_view: new ol.View({
  107. center: ol.proj.transform([17.474129, 52.574000], 'EPSG:4326', 'EPSG:3857'),
  108. zoom: 4,
  109. units: "m"
  110. }),
  111. locationButtonVisible: false
  112. }
  113. }
  114. </script>
  115. <script src="./lib/hslayers-ng.js"></script> <!-- https://publish.lesprojekt.cz/vhs/dist/hslayers-ng.js -->
  116. </body>
  117. </html>