[Geoserver-users] Google Maps into Drupal CMS

Hi list.

I had continued playing with Google Maps to simplify the map creation process.
I use Drupal (drupal.org) as my favorite CMS. It has a good module called gmap
(http://drupal.org/node/33591) to insert Google Maps into the content in two
ways :
- with a valid syntax processed later by the module to produce the code:
  [gmap|id=locmap|center=40,0|zoom=3|width=100%|height=400px]
- embedding the code as Php. The module produces the javascript code:
$mymap=array('id' => 'map',
             'control' => 'Large',
             'tcontrol' => 'on',
             'zoom' => $zoom,
             'center' => $north.','.$east,
             'width' => '100%',
             'height' => '500px',
             'type' => 'Satellite',
             );

echo gmap_draw_map($mymap);

This is a very simple way to produce maps. You don't need to take care about
javascript...

Ok. The good news. Yesterday I commited a patch to allow include WMS layers. At
the moment just works with gmap_draw_map() function, not with the parser:

$mywmss=array(array('name'=>'BasicaIGAC',
                    'url'=>'http://sig.cas.gov.co:9999/geoserver/wms?',
                    'format'=>'image/gif',
                    'minResolution'=>'1',
                    'maxResolution'=>'17',
                    'layers'=>'siat:Capa Division Politica Provincias',
                    'copyrights' => array(array(
                      'minZoom'=>'1',
                      'bounds'=>'-190,-90,180,90',
                      'text'=>'©2006 SIG-CAS',
                      )),
                    'overlaywith'=>'Map',
                    'merczoomlevel'=>'5',
    ));

$mymap=array('id' => 'map',
             'control' => 'Large',
             'tcontrol' => 'on',
             'zoom' => $zoom,
             'center' => $north.','.$east,
             'width' => '100%',
             'height' => '500px',
             'type' => 'Satellite',
             'wmss' => $mywmss,
             );

echo gmap_draw_map($mymap);

As you can see, I were playing with the copyright objects of Gmaps API. This is
good, thus developers can add copyright messages into the maps.

For those who don't live on the Drupal world, the code produced by the module
would give you ideas to work directly with JavaScript. See this example:

http://sig.cas.gov.co/basica25/google_map

The patch is here:
http://drupal.org/node/67291

This work is in progress, but I had some issues where you can help me:

1. The module author is worried about the inclusion of wms-gs.js from
codehaus.org. Drupal admins can choose to use a local copy of this file. But if
it isn't found, the module use
http://docs.codehaus.org/download/attachments/52135/wms-gs.js instead.

Can I use it?

2. To do the transition of projections at large zoom levels, wms-gs.js do a
call to map.getZoom(). This is fine if your GMap2 object is named "map", but
gmap module has the option to create any amount of maps in a single page.
Ought! I need to figure out how to pass this object to CustomGetTileUrl
function to use it, instead of the global "map". This is a JavaScript stuff...

Thanks in advance

Eduin

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/

Very cool. Would love if you could write up a bit about this in the wiki when it's in drupal, maybe as a sub-page of the google maps page, or as its own under 'clients'.

As for download options, I just moved it from an attachment on codehaus to the dist directory: http://dist.codehaus.org/geoserver/gmaps-geoserver_scripts/wms-gs-1_0_0.js

Which is a better place to download from.

I also just put it on sourceforge, and you could reference that directly: http://umn.dl.sourceforge.net/sourceforge/geoserver/wms-gs-1_0_0.js

(that's at the umn mirror, you can use another mirror, but you'd have to reference the mirror directly.)

Apologies, I don't know javascript well at all - this script represents the pinnacle of my achievement in that arena :wink: So I can't help much with the map stuff.

best regards,

Chris

Eduin Carrillo wrote:

Hi list.

I had continued playing with Google Maps to simplify the map creation process.
I use Drupal (drupal.org) as my favorite CMS. It has a good module called gmap
(http://drupal.org/node/33591) to insert Google Maps into the content in two
ways :
- with a valid syntax processed later by the module to produce the code:
  [gmap|id=locmap|center=40,0|zoom=3|width=100%|height=400px]
- embedding the code as Php. The module produces the javascript code:
$mymap=array('id' => 'map',
             'control' => 'Large',
             'tcontrol' => 'on',
             'zoom' => $zoom,
             'center' => $north.','.$east,
             'width' => '100%',
             'height' => '500px',
             'type' => 'Satellite',
             );

echo gmap_draw_map($mymap);

This is a very simple way to produce maps. You don't need to take care about
javascript...

Ok. The good news. Yesterday I commited a patch to allow include WMS layers. At
the moment just works with gmap_draw_map() function, not with the parser:

$mywmss=array(array('name'=>'BasicaIGAC',
                    'url'=>'http://sig.cas.gov.co:9999/geoserver/wms?',
                    'format'=>'image/gif',
                    'minResolution'=>'1',
                    'maxResolution'=>'17',
                    'layers'=>'siat:Capa Division Politica Provincias',
                    'copyrights' => array(array(
                      'minZoom'=>'1',
                      'bounds'=>'-190,-90,180,90',
                      'text'=>'©2006 SIG-CAS',
                      )),
                    'overlaywith'=>'Map',
                    'merczoomlevel'=>'5',
    ));

$mymap=array('id' => 'map',
             'control' => 'Large',
             'tcontrol' => 'on',
             'zoom' => $zoom,
             'center' => $north.','.$east,
             'width' => '100%',
             'height' => '500px',
             'type' => 'Satellite',
             'wmss' => $mywmss,
             );

echo gmap_draw_map($mymap);

As you can see, I were playing with the copyright objects of Gmaps API. This is
good, thus developers can add copyright messages into the maps.

For those who don't live on the Drupal world, the code produced by the module
would give you ideas to work directly with JavaScript. See this example:

http://sig.cas.gov.co/basica25/google_map

The patch is here:
http://drupal.org/node/67291

This work is in progress, but I had some issues where you can help me:

1. The module author is worried about the inclusion of wms-gs.js from
codehaus.org. Drupal admins can choose to use a local copy of this file. But if
it isn't found, the module use
http://docs.codehaus.org/download/attachments/52135/wms-gs.js instead.

Can I use it?

2. To do the transition of projections at large zoom levels, wms-gs.js do a
call to map.getZoom(). This is fine if your GMap2 object is named "map", but
gmap module has the option to create any amount of maps in a single page.
Ought! I need to figure out how to pass this object to CustomGetTileUrl
function to use it, instead of the global "map". This is a JavaScript stuff...

Thanks in advance

Eduin

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! Regístrate ya - http://correo.espanol.yahoo.com/

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Ok. I moved all information related to this topic here:

http://docs.codehaus.org/display/GEOSDOC/Drupal

--- Chris Holmes <cholmes@anonymised.com> escribió:

Very cool. Would love if you could write up a bit about this in the
wiki when it's in drupal, maybe as a sub-page of the google maps page,
or as its own under 'clients'.

As for download options, I just moved it from an attachment on codehaus
to the dist directory:
http://dist.codehaus.org/geoserver/gmaps-geoserver_scripts/wms-gs-1_0_0.js

Which is a better place to download from.

I also just put it on sourceforge, and you could reference that
directly:
http://umn.dl.sourceforge.net/sourceforge/geoserver/wms-gs-1_0_0.js

(that's at the umn mirror, you can use another mirror, but you'd have to
reference the mirror directly.)

Apologies, I don't know javascript well at all - this script represents
the pinnacle of my achievement in that arena :wink: So I can't help much
with the map stuff.

best regards,

Chris

Eduin Yezid Carrillo Vega
GIS Specialist
http://eduinyezid.carrillovega.com
http://sig.cas.gov.co/~yecarrillo

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/

Eduin,

Based on the information as found on te Drupal- Geoserver document I'm
trying to replicate the demo as shown in the screenshots.
I've setup drupal, included the gmap demo and now I'm trying to add my
geoserver overlay within the drupal-gmap envirnoment.
Trouble comes in when this is mentioned:

"Create or edit a node of type PHP and use the gmap_draw_map()
function. You need to prepare a parameter to this function with an
array of arrays containing these values:"

My question is how do I do that ? I'm not familiar with drupal so I
assumed I just had to add content witht the php-code included. Where
do I call this gmap_draw_map() function ? Can you give some more info
on that; I don't understand that.

Thanks !

On 6/7/06, Eduin Carrillo <yecarrillo@anonymised.com> wrote:

Ok. I moved all information related to this topic here:

http://docs.codehaus.org/display/GEOSDOC/Drupal

--- Chris Holmes <cholmes@anonymised.com> escribió:

> Very cool. Would love if you could write up a bit about this in the
> wiki when it's in drupal, maybe as a sub-page of the google maps page,
> or as its own under 'clients'.
>
> As for download options, I just moved it from an attachment on codehaus
> to the dist directory:
> http://dist.codehaus.org/geoserver/gmaps-geoserver_scripts/wms-gs-1_0_0.js
>
> Which is a better place to download from.
>
> I also just put it on sourceforge, and you could reference that
> directly:
> http://umn.dl.sourceforge.net/sourceforge/geoserver/wms-gs-1_0_0.js
>
> (that's at the umn mirror, you can use another mirror, but you'd have to
> reference the mirror directly.)
>
> Apologies, I don't know javascript well at all - this script represents
> the pinnacle of my achievement in that arena :wink: So I can't help much
> with the map stuff.
>
> best regards,
>
> Chris

Eduin Yezid Carrillo Vega
GIS Specialist
http://eduinyezid.carrillovega.com
http://sig.cas.gov.co/~yecarrillo

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hello Steven.

--- Steven De Vriendt <gisaalter@anonymised.com> escribió:

Eduin,

Based on the information as found on te Drupal- Geoserver document I'm
trying to replicate the demo as shown in the screenshots.
I've setup drupal, included the gmap demo and now I'm trying to add my
geoserver overlay within the drupal-gmap envirnoment.
Trouble comes in when this is mentioned:

I created and posted the WMS patch to GMap module last sunday. webgeer, the
GMap module author told me he will commit it soon (2-3 days). Right now I can
see that hasn't happended (http://drupal.org/project/cvs/33591).

I will send you the modified file privately. Just overwrite gmap.module.
Version 4.7.x of Drupal is required.

"Create or edit a node of type PHP and use the gmap_draw_map()
function. You need to prepare a parameter to this function with an
array of arrays containing these values:"

My question is how do I do that ? I'm not familiar with drupal so I
assumed I just had to add content witht the php-code included. Where
do I call this gmap_draw_map() function ? Can you give some more info
on that; I don't understand that.

Thanks !

I modify the docs to reflect answers to your questions
(http://docs.codehaus.org/display/GEOSDOC/Drupal). Let me know in this is
enough.

Eduin Yezid Carrillo Vega
GIS Specialist
http://eduinyezid.carrillovega.com
http://sig.cas.gov.co/~yecarrillo

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/

Eduin,

That's beautiful ! Thanks for helping out, however the overlays don't
seem to show up. I've set up a drupal site on http://www.9880.be, can
you have a look at it, the map seems to center ok, but no overlays are
shown....
Aside from that, you've done some really great working integrating
both GeoServer and Drupal !

Steven

On 6/7/06, Eduin Carrillo <yecarrillo@anonymised.com> wrote:

Hello Steven.

--- Steven De Vriendt <gisaalter@anonymised.com> escribió:

> Eduin,
>
> Based on the information as found on te Drupal- Geoserver document I'm
> trying to replicate the demo as shown in the screenshots.
> I've setup drupal, included the gmap demo and now I'm trying to add my
> geoserver overlay within the drupal-gmap envirnoment.
> Trouble comes in when this is mentioned:

I created and posted the WMS patch to GMap module last sunday. webgeer, the
GMap module author told me he will commit it soon (2-3 days). Right now I can
see that hasn't happended (http://drupal.org/project/cvs/33591).

I will send you the modified file privately. Just overwrite gmap.module.
Version 4.7.x of Drupal is required.

>
> "Create or edit a node of type PHP and use the gmap_draw_map()
> function. You need to prepare a parameter to this function with an
> array of arrays containing these values:"
>
> My question is how do I do that ? I'm not familiar with drupal so I
> assumed I just had to add content witht the php-code included. Where
> do I call this gmap_draw_map() function ? Can you give some more info
> on that; I don't understand that.
>
> Thanks !
>

I modify the docs to reflect answers to your questions
(http://docs.codehaus.org/display/GEOSDOC/Drupal). Let me know in this is
enough.

Eduin Yezid Carrillo Vega
GIS Specialist
http://eduinyezid.carrillovega.com
http://sig.cas.gov.co/~yecarrillo

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/

It looks and works fine now. (tested with Firefox 1.5.0.4 and IE 6.0....)

--- Steven De Vriendt <gisaalter@anonymised.com> escribió:

Eduin,

That's beautiful ! Thanks for helping out, however the overlays don't
seem to show up. I've set up a drupal site on http://www.9880.be, can
you have a look at it, the map seems to center ok, but no overlays are
shown....
Aside from that, you've done some really great working integrating
both GeoServer and Drupal !

Steven

Eduin Yezid Carrillo Vega
GIS Specialist
http://eduinyezid.carrillovega.com
http://sig.cas.gov.co/~yecarrillo

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/