Thank you for responses. @William... tried that before didn't work.
Seems it needs code in top part.
@Kesuke .. it is being developed on localhost right now and will be
deployed when done...
map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
This is where it first builds map... centered in Australia... there
must be a way to initialize map to address?
sigh...
On Jul 23, 8:47 pm, William <[email protected]> wrote:
> On Jul 24, 10:38 am, slindsey3000 <[email protected]> wrote:
>
> > Any cleanup suggestions? Thanks!!
>
> maybe create the map only once you know the geocode?
>
> function initialize() {
>
> geocoder = new google.maps.Geocoder();
>
> var address = "10 Downing St,London,UK";
>
> geocoder.geocode( { 'address': address}, function(results, status)
> {
> if (status == google.maps.GeocoderStatus.OK) {
>
> map = new
> google.maps.Map(document.getElementById("map_canvas"), {
> zoom: 12,
> center: results[0].geometry.location,
> mapTypeId: google.maps.MapTypeId.ROADMAP
> });
>
> var marker = new google.maps.Marker({
> map: map,
> position: results[0].geometry.location
> });
>
> } else {
> alert("Geocode was not successful for the following reason: " +
> status);
> }
> });
> }
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.