Hi there

My install of mappingwidgets is carto-only and I'm trying to display the map reference without sucess...
It's not cvs version...

Here is my refence piece at mapfile:

...
REFERENCE
STATUS ON
IMAGE "/home/mapas/wms/images/referer.png"
SIZE 120 120
EXTENT -46.9 -23.81 -46.47 -23.44
COLOR -1 -1 -1
OUTLINECOLOR 0 0 0
END
...

and in my map at carto:

...
{carto-filter}
{mappingwidget type="SimpleMap" width="400" height="240"
service="http://tombados-linux/cgi-bin/wms?SERVICE=WMS&VERSION=1.1.1"
layers="contorno_sp,represa,quadras,tombados,eixos_nome"
query_layers="tombados"
extent="-46.82,-23.75,-46.32,-23.45" srs="epsg:4326"
format="image/png"
info_format="text/html"
}
...

I've putted a print_r($mapwidget) at carto.module after line 714, before a "if"
$mapwidget = $cartoSmarty->find_map_widget( );

...
[service] => http://tombados-linux/cgi-bin/wms?SERVICE=WMS&VERSION=1.1.1
[url] =>
[layers] => contorno_sp,represa,quadras,tombados,eixos_nome
[extent] => -46.82,-23.75,-46.32,-23.45
[overview] =>
[srs] => epsg:4326
)

... and noticed that Overview was empty.

The only way to get my reference working was hardcoding carto.module, substituting the $mapwidget->overview var for the path to the image - what is terrible because restricts the creation of different maps...

Can you help me to do in a better way?

Comments

fernao’s picture

Just a more exact description of the last listing:

function carto_footer()
{
...
foreach($ows as $ow)
{
$mapwidget = $cartoSmarty->find_map_widget( );
print_r($mapwidget);
...

that resulted:

[Mapwidget]
(
...
[service] => http://tombados-linux/cgi-bin/wms?SERVICE=WMS&VERSION=1.1.1
[url] =>
[layers] => contorno_sp,represa,quadras,tombados,eixos_nome
[extent] => -46.82,-23.75,-46.32,-23.45
[overview] =>
[srs] => epsg:4326
)

Thanks

jpulles’s picture

Hi Fernão,

I am not certain, but assume that in the overview widget you want to see the reference (== overview) map from the mapserver .map file. I don't think that the overview widget can be used to show the mapserver reference automatically. The easiest thing to do is to specify the path to an image relative to the skin path.

For example:

{carto-filter}
{mappingwidget type="SimpleMap" width="480" height="240"
service="http://www2.demis.nl/wms/wms.asp?wms=WorldMap" layers="Bathymetry,Topography,Borders,Ocean%20features,Hillshading,Waterbodies,Rivers,Streams,Railroads,Highways,Builtup areas" query_layers="Bathymetry,Topography,Borders,Ocean%20features,Waterbodies,Rivers,Streams,Railroads,Highways,Builtup areas"
extent="-180,-90,180,90" srs="epsg:4326"
format="image/png"
overview="images/world.png"
}
{/carto-filter}

{carto-filter}
{mappingwidget type="OverviewMap" width="160" height="80"}
{/carto-filter}

Note that you don't need to add a overviewmap widget to the node content when the overview block is enabled.
Another option for the overviewmap is to use a wms getmap request to fill it (it inherits attributes from the simplemap widget):

{carto-filter}
{mappingwidget type="OverviewMap" width="160" height="80"
service="http://localhost/cgi-bin/mapserv.exe?map=d:/share/drupal-4.7.0-beta4/mod..."
layers="Countries"
extent="-120,-60,120,60"
format="image/png"
srs="epsg:4326"
}
{/carto-filter}

fernao’s picture

Status: Active » Closed (fixed)

Problem solved!!! =)

It worked on both proposed solutions.

The first one fitted exactelly on our needs, correctly displaying the Overview Block

{carto-filter}
{mappingwidget type="SimpleMap" width="400" height="240"
service="http://tombados-linux/cgi-bin/wms?SERVICE=WMS&VERSION=1.1.1"
layers="contorno_sp,represa,quadras,tombados"
query_layers="tombados"
extent="-46.82,-23.75,-46.32,-23.45" srs="epsg:4326"
format="image/png"
overview="images/reference.png"
info_format="text/html"
}
{/carto-filter}

The second one also worked, producing a new map block bellow the main map, as a new [little] map of overview type.

Thanks for the answers!!!