Dear Xelawho,
                     I tried to follow part of your codes like this and I
have added this map.addControl(new search_control()); in my init function.
Then I get an error here
document.getElementById('map').appendChild(contents); saying my map is null?

function search_control()
        {

        }
                new search_control();
                search_control.prototype.initialize = function() {
                        var contents = document.createElement("div");
                        contents.style.width="300px";
                        contents.style.height="25px";
                        contents.innerHTML="<div id='auto'
style='z-index:100'><input type='text'
style='font-family:verdana;width:200px; height:18px;font-size:12px'
id='autocomplete' autocomplete='off' onKeyPress='return
submitenter(this,event)'/><input type=\"button\"
onclick=\"searchLocations()\" value=\"Search\"/><\/div>";

document.getElementById('map').appendChild(contents);
                        return contents;
                      }
                new search_control().initialize();

        document.getElementById("auto").style.top="5px";
        document.getElementById("auto").style.left="5px";

On Sun, Jun 12, 2011 at 8:59 PM, xelawho <[email protected]> wrote:

> >The problem now the
> > box is outside the map. How can I have the box say at left top of my
> > map itself.
>
> I think you have two options:
> create a custom control, as described here:
>
> http://code.google.com/apis/maps/documentation/javascript/v2/controls.html#Custom_Controls
>
> or else make a div for your search box and append it to your map div,
> like I did here:
> http://www.xelawho.com/map/
>
> I went with option 2 because it seems that making an input box a
> GControl removes some of the normal behaviors associated with an input
> box (click and drag to select text was one that I can remember, but
> there were others).
>
> hope that helps.
>
> --
> 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