Ver Mensaje Individual
  #5 (permalink)  
Antiguo 06/07/2008, 16:06
Avatar de airegrafico
airegrafico
 
Fecha de Ingreso: marzo-2003
Ubicación: mi casa
Mensajes: 23
Antigüedad: 21 años, 9 meses
Puntos: 0
Respuesta: google map en la web

alguien me puede decir porque en el campo donde hay en un texto que dice "buscar en el mapa", no se ha cambiado por "madrid". Para aqui así solo tenga que dar al botón "buscar" y tenga definida la busqueda.

<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA9acvgBR5Yb886HXTRNuW oRSDmDhWwrawVEvvR5oIeQp-m2M47hSOkl59yXInzRhxWrcx1A5pcpMl4w" type="text/javascript"></script>
<script src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=ABQIAAAA9acvgBR5Yb886HXT RNuWoRSDmDhWwrawVEvvR5oIeQp-m2M47hSOkl59yXInzRhxWrcx1A5pcpMl4w" type="text/javascript"></script>
<script src="http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type="text/javascript"></script>

<style type="text/css">
@import url("http://www.google.com/uds/css/gsearch.css");
@import url("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css");

#map {
border : 1px solid #979797;
width : 100%;
height : 600px;
}
</style>

<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {

// Create and Center a Map
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(40.338511, -3.713933), 15);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());

// bind a search control to the map, suppress result list
map.addControl(new google.maps.LocalSearch());
}
}
GSearch.setOnLoadCallback(load);
//]]>

// request that tabular search results should be suppressed
var options = {
resultList : google.maps.LocalSearch.RESULT_LIST_SUPPRESS
};
map.addControl(new google.maps.LocalSearch(options));

// no option needed, this is the default
map.addControl(new google.maps.LocalSearch());

// BUT, If you want to, you can explicityly request the default
var options = {
resultList : google.maps.LocalSearch.RESULT_LIST_INLINE
};
map.addControl(new google.maps.LocalSearch(options));

var options = {

linkTarget : GSearch.LINK_TARGET_BLANK,
searchFormHint : "madrid",
onIdleCallback : function() { alert("search control is idle");},
onSearchCompleteCallback : function() { alert("search is complete");},
suppressInitialResultSelection : true

};

searchcontrol = new google.maps.LocalSearch(options);

map.addControl(searchcontrol);
</script>

<script type="text/javascript">
// request that tabular search results be displayed in an external container
var options = {
resultList : document.getElementById("results")
};
map.addControl(new google.maps.LocalSearch(options));
...
<div id="results">Loading...</div>



var options = {
searchFormHint : "buscar Centro Reprografico Neptuno"
};
map.addControl(new google.maps.LocalSearch(options));
;

// request an "on idle" callback. This is called when a search is dismissed and
// when the search control initially loads
var options = {
onIdleCallback : function() { alert("search control is idle");}
};
map.addControl(new google.maps.LocalSearch(options));
;


// request an "on search complete" callback. This is called when a search completes
// and before results are placed on the map or tabular tabular result list
var options = {
onSearchCompleteCallback : function(searcher){
alert(searcher.results.length + " results");
}
};
map.addControl(new google.maps.LocalSearch(options));

;


// request an "on generate marker html" callback. This is called during the open of an info window.
var options = {
onGenerateMarkerHtmlCallback : extendMarker
};
map.addControl(new google.maps.LocalSearch(options));
...
function extendMarker(marker, html, result) {
// extend the passed in html for this result
myStuff = document.createElement("div");
div.innerHTML = "Bookmark This Result...";
html.appendChild(div);
return html;
}


// request an "on markers set" callback.
var options = {
onMarkersSetCallback : markersSet
};
myLocalSearchControl = new google.maps.LocalSearch(options);
map.addControl(myLocalSearchControl);
...
function markersSet(markers) {
// note: markers is an array of LocalResult
if (markers.length > 1) {
// grab the title of the 2nd result object
// if it matches starbucks, then alert
var title = markers[1].result.titleNoFormatting;
if (title.search(/starbucks/i) >= 0) {
alert(markers[1].result.titleNoFormatting);
}
}
}

var searchControl = new google.maps.LocalSearch();
map.addControl(searchControl);
...
searchControl.focus();


// request the the initial search result info window should not be
// auto-opened
var options = {
suppressInitialResultSelection : true
};
map.addControl(new google.maps.LocalSearch(options));


// instruct the system to NOT zoom on search complete
var options = {
suppressZoomToBounds : true
};
map.addControl(new google.maps.LocalSearch(options));


</script>
</head>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="98%"><table width="83%" border="0" cellpadding="0" cellspacing="0" bgcolor="#336633">
<tr>
<td align="left" valign="top" class="Estilo11">Formas de Pago </td>
</tr>
</table></td>
</tr>
<tr>
<td>
<div id="map" style="width: 500px; height: 300px"></div>
</td>
</tr>
</table>
</body>
</html>