geoip-html.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef ZT_ROOT_GEOIP_HTML_H
  2. #define ZT_ROOT_GEOIP_HTML_H
  3. #define ZT_GEOIP_HTML_HEAD \
  4. "<!DOCTYPE html>\n" \
  5. "<html>\n" \
  6. " <head>\n" \
  7. " <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\">\n" \
  8. " <meta charset=\"utf-8\">\n" \
  9. " <title>GeoIP Map</title>\n" \
  10. " <style>\n" \
  11. " #map {\n" \
  12. " height: 100%;\n" \
  13. " }\n" \
  14. " html, body {\n" \
  15. " height: 100%;\n" \
  16. " width: 100%;\n" \
  17. " margin: 0;\n" \
  18. " padding: 0;\n" \
  19. " }\n" \
  20. " </style>\n" \
  21. " </head>\n" \
  22. " <body>\n" \
  23. " <div id=\"map\"></div>\n" \
  24. " <script>\n" \
  25. "\n" \
  26. " function initMap() {\n" \
  27. " var map = new google.maps.Map(document.getElementById('map'), {\n" \
  28. " zoom: 3\n" \
  29. " });\n" \
  30. " var markers = locations.map(function(location,i) {\n" \
  31. " return new google.maps.Marker({\n" \
  32. " position: location,\n" \
  33. " label: location._l\n" \
  34. " });\n" \
  35. " });\n" \
  36. "\n" \
  37. " var markerCluster = new MarkerClusterer(map,markers,{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});\n" \
  38. " }\n" \
  39. " var locations = ["
  40. #define ZT_GEOIP_HTML_TAIL \
  41. "];\n" \
  42. " </script>\n" \
  43. " <script src=\"https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js\">\n" \
  44. " </script>\n" \
  45. " <script async defer\n" \
  46. " src=\"https://maps.googleapis.com/maps/api/js?callback=initMap\">\n" \
  47. " </script>\n" \
  48. " </body>\n" \
  49. "</html>"
  50. #endif