Its scary when you pull up a map example and its blocks from where you
live :)

Theres a few ways to do this.  If you are only wanting to open the
first one, try something like this.  Add a 3rd parameter to your
createMarker function to indicate whether to open this marker.  Then
in your app, set the 3rd parameter to true for your first marker (I
think that's the one you are using for your center point) and the rest
to false.

var point = new google.maps.LatLng(45.475971,-122.778497);
      var marker = createMarker(point,'<div id="googleMap"><div
id="googleMapDescription"><p>Allen Business Park Phase I<\/
p><p>6110-6296 SW Arctic Drive Bldg 1&3<\/p><p>Beaverton, OR<\/p><p><a
href="\/property\/index.cfm?propertyID=C4053D85-FFEC-927B-
B4C1CC54BD39E8F4">more info<\/a><\/div><img style="float:left; border:
1px solid #000000;" src="\/property\/LargeImages\/
img_property_AllenI.jpg" width="100" \/></div>', true);

      var point = new google.maps.LatLng(45.474107,-122.777672);
      var marker = createMarker(point,'<div id="googleMap"><div
id="googleMapDescription"><p>Allen Business Park Phase I<\/
p><p>9710-9790 SW Sunshine Court Bldg 2<\/p><p>Beaverton, OR<\/p><p><a
href="\/property\/index.cfm?propertyID=C407013E-FFEC-927B-
B4C53A67B6C25608">more info<\/a><\/div><img style="float:left; border:
1px solid #000000;" src="\/property\/LargeImages\/
img_property_AllenI.jpg" width="100" \/></div>', false);

...


function createMarker(latlng, html, open) {  //add a 3rd (boolean)
parameter to indicate whether to open this infowindow
    var contentString = html;
    var marker = new google.maps.Marker({
        position: latlng,
        map: map,
        zIndex: Math.round(latlng.lat()*-100000)<<5
        });

                        infowindow.open(map,marker);

    google.maps.event.addListener(marker, 'click', function() {
        infowindow.setContent(contentString);
        infowindow.open(map,marker);
        });

    if(open) infowindow.open(map,marker);  //open it
}


On Nov 18, 10:38 am, Daryl Johnson <[email protected]> wrote:
> Link to map (specified 
> property):http://pnwprop.u59.ssllcweb.com/map/index.cfm?propertyID=C4053D85-FFE...
> Link to map (unspecified):http://pnwprop.u59.ssllcweb.com/map/index.cfm
>
> My code is working correctly, but I would like to make one enhancement.
> When I navigate to the map using the propertyID, I center on that
> property, what I would like to happen is for that infoWindow to open as
> well as continue to display all the other markers. I have played around
> with several different scenarios, but I am running into a wall here.
>
> If you have any help you can pass on I would greatly appreciate.

-- 
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.

Reply via email to