{"id":511,"date":"2017-07-02T11:50:07","date_gmt":"2017-07-02T11:50:07","guid":{"rendered":"http:\/\/xtratheme.com\/building\/?page_id=511"},"modified":"2017-07-02T11:50:07","modified_gmt":"2017-07-02T11:50:07","slug":"google-map","status":"publish","type":"page","link":"https:\/\/sangamindustries.com\/index.php\/google-map\/","title":{"rendered":"Google Map"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column]<div id=\"cz_15206\" class=\"cz_15206 gmap\" data-api-key=\"AIzaSyBtD89e_63nmA6xcZWW4y0s5Ll9HPTCvVQ\"> <\/div><div ><\/div><script>\r\n\r\n\t\tfunction mapfunction_cz_15206() {\r\n\r\n\t\t\tconst codevzPlusWaitForOverlay = setInterval(() => {\r\n\r\n\t\t\t\tif (typeof google.maps.OverlayView !== \"undefined\") {\r\n\r\n\t\t\t\t\tclearInterval(codevzPlusWaitForOverlay);\r\n\r\n\t\t\t\t\tgoogle.maps.Map.prototype.setCenterWithOffset = function(latlng, offsetX, offsetY) {\r\n\t\t\t\t\t    var map = this;\r\n\t\t\t\t\t    var ov = new google.maps.OverlayView();\r\n\t\t\t\t\t    ov.onAdd = function() {\r\n\t\t\t\t\t        var proj = this.getProjection();\r\n\t\t\t\t\t        var aPoint = proj.fromLatLngToContainerPixel(latlng);\r\n\t\t\t\t\t        aPoint.x = aPoint.x+offsetX;\r\n\t\t\t\t\t        aPoint.y = aPoint.y+offsetY;\r\n\t\t\t\t\t        map.setCenter(proj.fromContainerPixelToLatLng(aPoint));\r\n\t\t\t\t\t    }; \r\n\t\t\t\t\t    ov.draw = function() {}; \r\n\t\t\t\t\t    ov.setMap(this); \r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tvar windx = jQuery(window), \r\n\r\n\t\t\t\t\t\tlatlng = { lat:40.712784, lng:-74.005941},\r\n\r\n\t\t\t\t\t\tmyOptions = {\r\n\t\t\t\t\t\t\tmapId: \"\",\r\n\t\t\t\t\t\t\tzoom: 14,\r\n\t\t\t\t\t\t\tscrollwheel: false,\r\n\t\t\t\t\t\t\tdisableDefaultUI: false,\r\n\t\t\t\t\t\t\tcenter: latlng,\r\n\t\t\t\t\t\t\tfullscreenControl: false,\r\n\t\t\t\t\t\t\tmapTypeControl: false,\r\n\t\t\t\t\t\t\tkeyboardShortcuts: false\r\n\t\t\t\t\t\t},\r\n\r\n\t\t\t\t\t\tcz_15206 = new google.maps.Map(document.getElementById(\"cz_15206\"), myOptions ),\r\n\r\n\t\t\t\t\t\tsetCenterOffset = function() {\r\n\r\n\t\t\t\t\t\t\tif ( windx.width() < 768 ) {\r\n\t\t\t\t\t\t\t\tcz_15206.setCenterWithOffset( latlng, 0, 0 );\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcz_15206.setCenterWithOffset( latlng, 0, 0 );\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\tsetCenterOffset();\r\n\r\n\t\t\t\t\t\twindx.on( \"resize\", function() {\r\n\t\t\t\t\t\t\tsetCenterOffset();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\tvar styles = [{\"featureType\": \"all\",stylers: [{ hue: \"#efae16\" },{ saturation: -20}]}];var styledMap = new google.maps.StyledMapType(styles,{name: \"Styled Map\"});cz_15206.mapTypes.set(\"map_style\", styledMap);  cz_15206.setMapTypeId(\"map_style\");class CustomMarker extends google.maps.OverlayView {\r\n\t\t\t\t\t\t    constructor(position, map) {\r\n\t\t\t\t\t\t        super();\r\n\t\t\t\t\t\t        this.position = position;\r\n\t\t\t\t\t\t        this.map = map;\r\n\t\t\t\t\t\t        this.div = null;\r\n\t\t\t\t\t\t        this.setMap(map);\r\n\t\t\t\t\t\t    }\r\n\r\n\t\t\t\t\t\t    onAdd() {\r\n\t\t\t\t\t\t        this.div = document.createElement(\"div\");\r\n\t\t\t\t\t\t        this.div.style.position = \"absolute\";\r\n\t\t\t\t\t\t        this.div.style.cursor = \"pointer\";\r\n\t\t\t\t\t\t        this.div.style.transform = \"translate(-50%, -100%)\";\r\n\t\t\t\t\t\t        this.div.innerHTML = `<div style=\"position:relative; text-align:center;\">\r\n\t\t\t\t\t\t                                <div style=\"position:absolute;top: -10px;left: 50%;transform: translate(-50%, -100%);background: white;color: #202020;padding: 15px 20px;border-radius: 2px;font-size: 15px;white-space: nowrap;box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);display: none;font-family: Arial, sans-serif;\" class=\"tooltip\">\r\n\t\t\t\t\t\t                                \tConstruction Office\r\n\t\t\t\t\t\t                                <\/div>\r\n\t\t\t\t\t\t                                <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/sangamindustries.com\/wp-content\/uploads\/2018\/01\/pin-cons-1.png\" style=\"display:block;\" \/>\r\n\t\t\t\t\t\t                              <\/div>`;\r\n\r\n\t\t\t\t\t\t        this.getPanes().overlayMouseTarget.appendChild(this.div);\r\n\t\t\t\t\t\t        this.tooltip = this.div.querySelector(\".tooltip\");\r\n\r\n\t\t\t\t\t\t        \/\/ Show title on click\r\n\t\t\t\t\t\t        this.div.addEventListener(\"click\", (event) => {\r\n\t\t\t\t\t\t            event.stopPropagation();\r\n\t\t\t\t\t\t            this.tooltip.style.display = this.tooltip.style.display === \"block\" ? \"none\" : \"block\";\r\n\t\t\t\t\t\t        });\r\n\r\n\t\t\t\t\t\t        \/\/ Hide title when clicking outside\r\n\t\t\t\t\t\t        google.maps.event.addListener(this.map, \"click\", () => {\r\n\t\t\t\t\t\t            this.tooltip.style.display = \"none\";\r\n\t\t\t\t\t\t        });\r\n\t\t\t\t\t\t    }\r\n\r\n\t\t\t\t\t\t    draw() {\r\n\t\t\t\t\t\t        const overlayProjection = this.getProjection();\r\n\t\t\t\t\t\t        const position = overlayProjection.fromLatLngToDivPixel(this.position);\r\n\r\n\t\t\t\t\t\t        if (position && this.div) {\r\n\t\t\t\t\t\t            this.div.style.left = `${position.x}px`;\r\n\t\t\t\t\t\t            this.div.style.top = `${position.y}px`;\r\n\t\t\t\t\t\t        }\r\n\t\t\t\t\t\t    }\r\n\r\n\t\t\t\t\t\t    onRemove() {\r\n\t\t\t\t\t\t        if (this.div) {\r\n\t\t\t\t\t\t            this.div.parentNode.removeChild(this.div);\r\n\t\t\t\t\t\t            this.div = null;\r\n\t\t\t\t\t\t        }\r\n\t\t\t\t\t\t    }\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\/\/ Add a custom marker at a specific location\r\n\t\t\t\t\t\tnew CustomMarker(new google.maps.LatLng(40.712784, -74.005941), cz_15206);}}, 250 );}<\/script>[\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"[vc_row][vc_column] [\/vc_column][\/vc_row]","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-511","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sangamindustries.com\/index.php\/wp-json\/wp\/v2\/pages\/511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sangamindustries.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sangamindustries.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sangamindustries.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sangamindustries.com\/index.php\/wp-json\/wp\/v2\/comments?post=511"}],"version-history":[{"count":0,"href":"https:\/\/sangamindustries.com\/index.php\/wp-json\/wp\/v2\/pages\/511\/revisions"}],"wp:attachment":[{"href":"https:\/\/sangamindustries.com\/index.php\/wp-json\/wp\/v2\/media?parent=511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}