este es el head de un artículo donde cargo los js, etc
Código PHP:
<script src="https://maps.googleapis.com/maps/api/js?v=3.15&key=aqui pongo mi key=false&language=ES"></script>
<script src="http://www.elegimos.es/media/system/js/jquery-1.6.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="UTF-8">
/* <![CDATA[ */
try { if (undefined == xajax.config) xajax.config = {}; } catch (e) { xajax = {}; xajax.config = {}; };
xajax.config.requestURI = ;
xajax.config.statusMessages = false;
xajax.config.waitCursor = true;
xajax.config.version = "xajax 0.5";
xajax.config.legacy = false;
xajax.config.defaultMode = "asynchronous";
xajax.config.defaultMethod = "POST";
/* ]]> */
</script>
<script type="text/javascript" src="http://www.elegimos.es//media/system/js/xajax_core.js" charset="UTF-8"></script>
<script type="text/javascript" charset="UTF-8">
/* <![CDATA[ */
window.setTimeout(
function() {
var scriptExists = false;
try { if (xajax.isLoaded) scriptExists = true; }
catch (e) {}
if (!scriptExists) {
alert("Error: the xajax Javascript component could not be included. Perhaps the URL is incorrect?\nURL: http://www.elegimos.es//media/system/js/xajax_core.js");
}
}, 2000);
/* ]]> */
</script>
Código PHP:
<script type='text/javascript' charset='UTF-8'>
/* <![CDATA[ */
xajax_zero = function() { return xajax.request( { xjxfun: 'zero' }, { parameters: arguments } ); };
/* ]]> */
</script>
<script type="text/javascript">
$(document).ready(function(){
var y = $(window).height(); var x = $(window).width();
if (x > 640) {x = 640; $('#body').css({'width':x});}
if (x < 480) {x = 480; $('#body').css({'width':x});}
var x_map = x - 100;
var y_map = 350;
$('#map').css({'width':x_map, 'height':y_map});
$(window).resize(function(){
var y = $(window).height(); var x = $(window).width();
if (x > 640) {x = 640; $('#body').css({'width':x});}
if (x < 480) {x = 480; $('#body').css({'width':x});}
var x_map = x - 100;
var y_map = 350;
$('#map').css({'width':x_map, 'height':y_map});
});
});
</script></div>
<div align='center'><script type="text/javascript">
var search; var map; var geocoder; var marker; var search_query; var coords; var icon;
function initialize() {
geocoder = new google.maps.Geocoder();
var mapOptions = {scrollwheel: false, maxZoom: 19, minZoom: 13, streetViewControl: false, zoomControlOptions: {style: google.maps.ZoomControlStyle.SMALL}, panControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, position: google.maps.ControlPosition.TOP_LEFT}}
map = new google.maps.Map(document.getElementById('map'), mapOptions);
}
function foto (dl, sh) {
var lng_1 = parseFloat(dl) - 0.003; var lng_2 = parseFloat(dl) + 0.003; var lat_1 = parseFloat(sh) - 0.003; var lat_2 = parseFloat(sh) + 0.003;
var myRequest = {'rect': {'sw': {'lat':lat_1, 'lng':lng_1}, 'ne': {'lat':lat_2, 'lng':lng_2}}, 'set': panoramio.PhotoSet.ALL};
var sandRequest = new panoramio.PhotoRequest(myRequest);
var attr_ex_photo_options = {'width': 500, 'height': 350, 'attributionStyle': panoramio.tos.Style.HIDDEN};
var attr_ex_photo_widget = new panoramio.PhotoWidget('div_attr_ex_photo', sandRequest, attr_ex_photo_options);
var attr_ex_list_options = {'width': 500, 'height': 70, 'columns': 10, 'rows': 1, 'croppedPhotos': true, 'disableDefaultEvents': [panoramio.events.EventType.PHOTO_CLICKED], 'orientation': panoramio.PhotoListWidgetOptions.Orientation.HORIZONTAL, 'attributionStyle': panoramio.tos.Style.HIDDEN};
var attr_ex_list_widget = new panoramio.PhotoListWidget('div_attr_ex_list', sandRequest, attr_ex_list_options);
var attr_ex_attr_options = {'width': 500};
var attr_ex_attr_widget = new panoramio.TermsOfServiceWidget('div_attr_ex_attr', attr_ex_attr_options);
function onListPhotoClicked(event) {
var position = event.getPosition();
if (position !== null) attr_ex_photo_widget.setPosition(position);
}
panoramio.events.listen(
attr_ex_list_widget, panoramio.events.EventType.PHOTO_CLICKED,
function(e) { onListPhotoClicked(e); });
attr_ex_photo_widget.enablePreviousArrow(false);
attr_ex_photo_widget.enableNextArrow(false);
attr_ex_photo_widget.setPosition(0);
attr_ex_list_widget.setPosition(0);
}
function viewer(dl, sh) {
var road = new google.maps.LatLng(sh,dl);
var panoramaOptions = {
position: road,
addressControlOptions: {
position: google.maps.ControlPosition.BOTTOM_CENTER
},
linksControl: true,
panControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL
},
zoom: 1,
enableCloseButton: false
};
var myPano = new google.maps.StreetViewPanorama(
document.getElementById('map-viewer'),
panoramaOptions);
myPano.setVisible(true);
}
function adress () {
var query = 'Valladolid, España';
var adr = "";
geocoder.geocode({'address': adr}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
coords = results[0].geometry.location;
if (coords == '('', '')') {
icons = '/attentio.png';
search_query = '<div align=left><h3>Resultados de la búsqueda:</h3><ul><li><b>No se encontró Nada...</b></li></ul></div>';
search = 'Rien trouvé';
xajax_zero(156311);
} else {
icons = 'http://es.street-viewer.eu/pmrds.png';
search_query = '<div align=left><h3>Resultados de la búsqueda:</h3><ul><li><b>'+search+'</b>, '+query+'</li></ul></div>';
search = search+', '+query;
}
var infowindow = new google.maps.InfoWindow({content: search_query});
map.setCenter(results[0].geometry.location);
map.setZoom(16);
var strcoords = coords.toString(); var strcoords = strcoords.replace('(', ''); var strcoords = strcoords.replace(')', '');
var dl_sh_arr = strcoords.split(','); var dl = dl_sh_arr[1]; var sh = dl_sh_arr[0]; foto (dl, sh); viewer (dl, sh);
if (marker != null) {marker.setMap(null);}
marker = new google.maps.Marker({position: results[0].geometry.location, map: map, animation: google.maps.Animation.DROP, title: search, icon: icons});
google.maps.event.addListener(marker, 'click', function() {infowindow.open(map, marker);});
} else {
alert('Geocode was not successful for the following reason: ' + status);
}
});
}
$(document).ready(function() {
initialize (); adress ();
});
</script> <div id='map' style='border:1px #917E59 solid; display:block; margin-top: 10px;'></div></div><br>
un cordial saludo
pd: la url de donde deberia mandar el codigo de busqueda segun la calle es:
http://www.elegimos.es/valladolid/ca...alladolid.html
y uno de los 1200 articulos de resultado por ejemplo este:
http://www.elegimos.es/valladolid/ca...-albacete.html