but this line of code works

var location = new google.maps.LatLng(rs(1), rs(2));

I'm able to get the LAT and LONG values from a database and add
markers, but adding values from a database to the title of each marker
does not work.

On Aug 2, 5:48 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Aug 2, 12:03 pm, raumin <rau...@gmail.com> wrote:
>
> > I am adding markers on the map from a database, and that works. But
> > when I want the marker to have a title from the database it does not
> > work. Why???
>
> I don't know.  Adding title text works for me.
>
>
>
> > This works
>
> > rs.moveFirst();
> >     while(!rs.eof)
> >     {
> >        var location = new google.maps.LatLng(rs(1), rs(2));
> >        var marker = new google.maps.Marker({
> >         position: location,
> >         map: map,
> >         title: "Hello World" });
>
> >       rs.moveNext();
> >     }
>
> That looks like server side code.  Please post a link to your map so
> we can see the problem in our browser.
>
>
>
>
>
>
>
> > But when I change the title value of the marker from "Hello World" to
> > a variable
>
> > rs.moveFirst();
> >     while(!rs.eof)
> >     {
> >        var location = new google.maps.LatLng(rs(1), rs(2));
> >        var marker = new google.maps.Marker({
> >         position: location,
> >         map: map,
> >         title: rs(0) });
>
> >       rs.moveNext();
> >     }
>
> > Nothing works, can I only use string literals???
>
> No.  The google maps api executes in the browser.  It doesn't have
> access to server variable unless you either:
> 1. explicitly write them in the page
> or
> 2. get them from the server with an XmlHttpRequest.
>
> The problem should be obvious if you look at what the browser sees.
>
>   -- Larry- 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