map-google.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. (function (global, factory) {
  2. if (typeof define === "function" && define.amd) {
  3. define("/pages/map-google", ["jquery", "Site"], factory);
  4. } else if (typeof exports !== "undefined") {
  5. factory(require("jquery"), require("Site"));
  6. } else {
  7. var mod = {
  8. exports: {}
  9. };
  10. factory(global.jQuery, global.Site);
  11. global.pagesMapGoogle = mod.exports;
  12. }
  13. })(this, function (_jquery, _Site) {
  14. "use strict";
  15. _jquery = babelHelpers.interopRequireDefault(_jquery);
  16. (0, _jquery.default)(document).ready(function () {
  17. (0, _Site.run)();
  18. var map = new GMaps({
  19. el: '#gmap',
  20. lat: -12.043333,
  21. lng: -77.028333,
  22. zoomControl: true,
  23. zoomControlOpt: {
  24. style: "SMALL",
  25. position: "TOP_LEFT"
  26. },
  27. panControl: true,
  28. streetViewControl: false,
  29. mapTypeControl: false,
  30. overviewMapControl: false
  31. });
  32. map.drawOverlay({
  33. lat: -12.043333,
  34. lng: -77.028333,
  35. content: '<i class="wb-map" style="font-size:40px;color:' + Config.colors("red", 500) + ';"></i>'
  36. });
  37. map.drawOverlay({
  38. lat: -12.05449279282314,
  39. lng: -77.04333,
  40. content: '<i class="wb-map" style="font-size:32px;color:' + Config.colors("primary", 500) + ';"></i>'
  41. });
  42. map.addStyle({
  43. styledMapName: "Styled Map",
  44. styles: Plugin.getDefaults('gmaps', 'styles'),
  45. mapTypeId: "map_style"
  46. });
  47. map.setStyle("map_style");
  48. var path = [[-12.044012922866312, -77.02470665341184], [-12.05449279282314, -77.03024273281858], [-12.055122327623378, -77.03039293652341], [-12.075917129727586, -77.02764635449216], [-12.07635776902266, -77.02792530422971], [-12.076819390363665, -77.02893381481931], [-12.088527520066453, -77.0241058385925], [-12.090814532191756, -77.02271108990476]];
  49. map.drawPolyline({
  50. path: path,
  51. strokeColor: '#131540',
  52. strokeOpacity: 0.6,
  53. strokeWeight: 6
  54. });
  55. });
  56. });