timmah1 Posted August 27, 2008 Share Posted August 27, 2008 I'm trying to put a custom message in a Google maps overlay. The only thing that shows up is what is typed, but i want it to say "you are here" before what was typed. But, the way it is now, the only thing that shows up is what was searched for. Here is my code <script type="text/javascript"> var map = null; var geocoder = null; function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(37.4419, -122.1419), 13); geocoder = new GClientGeocoder(); } } function showAddress(address,here) { if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { alert(address + " not found"); } else { map.setCenter(point, 13); var marker = new GMarker(point); map.addOverlay(marker); //marker.openInfoWindowHtml(santa); marker.openInfoWindowHtml(address,here); } } ); } } </script> </head> <body onload="initialize()" onunload="GUnload()"> <form action="#" onsubmit="showAddress(this.address.value); return false"> <p> <input type="text" size="60" name="address" value="Enter Your Address or Zip Code Here" /> <input type="hidden" name="here" value="you are here" /> <input type="submit" value="Go!"/> </p> <div id="map_canvas" style="width: 500px; height: 300px"></div> </form> Can anybody help me out? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.