I've created a business map for my town and want to make it
searchable
from my website.
http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=1049287416046...
I've seen to documentation on creating maps with search embedded but
it doesn't seem to apply to myMaps.
http://www.google.com/uds/solutions/localsearch/reference.html
I've adapted the example code given in the documentation to include
the coordinates of my map and also a reference to the msid of the
MyMap. Not sure though, if I've done this right. Here is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;
charset=utf-8"/
<title>Local Search Control for Google Maps - default.html</
title>
<script src="http://maps.google.com/maps?
file=api&v=2&key=AARTsJrCmgkZ-E31jTo3NcCK91DwdR6S8g" msa=0
msid=104928741604613036597.0004497ee7f5f4be24482 type="text/
javascript"></script>
<script src="http://www.google.com/uds/api?
file=uds.js&v=1.0&key=AARTsJrCmgkZ-E31jTo3NcCK91DwdR6S8g" 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 : 50%;
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(51.888571,-8.595772), 13);
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);
//]]>
</script>
</head>
<body onunload="GUnload()">
<div id="map"></div>
</body>
</html>
When I use this, I don't get any search results after entering a term
in the search box.
Would appreciate any pointers on this, possibly links to tutorials.
thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---