views:

61

answers:

2

I am working with google maps and I am trying to pass a value from my database (Access) to my javascript code.

I have

var centerPoint = new GLatLng( <% Double.parseDouble(myclass.getLatitude()); %> , <% Double.parseDouble(myclass.getLongitude()); %>);

where myclass.getLatitude() returns a string representation of my latitude and I convert it to double etc...

But the problem is the map does not display.

+3  A: 

There is little point in using Double.parseDouble() as it'll get immediately converted right back to String. But your problem is you're not printing the coordinates (<% wraps java scriptlet; <%= outputs the result of expression evaluation). This should do it:

var centerPoint = new GLatLng( <%= myclass.getLatitude() %> , <%= myclass.getLongitude() %>);
ChssPly76
A: 

cool thanks, that worked!

Dave
1) This should be in the comments section.2) You should accept his answer as the correct one.
the_drow