[jQuery] Re: Variable for Google Maps API

2008-05-06 Thread RalphM

Thnak you, Kan, that´s it.

RalphK

On 5 Mai, 18:48, Ken Robinson [EMAIL PROTECTED] wrote:
 On Mon, May 5, 2008 at 12:08 PM, RalphM [EMAIL PROTECTED] wrote:

   Two hours later ;-)

   When I set a variable like this

      var position = new Array(50.1678, -97.133);

   I can do this:

     map.setCenter(new GLatLng(position[0], position[1]),8);

   But when I try something like this:

     meta name=ICBM content=50.1678, -97.133185

   script

   
    var geopos = $(meta[name=ICBM]).attr(content);
    var position = new Array(geopos);
    map.setCenter(new GLatLng(position[0], position[1]),8);
   
   /script

 You need to turn the string into an array. The easiest way to do that
 is to use split():

 var geopos = $(meta[name=ICBM]).attr(content).split(',');
 map.setCenter(new GLatLng(geopos[0], geopos[1]),8);

 Ken


[jQuery] Variable for Google Maps API

2008-05-05 Thread RalphM

Hi,

I have a Website with geocoding meta tags like this:

   meta name=ICBM content=50.1678, -97.133185

With help of jQuery I can extract the content like this:

   var title = $(meta[name=ICBM]).attr(content);

This works fine.

But how can I store the variable to this:

  map.setCenter(new GLatLng( variablemust go here ),5);

I tried in vain to get since two days, so I would appreciate any help.

Thank you

RalphM