Your showaddress is getting called, before initialize is run. Hence map 
is null.


mosherjm schrieb:
> I am getting a Javascript object required error and can't seem to
> figure it out after hours of trying.  The error is occuring every time
> the showAddress function is called at the map.setCenter line.
>
> LINK:  http://woodsite.peak-systems.net/properties/search.asp
>
> Any help is appreciated.  Thank you.
>
>
>
>
>
>
>
> Here is a javascript snippet......
>
> <script type="text/javascript">
>
> var map = null;
> var geocoder = null;
> geocoder = new GClientGeocoder();
>
> function initialize() {
>       if (GBrowserIsCompatible()) {
>               map = new GMap2(document.getElementById("map"));
>       map.setCenter(new GLatLng(36.9, -76.2), 11);
>               map.addControl(new GSmallMapControl());
>               map.addControl(new GMapTypeControl());
>       }
> }
>
> function showAddress(lat_long, InfoWindowHtml)
> {
>       if (lat_long != "")
>       {
>               var point = new GLatLng(lat_long);
>               map.setCenter(point, 11);
>               var marker = new GMarker(point);
>               map.addOverlay(marker);
>               marker.bindInfoWindowHtml(InfoWindowHtml);
>       }
> }
> </script>
>
>
>
> Then in the HTML I have a series of calls to showAddress like this....
>
> <script language="Javascript">showAddress(foo, bar);</script>
>
>
> and a map....
>
> <div id="map" style="width:100%;height:100%"></div>
> >
>
>   

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to Google-Maps-API@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to