var map = null;
var markers = [];
var currentmarkers = [];
var mc = null;
var zoom = 13;
var currentlat = 37.38003665840841;
var currentlng = -5.9977734088897705;
var initialize = function(){
if (google.maps.BrowserIsCompatible()) {
// Display the map, with some controls and set the initial location
map = new google.maps.Map2(document.getElementById("map"));
map.enableDoubleClickZoom();
map.enableContinuousZoom();
map.enableScrollWheelZoom();
map.addControl(new google.maps.LargeMapControl());
map.removeMapType(G_SATELLITE_MAP);
map.addControl(new google.maps.MapTypeControl(true));
map.setCenter(new google.maps.LatLng(currentlat, currentlng), zoom);
setMarkers();
}
// display a warning if the browser was not compatible
else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}
}
function getLocalBubble(id, marker){
marker.openInfoWindowHtml("Cargando...");
jQuery.post("https://atapas.com/wp-content/themes/atapas/php/ajaxhandler.php", {"action": "mapbubble", "id": id}, function(data){
if(data.status=="ok"){
marker.openInfoWindowHtml(data.value);
}
}, "json");
}
function createMarker(id, lat, lng, iconsel){
var marker = new google.maps.Marker(new google.maps.LatLng(lat, lng), {icon: iconsel});
google.maps.Event.addListener(marker, "click", function() {
getLocalBubble(id, marker);
});
return marker;
}
function createNormalMarker(id, lat, lng){
var iconsel = new google.maps.Icon(G_DEFAULT_ICON);
iconsel.image = "https://atapas.com/wp-content/themes/atapas/images/markergris.png";
return createMarker(id, lat, lng, iconsel)
}
function createCurrentMarker(id, lat, lng){
var icon = new google.maps.Icon(G_DEFAULT_ICON);
icon.image = "https://atapas.com/wp-content/themes/atapas/images/markeramarillo.png";
return createMarker(id, lat, lng, icon)
}
function setMarkersArray(arr){
markers = [];
for(i=0;i
Buscando...
"); jQuery.post("https://atapas.com/wp-content/themes/atapas/php/ajaxhandler.php", {"action": "searchlocal", "s": s}, function(data){ if(data.status=="ok"){ jQuery("#mapaBuscadorContent").html(textoBuscador); jQuery("#mapaResultados").html(data.htmlResult); jQuery("#mapaterms").val(s); setMarkersArray(data.locales); setCurrentMarkers(data.currentlocales); resetMarkers(); setMarkers(); } else{ jQuery("#mapaBuscador").html(textoBuscador); jQuery("#mapaMensaje").html(data.message); } jQuery("#mapasubmit").bind("click", submitSearch); }, "json"); return false; } jQuery(document).ready(function($){ $("#mapasubmit").bind("click", submitSearch); $(window).load(initialize); $(window).unload( function(){ GUnload(); }); });