geoip-html.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c)2013-2020 ZeroTier, Inc.
  3. *
  4. * Use of this software is governed by the Business Source License included
  5. * in the LICENSE.TXT file in the project's root directory.
  6. *
  7. * Change Date: 2025-01-01
  8. *
  9. * On the date above, in accordance with the Business Source License, use
  10. * of this software will be governed by version 2.0 of the Apache License.
  11. */
  12. /****/
  13. #ifndef ZT_ROOT_GEOIP_HTML_H
  14. #define ZT_ROOT_GEOIP_HTML_H
  15. #define ZT_GEOIP_HTML_HEAD \
  16. "<!DOCTYPE html>\n" \
  17. "<html>\n" \
  18. " <head>\n" \
  19. " <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\">\n" \
  20. " <meta charset=\"utf-8\">\n" \
  21. " <meta name=\"referrer\" content=\"no-referrer\">\n" \
  22. " <title>GeoIP Map</title>\n" \
  23. " <style>\n" \
  24. " #map {\n" \
  25. " height: 100%;\n" \
  26. " }\n" \
  27. " html, body {\n" \
  28. " height: 100%;\n" \
  29. " width: 100%;\n" \
  30. " margin: 0;\n" \
  31. " padding: 0;\n" \
  32. " }\n" \
  33. " </style>\n" \
  34. " </head>\n" \
  35. " <body>\n" \
  36. " <div id=\"map\"></div>\n" \
  37. " <script>\n" \
  38. " function initMap() {\n" \
  39. " var map = new google.maps.Map(document.getElementById('map'), {\n" \
  40. " center: {lat: 0, lng: 0},\n" \
  41. " zoom: 3\n" \
  42. " });\n" \
  43. " var markers = locations.map(function(location,i) {\n" \
  44. " var lbl = location._l||\"\";\n" \
  45. " delete location._l;\n" \
  46. " return new google.maps.Marker({\n" \
  47. " position: location,\n" \
  48. " label: lbl\n" \
  49. " });\n" \
  50. " });\n" \
  51. " var markerCluster = new MarkerClusterer(map,markers,{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m',maxZoom:13,minimumClusterSize:2,zoomOnClick:true});\n" \
  52. " }\n" \
  53. " var locations = ["
  54. #define ZT_GEOIP_HTML_TAIL \
  55. "];\n" \
  56. " </script>\n" \
  57. " <script src=\"https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js\">\n" \
  58. " </script>\n" \
  59. " <script async defer\n" \
  60. " src=\"https://maps.googleapis.com/maps/api/js?key=%s&callback=initMap\">\n" \
  61. " </script>\n" \
  62. " </body>\n" \
  63. "</html>"
  64. #endif