gmaps.init.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /******/ (function() { // webpackBootstrap
  2. var __webpack_exports__ = {};
  3. /*!******************************************!*\
  4. !*** ./resources/js/pages/gmaps.init.js ***!
  5. \******************************************/
  6. /*
  7. Template Name: Skote - Admin & Dashboard Template
  8. Author: Themesbrand
  9. Website: https://themesbrand.com/
  10. Contact: themesbrand@gmail.com
  11. File: gmaps init Js File
  12. */
  13. var map;
  14. $(document).ready(function () {
  15. // Markers
  16. map = new GMaps({
  17. div: '#gmaps-markers',
  18. lat: -12.043333,
  19. lng: -77.028333
  20. });
  21. map.addMarker({
  22. lat: -12.043333,
  23. lng: -77.03,
  24. title: 'Lima',
  25. details: {
  26. database_id: 42,
  27. author: 'HPNeo'
  28. },
  29. click: function click(e) {
  30. if (console.log) console.log(e);
  31. alert('You clicked in this marker');
  32. }
  33. }); // Overlays
  34. map = new GMaps({
  35. div: '#gmaps-overlay',
  36. lat: -12.043333,
  37. lng: -77.028333
  38. });
  39. map.drawOverlay({
  40. lat: map.getCenter().lat(),
  41. lng: map.getCenter().lng(),
  42. content: '<div class="gmaps-overlay">Lima<div class="gmaps-overlay_arrow above"></div></div>',
  43. verticalAlign: 'top',
  44. horizontalAlign: 'center'
  45. }); //panorama
  46. map = GMaps.createPanorama({
  47. el: '#panorama',
  48. lat: 42.3455,
  49. lng: -71.0983
  50. }); //Map type
  51. map = new GMaps({
  52. div: '#gmaps-types',
  53. lat: -12.043333,
  54. lng: -77.028333,
  55. mapTypeControlOptions: {
  56. mapTypeIds: ["hybrid", "roadmap", "satellite", "terrain", "osm"]
  57. }
  58. });
  59. map.addMapType("osm", {
  60. getTileUrl: function getTileUrl(coord, zoom) {
  61. return "https://a.tile.openstreetmap.org/" + zoom + "/" + coord.x + "/" + coord.y + ".png";
  62. },
  63. tileSize: new google.maps.Size(256, 256),
  64. name: "OpenStreetMap",
  65. maxZoom: 18
  66. });
  67. map.setMapTypeId("osm");
  68. });
  69. /******/ })()
  70. ;