{"id":16,"date":"2016-01-29T21:09:39","date_gmt":"2016-01-29T21:09:39","guid":{"rendered":"http:\/\/www.acarlosmagro.com.pt\/?page_id=16"},"modified":"2016-01-29T21:09:54","modified_gmt":"2016-01-29T21:09:54","slug":"16-2","status":"publish","type":"page","link":"http:\/\/www.acarlosmagro.com.pt\/?page_id=16","title":{"rendered":"Onde Estamos"},"content":{"rendered":"\t\t\t\t\t<div id=\"huge_it_google_map91724_container\">\r\n\t\t\t\t\t\t<div id=\"huge_it_google_map91724\" style=\"position:relative !important;height:300px; width:100%;\r\n\t\t\t\t\t\tborder-radius:0px !important; \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmargin:0px auto !important;\r\n\t\t\t\t\t\t\t\t\tfloat:none;\r\n\t\t\t\t\t\t\t\t\" >\r\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\t\t\t#huge_it_google_map91724 img {\r\n\t\t\t\t\t\t\t\tmax-width: none;\r\n                                                                visibility:visible !important;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t<\/style>\r\n\t\t\t\t\t<script>\r\n\t\t\t\t\t\tjQuery(document).ready(function(){\r\n\t\t\t\t\t\t\tvar marker = [];\r\n\t\t\t\t\t\t\tvar polygone=[];\r\n\t\t\t\t\t\t\tvar polyline = [];\r\n\t\t\t\t\t\t\tvar polylinepoints;\r\n\t\t\t\t\t\t\tvar newpolylinecoords = [];\r\n\t\t\t\t\t\t\tvar polygonpoints;\r\n\t\t\t\t\t\t\tvar polygoncoords = [];\r\n\t\t\t\t\t\t\tvar newcircle=[];\r\n\t\t\t\t\t\t\tvar infowindow = [];\r\n\t\t\t\t\t\t\tvar newcirclemarker=[];\r\n\t\t\t\t\t\t\tvar circlepoint;\r\n\t\t\t\t\t\t\tvar width = jQuery(\"#huge_it_google_map91724\").width();\r\n\t\t\t\t\t\t\tvar height = jQuery(\"#huge_it_google_map91724\").height();\r\n\t\t\t\t\t\t\tfunction bindInfoWindow(marker, map, infowindow, description, info_type){\r\n\t\t\t\t\t\t\t\tgoogle.maps.event.addListener(marker, 'click', function() {\r\n\t\t\t\t\t\t\t\t\tinfowindow.setContent(description);\r\n\t\t\t\t\t\t\t\t\tinfowindow.open(map, marker);\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tjQuery(document).on(\"click tap drag scroll\",function(e){\r\n\t\t\t\t\t\t\t\tif(window.matchMedia('(max-width:768px)').matches){\r\n\t\t\t\t\t\t\t\t\tvar container = jQuery(\"#huge_it_google_map91724\");\r\n\t\t\t\t\t\t\t\t\tif (!container.is(e.target) && container.has(e.target).length === 0){\r\n\t\t\t\t\t\t\t\t\t\tfront_end_map.setOptions({\r\n\t\t\t\t\t\t\t\t\t\t\tdraggable:false,\r\n\t\t\t\t\t\t\t\t\t\t\tscrollwheel: false,\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\tfront_end_map.setOptions({\r\n\t\t\t\t\t\t\t\t\t\t\tdraggable:true,\r\n\t\t\t\t\t\t\t\t\t\t\tscrollwheel: true,\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\tvar div = parseInt(width)\/parseInt(height);\r\n\t\t\t\t\t\t\tjQuery(window).on(\"resize\",function(){\r\n\t\t\t\t\t\t\t\tvar newwidth = jQuery(\"#huge_it_google_map91724\").width();\r\n\t\t\t\t\t\t\t\tvar newheight = parseInt(newwidth)\/parseInt(div)+\"px\";\r\n\t\t\t\t\t\t\t\tjQuery(\"#huge_it_google_map91724\").height(newheight);\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar center_lat = 38.8412752;\r\n\t\t\t\t\t\t\tvar center_lng = -7.582255000000032;\r\n\t\t\t\t\t\t\tvar center_coords = new google.maps.LatLng(center_lat,center_lng);\r\n\t\t\t\t\t\t\tvar frontEndMapOptions = {\r\n\t\t\t\t\t\t\t\tzoom:parseInt(16),\r\n\t\t\t\t\t\t\t\tcenter: center_coords,\r\n\t\t\t\t\t\t\t\tdisableDefaultUI: true,\r\n\t\t\t\t\t\t\t\tpanControl: true,\r\n\t\t\t\t\t\t\t\tzoomControl: true,\r\n\t\t\t\t\t\t\t\tmapTypeControl: true,\r\n\t\t\t\t\t\t\t\tscaleControl: true,\r\n\t\t\t\t\t\t\t\tstreetViewControl: true,\r\n\t\t\t\t\t\t\t\toverviewMapControl: true,\r\n\t\t\t\t\t\t\t\tmapTypeId : google.maps.MapTypeId.ROADMAP,\r\n\t\t\t\t\t\t\t\tminZoom:0,\r\n\t\t\t\t\t\t\t\tmaxZoom:22\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvar front_end_map = new google.maps.Map(document.getElementById('huge_it_google_map91724'),frontEndMapOptions)\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(window.matchMedia('(max-width:768px)').matches){\r\n\t\t\t\t\t\t\t\tfront_end_map.setOptions({\r\n\t\t\t\t\t\t\t\t\tdraggable:false,\r\n\t\t\t\t\t\t\t\t\tscrollwheel:false,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tfront_end_map.setOptions({\r\n\t\t\t\t\t\t\t\t\tdraggable:true,\r\n\t\t\t\t\t\t\t\t\tscrollwheel:true,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar front_end_data= {\r\n\t\t\t\t\t\t\t\taction: 'g_map_options',\r\n\t\t\t\t\t\t\t\ttask:\"getxml\",\r\n\t\t\t\t\t\t\t\tmap_id:1,\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tjQuery.post(\"http:\/\/www.acarlosmagro.com.pt\/wp-admin\/admin-ajax.php\", front_end_data, function(response){\r\n\t\t\t\t\t\t\t\tif(response.success)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tvar xml = jQuery.parseXML(response.success);\r\n\t\t\t\t\t\t\t\t\tvar markers = xml.documentElement.getElementsByTagName(\"marker\");\r\n\t\t\t\t\t\t\t\t\tfor(var i = 0; i < markers.length; i++)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tvar name = markers[i].getAttribute(\"name\");\r\n\t\t\t\t\t\t\t\t\t\tvar address = markers[i].getAttribute(\"address\");\r\n\t\t\t\t\t\t\t\t\t\tvar anim = markers[i].getAttribute(\"animation\");\r\n\t\t\t\t\t\t\t\t\t\tvar description = markers[i].getAttribute(\"description\");\r\n\t\t\t\t\t\t\t\t\t\tvar point = new google.maps.LatLng(\r\n\t\t\t\t\t\t\t\t\t\t\tparseFloat(markers[i].getAttribute(\"lat\")),\r\n\t\t\t\t\t\t\t\t\t\t\tparseFloat(markers[i].getAttribute(\"lng\")));\r\n\t\t\t\t\t\t\t\t\t\tvar html = \"<b>\" + name + \"<\/b> <br\/>\" + address;\r\n\t\t\t\t\t\t\t\t\t\tif(anim == 'DROP'){\r\n\t\t\t\t\t\t\t\t\t\t\tmarker[i] = new google.maps.Marker({\r\n\t\t\t\t\t\t\t\t\t\t\tmap: front_end_map,\r\n\t\t\t\t\t\t\t\t\t\t\tposition: point,\r\n\t\t\t\t\t\t\t\t\t\t\ttitle: name,\r\n\t\t\t\t\t\t\t\t\t\t\tcontent: description,\r\n\t\t\t\t\t\t\t\t\t\t\tanimation: google.maps.Animation.DROP,\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif(anim == 'BOUNCE'){\r\n\t\t\t\t\t\t\t\t\t\tmarker[i] = new google.maps.Marker({\r\n\t\t\t\t\t\t\t\t\t\t\tmap: front_end_map,\r\n\t\t\t\t\t\t\t\t\t\t\tposition: point,\r\n\t\t\t\t\t\t\t\t\t\t\ttitle: name,\r\n\t\t\t\t\t\t\t\t\t\t\tcontent: description,\r\n\t\t\t\t\t\t\t\t\t\t\tanimation: google.maps.Animation.BOUNCE\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif(anim == 'NONE'){\r\n\t\t\t\t\t\t\t\t\t\t\tmarker[i] = new google.maps.Marker({\r\n\t\t\t\t\t\t\t\t\t\t\t\tmap: front_end_map,\r\n\t\t\t\t\t\t\t\t\t\t\t\tposition: point,\r\n\t\t\t\t\t\t\t\t\t\t\t\tcontent: description,\r\n\t\t\t\t\t\t\t\t\t\t\t\ttitle: name,\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tinfowindow[i] = new google.maps.InfoWindow;\r\n\t\t\t\t\t\t\t\t\t\tbindInfoWindow(marker[i], front_end_map, infowindow[i], description, \"click\");\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tvar polygones = xml.documentElement.getElementsByTagName(\"polygone\");\r\n\t\t\t\t\t\t\t\t\tfor(var i = 0; i < polygones.length; i++)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tvar name = polygones[i].getAttribute(\"name\");\r\n\t\t\t\t\t\t\t\t\t\tvar line_opacity = polygones[i].getAttribute(\"line_opacity\");\r\n\t\t\t\t\t\t\t\t\t\tvar line_color = \"#\"+polygones[i].getAttribute(\"line_color\");\r\n\t\t\t\t\t\t\t\t\t\tvar fill_opacity = polygones[i].getAttribute(\"fill_opacity\");\r\n\t\t\t\t\t\t\t\t\t\tvar line_width = polygones[i].getAttribute(\"line_width\");\r\n\t\t\t\t\t\t\t\t\t\tvar fill_color = \"#\"+polygones[i].getAttribute(\"fill_color\");\r\n\t\t\t\t\t\t\t\t\t\tvar latlngs = polygones[i].getElementsByTagName(\"latlng\");\r\n\t\t\t\t\t\t\t\t\t\tpolygoncoords = [];\r\n\t\t\t\t\t\t\t\t\t\tfor(var j = 0; j < latlngs.length; j++)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tpolygonpoints = new google.maps.LatLng(parseFloat(latlngs[j].getAttribute(\"lat\")),\r\n\t\t\t\t\t\t\t\t\t\t\t\tparseFloat(latlngs[j].getAttribute(\"lng\")))\r\n\t\t\t\t\t\t\t\t\t\t\tpolygoncoords.push(polygonpoints)\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\/\/alert(polygoncoords);\r\n\t\t\t\t\t\t\t\t\t\tpolygone[i] = new google.maps.Polygon({\r\n\t\t\t\t\t\t\t\t\t\t\tpaths : polygoncoords,\r\n\t\t\t\t\t\t\t\t\t\t\tmap: front_end_map,\r\n\t\t\t\t\t\t\t\t\t\t\tstrokeOpacity: line_opacity,\r\n\t\t\t\t\t\t\t\t\t\t\tstrokeColor:line_color,\r\n\t\t\t\t\t\t\t\t\t\t\tstrokeWeight:line_width,\r\n\t\t\t\t\t\t\t\t\t\t\tfillOpacity:fill_opacity,\r\n\t\t\t\t\t\t\t\t\t\t\tfillColor:fill_color,\r\n\t\t\t\t\t\t\t\t\t\t\tdraggable:false,\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tvar polylines = xml.documentElement.getElementsByTagName(\"polyline\");\r\n\t\t\t\t\t\t\t\t\tfor(var i = 0; i< polylines.length; i++)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tvar name = polylines[i].getAttribute(\"name\");\r\n\t\t\t\t\t\t\t\t\t\tvar line_opacity = polylines[i].getAttribute(\"line_opacity\");\r\n\t\t\t\t\t\t\t\t\t\tvar line_color = polylines[i].getAttribute(\"line_color\");\r\n\t\t\t\t\t\t\t\t\t\tvar line_width = polylines[i].getAttribute(\"line_width\");\r\n\t\t\t\t\t\t\t\t\t\tvar latlngs = polylines[i].getElementsByTagName(\"latlng\");\r\n\t\t\t\t\t\t\t\t\t\tnewpolylinecoords =[];\r\n\t\t\t\t\t\t\t\t\t\tfor(var j = 0; j < latlngs.length; j++)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tpolylinepoints = new google.maps.LatLng(parseFloat(latlngs[j].getAttribute(\"lat\")),\r\n\t\t\t\t\t\t\t\t\t\t\t\tparseFloat(latlngs[j].getAttribute(\"lng\")))\r\n\t\t\t\t\t\t\t\t\t\t\tnewpolylinecoords.push(polylinepoints)\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tpolyline[i] = new google.maps.Polyline({\r\n\t\t\t\t\t\t\t\t\t\t\tpath:newpolylinecoords,\r\n\t\t\t\t\t\t\t\t\t\t\tmap:front_end_map,\r\n\t\t\t\t\t\t\t\t\t\t\tstrokeColor:\"#\"+line_color,\r\n\t\t\t\t\t\t\t\t\t\t\tstrokeOpacity:line_opacity,\r\n\t\t\t\t\t\t\t\t\t\t\tstrokeWeight:line_width,\r\n\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tvar circles = xml.documentElement.getElementsByTagName(\"circle\");\r\n\t\t\t\t\t\t\t\t\tfor(var i = 0; i< circles.length; i++)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tvar circle_name =circles[i].getAttribute(\"name\");\r\n\t\t\t\t\t\t\t\t\t\tvar circle_center_lat = circles[i].getAttribute(\"center_lat\");\r\n\t\t\t\t\t\t\t\t\t\tvar circle_center_lng = circles[i].getAttribute(\"center_lng\");\r\n\t\t\t\t\t\t\t\t\t\tvar circle_radius = circles[i].getAttribute(\"radius\");\r\n\t\t\t\t\t\t\t\t\t\tvar circle_line_width = circles[i].getAttribute(\"line_width\");\r\n\t\t\t\t\t\t\t\t\t\tvar circle_line_color = circles[i].getAttribute(\"line_color\");\r\n\t\t\t\t\t\t\t\t\t\tvar circle_line_opacity = circles[i].getAttribute(\"line_opacity\");\r\n\t\t\t\t\t\t\t\t\t\tvar circle_fill_color = circles[i].getAttribute(\"fill_color\");\r\n\t\t\t\t\t\t\t\t\t\tvar circle_fill_opacity = circles[i].getAttribute(\"fill_opacity\");\r\n\t\t\t\t\t\t\t\t\t\tvar circle_show_marker = parseInt(circles[i].getAttribute(\"show_marker\"));\r\n\t\t\t\t\t\t\t\t\t\tcirclepoint = new google.maps.LatLng(parseFloat(circles[i].getAttribute(\"center_lat\")),\r\n\t\t\t\t\t\t\t\t\t\tparseFloat(circles[i].getAttribute(\"center_lng\")));\r\n\t\t\t\t\t\t\t\t\t\tnewcircle[i] = new google.maps.Circle({\r\n\t\t\t\t\t\t\t\t\t\t\tmap:front_end_map,\r\n\t\t\t\t\t\t\t\t\t\t\tcenter:circlepoint,\r\n\t\t\t\t\t\t\t\t\t\t\ttitle:name,\r\n\t\t\t\t\t\t\t\t\t\t\tradius:parseInt(circle_radius),\r\n\t\t\t\t\t\t\t\t\t\t\tstrokeColor:\"#\"+circle_line_color,\r\n\t\t\t\t\t\t\t\t\t\t\tstrokeOpacity:circle_line_opacity,\r\n\t\t\t\t\t\t\t\t\t\t\tstrokeWeight:circle_line_width,\r\n\t\t\t\t\t\t\t\t\t\t\tfillColor:\"#\"+circle_fill_color,\r\n\t\t\t\t\t\t\t\t\t\t\tfillOpacity:circle_fill_opacity\r\n\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t\tif(circle_show_marker == '1')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tnewcirclemarker[i] = new google.maps.Marker({\r\n\t\t\t\t\t\t\t\t\t\t\t\tposition:circlepoint,\r\n\t\t\t\t\t\t\t\t\t\t\t\tmap:front_end_map,\r\n\t\t\t\t\t\t\t\t\t\t\t\ttitle:circle_name,\r\n\t\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t},\"json\")\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t<\/script>\r\n\t\t\t\t\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-16","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.acarlosmagro.com.pt\/index.php?rest_route=\/wp\/v2\/pages\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.acarlosmagro.com.pt\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.acarlosmagro.com.pt\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.acarlosmagro.com.pt\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.acarlosmagro.com.pt\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16"}],"version-history":[{"count":2,"href":"http:\/\/www.acarlosmagro.com.pt\/index.php?rest_route=\/wp\/v2\/pages\/16\/revisions"}],"predecessor-version":[{"id":18,"href":"http:\/\/www.acarlosmagro.com.pt\/index.php?rest_route=\/wp\/v2\/pages\/16\/revisions\/18"}],"wp:attachment":[{"href":"http:\/\/www.acarlosmagro.com.pt\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}