[OpenLayers-Users] Highlighting one shape in a shapefile

Arnd Wippermann arnd.wippermann at web.de
Tue Jul 21 12:26:43 EDT 2009


Hi

It is possible to add an own param to the request (wms or mapserver) and use
runtime substitution

Parameter : &APARAM=Germany
Mapfile Substitution : EXPRESSION /%APARAM%/ 

Arnd

-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Tamlyn Rhodes
Gesendet: Dienstag, 21. Juli 2009 15:27
An: users at openlayers.org
Betreff: [OpenLayers-Users] Highlighting one shape in a shapefile

Sorry for this broad question but I'm not sure how to go about this.

I have a shapefile of countries displayed in openlayers. Each country has a
(vector) label. Clicking on the country label should 'highlight'
the country.

I've got this working for a few countries by creating a layer per country
and setting its fill to transparent and all other countries to a translucent
black, hence effectively dimming the rest of the world.
The problem is when I then create a layer for every country (246 in
total) the mapserver falls over with no visible errors and nothing in the
server logs. It also seems somehow wrong to have 250 layers even if only 3
of them will be visible at a time.

Is it possible to specify a CLASS EXPRESSION dynamically in the mapserver
URL? If so that would mean I can create a single layer and choose which
shape to turn on or off directly from openlayers.

I don't think it's appropriate to use a vector layer to do the highlighting
because the KML of countries is about 1.5MB and I imagine it would be pretty
slow to render.

Any suggestions?

  T.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list