if I change the associative array idmarkers do I need to use the link ?
id=Marker Two still?
I'm trying to get the example to use the idmarkers array instead of
gmarkers and I'm having a really hard time.
whats the purpose of idmarkers[id.toLowerCase()] = marker;?
and then if I use idmarkers how does that change side_bar_html += as
well as myclick()?
do I need to rewrite myclick to
google.maps.event.trigger(idmarkers[i], "click");?
and then as for the if statements within initialize() can I get rid of
the second if statement? if (index > -1) and only need the first if
statement if (id) { if (idmarkers[id]...

On Dec 9, 4:19 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Dec 9, 4:06 pm, gh0st <hollmanc...@gmail.com> wrote:
>
> > I've looked it over and I got infowindows to open via a link but I've
> > run into another problem.
> > the php loop prints out links to the markers based on whats generated
> > by the xml file and each marker has a unique id.
> > each marker is also added to the map via the same xml file and then I
> > use the same technique as the example in the link you provided Larry
> > such as var gmarkers = [];
> > the problem is the gmarkers array has a new index and with the myclick
> > function it recieves a value indicating the location in the array.
>
> So then don't use the position in the xml, use the id:
> like this (in my first 
> post):http://www.geocodezip.com/v3_MW_example_linktomarker.html?id=Marker
> Two
>
> (might need to do 
> this:)http://www.geocodezip.com/v3_MW_example_linktomarker.html?id=Marker%2...
>
> You can use the ids as arguments to myclick, you just have to change
> it to use the associative array (idmarkers) rather than gmarkers (the
> array that uses the order in the xml).
>
>   -- Larry
>
>
>
> > whats going to happen is as markers are added or deleted from the sql
> > table the order is going to get messed up. for example sql table:
> > id name
> > 4 johndoe
> > 1 charliehopkins
> > 5 markjohnson
> > 11 larrycusak
> > 2 davidwebb
>
> > but then these are pushed into the gmarkers array in a new order
> > gmarker[0]  = "4 johndoe"
> > gmarker[1] = 1 charliehopkins
> > gmarker[2] =  5 markjohnson
> > gmarker[3] = 11 larrycusak
> > gmarker[4] = 2 davidwebb
>
> > thus the openInfoWindow function for each link may be
> > href="javascript:openInfoWindow(4)" which should open (from the sql
> > table) infowindow for marker "4 johndoe" but instead opens infowindow
> > for marker "2 davidwebb"
>
> > the links to open the infowindow are based off the id from the sql
> > table, not the location in the gmarker array.
> > so whats happening is as each marker is read from the xml file it's
> > added to the gmarker array via gmarker.push(marker)
> > I need to find a way to put the markers added to the gmarker array in
> > the same sequential order as they are in the sql table.
>
> > I hope I explained my problem sufficiently, it's kind of confusing
> > just to explain it.
>
> > On Dec 7, 5:11 pm, "geocode...@gmail.com" <geocode...@gmail.com>
> > wrote:
>
> > > On Dec 7, 4:04 pm, gh0st <hollmanc...@gmail.com> wrote:
>
> > > > Ok I'll go over this. If I have problems can I email you Larry or
> > > > should I continue to post to this?
>
> > > Continue the thread. I don't respond to email at this address.
>
> > > > On Dec 7, 3:46 pm, "geocode...@gmail.com" <geocode...@gmail.com>
> > > > wrote:
>
> > > > > On Dec 7, 3:34 pm, gh0st <hollmanc...@gmail.com> wrote:
>
> > > > > > Kind of something like that but I've stared at the source code for
> > > > > > that for a few days and I've been trying to work that into my page
> > > > > > without success.
> > > > > > I'm thinking if I'm printing out rows of markers in a table the link
> > > > > > will be something like this  echo "<a href=
> > > > > > \"javascript:openInfoWindow($markerID, map, $windowTitle, 
> > > > > > $windowBody)
> > > > > > \">"
>
> > > > > That is php.  What does the browser see?
>
> > > > > > and then
> > > > > > openInfoWindow(markerID, map, infoWindowTitle, infoWindowDesc) {
> > > > > >    infoWindow.open(map, markerID);}
>
> > > > > > where markerID is the result of the mysql_query from the id column,
> > > > > > infoWindowTitle is the result of mysql_query from the name column 
> > > > > > and
> > > > > > so on.
> > > > > > I know in one of those examples a column is pre-generated in
> > > > > > javascript but isn't the case for my situation.
>
> > > > > You can remove the sidebar and the example will still work.  You can
> > > > > use that example as is if you use your php to generate the required
> > > > > xml from your database like 
> > > > > this:http://code.google.com/apis/maps/articles/phpsqlajax_v3.html#outputxml
>
> > > > > -- Larry
>
> > > > > > On Dec 7, 2:50 pm, "geocode...@gmail.com" <geocode...@gmail.com>
> > > > > > wrote:
>
> > > > > > > On Dec 7, 2:32 pm, gh0st <hollmanc...@gmail.com> wrote:
>
> > > > > > > > I have a sql table consisting of the following columns:
> > > > > > > > id, name, notes, lat, lng, and type.
>
> > > > > > > > PHP querys the table and echos rows of the preceding columns.
> > > > > > > > I want to make links out of each row that open an infowindow of 
> > > > > > > > the
> > > > > > > > corresponding marker in the map.
>
> > > > > > > > I'm thinking I can write a function that recieves the "id" of 
> > > > > > > > the
> > > > > > > > marker that calls a google.maps event that opens an infowindow 
> > > > > > > > for the
> > > > > > > > "id" of that marker in the map.
>
> > > > > > > > page:http://whereschp.com/new/index.php?p=map
> > > > > > > > code:http://pastebin.com/wWsDKAgu<-- consists of index.php and
> > > > > > > > another fx.php
>
> > > > > > > You mean something like 
> > > > > > > this:http://www.geocodezip.com/v3_MW_example_linktomarker.html?marker=1
> > > > > > > or 
> > > > > > > this:http://www.geocodezip.com/v3_MW_example_linktomarker.html?id=Marker
> > > > > > > Two
>
> > > > > > >   -- Larry- Hide quoted text -
>
> > > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -

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