On Aug 2, 12:03 pm, raumin <[email protected]> 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
--
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.