On Aug 4, 5:38 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Aug 4, 4:54 pm, "geocode...@gmail.com" <geocode...@gmail.com>
> wrote:
>
> > On Aug 4, 2:06 pm, "Matthew W. Shepherd"
>
> > <matthew.w.sheph...@gmail.com> wrote:
> > > I'm developing an interactive map based on Fusion Tables data at the
> > > following test 
> > > URL:http://library.sc.edu/digital/collections/greenbook_map_test.html
>
> > > There are two primary errors involving InfoWindows that I've run into:
>
> > > 1.) When a marker is clicked on the map, the corresponding InfoWindow
> > > displays; however, when a data row is selected from the DataTable, the
> > > previous map-selected InfoWindow does not close. I've included
> > > "if(infowindow) infowindow.close();" in the selectHandler() function,
> > > but this apparently does not affect the map-selected InfoWindows.
>
> > Only create one infowindow.  Reuse it to display any contents.
>
> > > The close function does close each DataTable-selected InfoWindow when
> > > a new DataTable row is selected. Moreover, if a DataTable-selected
> > > InfoWindow is open, selecting a marker on the map itself causes the
> > > DataTable-selected InfoWindow to close properly.
>
> > > 2.) Apparently related to this issue with calling InfoWindows: I want
> > > all InfoWindows to include a "Zoom here" link. The code for DataTable-
> > > selected InfoWindows does this properly, zooming the map in with the
> > > selected marker at the center. However, I have been unable to make
> > > this work for map-selected InfoWindows. Using
> > > "map.setCenter(marker.getPosition());" and
> > > "map.setCenter(infowindow.getPosition());" did not work properly for
> > > me. The latter turned out to zoom in at the most recent DataTable-
> > > selected InfoWindow location (or outside the map if none was
> > > previously selected). Using "e.latLng" comes close, but zooms in on
> > > the point where the map was clicked, rather than on the marker itself.
>
> > Theoretically, event.LatLng should work based on the documentation:
> > latLng  LatLng  The position at which to anchor an infowindow on the
> > clicked feature.
>
> > However, if that isn't working, you have the row data available in in
> > the click event also:
> > row     Object  A collection of FusionTablesCell objects, indexed by
> > column name, representing
> >                 the contents of the table row which included the
> > clicked feature.
>
> > Parse the latitude and longitude out of the "geometry" column in the
> > row just like you do in the select handler.
>
> Oops, that no longer seems to be there.
>
> Therefore the fact that the latLng in the event is the "clicked"
> position, rather than the documented "position at which to anchor an
> infowindow on the clicked feature." (i.e. the actual location of the
> feature), this has to be classed as a bug.  Someone should create an
> issue in the issue tracker.

Amigo Motel & Cafe
first click at original zoom:
(35.17380831799959, -103.7109375)
second click (after "zoom here"):
(35.1715632080029, -103.70269775390625)
third click (after another "zoom here"):
(35.17187893034227, -103.70400667190552)
fourth click (after another "zoom here"):
(35.17187893034227, -103.70399862527847)

Value in FusionTable:
<Point><coordinates>-103.70400,35.171879,0.0</coordinates></
Point<Point><coordinates>-103.70400,35.171879,0.0</coordinates></
Point>>

    -- Larry

>
> > > I believe that both of these problems are due to some error on my part
> > > in not declaring the infowindow variable correctly. I hope that
> > > there's some simple issue I'm overlooking that will set both of these
> > > straight. Thank you in advance, and I hope my (admittedly learning-as-
> > > I-go) code's otherwise up to snuff!

-- 
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 google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to