Dear Xelawho,
                    I have put this statement map.addControl(new
search_control()); at the end of createMap? But still I get the same error.
I have removed the comemnts from the problematic codes.

On Mon, Jun 13, 2011 at 7:17 AM, xelawho <[email protected]> wrote:

> > Then I get an error here
> > document.getElementById('map').appendChild(contents); saying my map is
> null?
>
> from the link that you posted it looks to me like you will have a
> problem with the order in which the page loads. It's hard to tell with
> the problematic code commented out, but I suspect that what is
> happening is that the search_control (and the div it requires) is
> being initialized before the map is set up (which happens later, after
> body onload is called), and so that is why that function is not
> finding the map.
>
> I would think that moving the entire search_control function to the
> end of your createMap function will give the page enough time to set
> up the map, and then to put the search box on top of it.
>
> maybe...
>
> --
>  You received this message because you are subscribed to the Google Groups
> "Google Maps API V2" 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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" 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.

Reply via email to