[OpenLayers-Users] MapServer to OpenLayers line rendition

Aileen aileen at mapcentral.ph
Mon Mar 31 11:06:52 EDT 2008


Hi all,

Just want to follow-up on this one.

We are currently using the latest release of Mapserver, the 5.0.2 version 
and Openlayers 2.5

We are having problems with rendering lines and polygons because although it 
worked for us in Mapserver 4.10, we are told that there's a new syntax for 
passing values to mapserver.

Currently, here's part of the url that we are using to pass to mapserver:

map_layer_class_expression=makati&map_layer_class_color=255 0 0.


We already have looked at your samples but with no avail.

Can you help us with the new syntax?



----- Original Message ----- 
From: "Steve Lime" <Steve.Lime at dnr.state.mn.us>
To: "Aileen" <aileenbaylon at gmail.com>
Cc: <crschmidt at metacarta.com>
Sent: Thursday, October 11, 2007 3:46 AM
Subject: Re: [OpenLayers-Users] MapServer to OpenLayers line rendition


The OL definition suggests that you are changing the classitem and the 
expression using the
4.10 syntax. In 5.0 neither of those can be changed via a URL. I took a very 
conservative
approach to exposing parameters to URL configuration (perhaps too 
conservative). I didn't
want folks monkeying with ...item parameters. So, you'd need to set the 
classitem in the mapfile
and not try to modify it. The expression can be altered using runtime 
substitutions. You could
change the whole expression by doing something like:

  EXPRESSION '%my_expression%'

and then adding &my_expression=... to the URL somehow. (I'm not sure how the 
OpenLayers
MapServer driver adds things to the submitted URL. I'd like to take 
ownership of that code.) The
benefit of doing it this way is that you can apply a validation pattern (a 
regex) to the runtime
substitution to make sure what is being passed is valid. I can tell you how 
to expose more properties
to URL configuration if you'd like, it's a tiny change in maplexer.l and 
then recompile.

So far all you're doing is drawing features using a dynamic expression. Is 
that what you mean
by line rendition? I was under the impression that you were creating 
features in runtime and passing
them to MapServer for rendering in the map (as opposed to using the 
OpenLayers vector API). If
that's the case then you must have code someplace to add more map_ or map. 
variables to the
OpenLayers layer. (note that either a _ or a . will work as a separator). 
What does that look like?

Steve

>>> On 10/7/2007 at 8:57 PM, in message 
>>> <024801c80952$237704f0$9601a8c0 at aileen>,
"Aileen" <aileenbaylon at gmail.com> wrote:

> ----- Original Message ----- 
> From: Aileen
> To: Steve Lime ; users at openlayers.org
> Sent: Monday, October 08, 2007 9:25 AM
> Subject: Re: [OpenLayers-Users] MapServer to OpenLayers line rendition
>
>
> Hi Steve!
>
> Thanks for your reply.
>
> Here's the line that is being passed to openlayers:
>
> var myqry = new OpenLayers.Layer.MapServer.Untiled("Map",
> "/cgi-bin/mapserv?", {map: '/hometo/maps/mymap.map', layer:'#qrylayer#',
> map_#qrylayer#_classitem:'#qryitem#',
> map_#qrylayer#_class_expression:'#q.code#', layers:"#onlayer#", format:
> 'gif', transparent:'false'});
>
> We are using mapserver 5.0 and Openlayers 2.4
>
> No pink tiles encountered. What happens is it can zoom to the right 
> location
> but could not render a line.
> When we are still using mapserver 4.10, the line above is what we use and 
> it
> has no problems rendering a line.
>
> We read the migration guide from mapserver and they changed the way they
> create a new feature:
>
> changing a scalebar object:
> ...&map.scalebar=UNITS+MILES+COLOR+121+121+121+SIZE+300+2&...creating a 
> new
> feature...&map_layer[3]=FEATURE+POINTS+500000+1000000+END+TEXT+'A+test+point'+
> END&...
> The value is a snippet of a mapfile.  The separator used to be underscore 
> (
> _ ) now it's a plus sign (+). But eventhough we changed that according to 
> the
> new standard way of creating a new feature, the line cannot still be
> rendered! Here's our url: http:/203.131.125.60/mapcentral_OL/index.cfm 
> Enter
> Keyword: Quezon AvenueEnter Location: Quezon City
> Click on any "View Map" from the Search Result.The keyword you entered is 
> a
> street, so it should highlight the street that it searched. But instead, 
> it
> just zooms to the location.How could this be?
> ----- Original Message ----- 
>   From: Steve Lime
>   To: Aileen ; users at openlayers.org
>   Sent: Saturday, October 06, 2007 6:49 AM
>   Subject: Re: [OpenLayers-Users] MapServer to OpenLayers line rendition
>
>
>   Aileen: I'm assuming you're bumping your head against the URL
> configuration changes
>   that were made in 5.0. Virtually anything you could do in 4.10 is doable
> in 5.0 but the
>   mechanism may have changed. Can you pass along the URLs that are 
> actually
> being
>   sent to MapServer? If so, then I can tell you what changes would be
> necessary to
>   make them work. Whether that means the OpenLayers interface will have to
> be updated
>   I'm not sure of.
>
>   Steve
>
>   >>> On 10/4/2007 at 9:41 PM, in message
> <003301c806f9$4bdda760$9601a8c0 at aileen>,
>   "Aileen" <aileen at mapcentral.ph> wrote:
>   > We recently upgraded our Mapserver version from 4.10 to 5.0.
>   >
>   > With that, we no longer can render lines and shade polygons.
>   >
>   > Did the parameter in passing variables from openlayers to mapserver
> changed?
>   >
>   > How do you send line parameters to mapserver?
>   >
>   > How will I render points and lines to CGI? What url do I use?
>   >
>   > Currently we use this:
>   >
>   > var myqry = new OpenLayers.Layer.MapServer.Untiled("Map",
>   > "/cgi-bin/mapserv?", {map: '/home/to/my/map.map', layer:'#qrylayer#',
>   > map_#qrylayer#:'classitem+#qryitem#+expression+#q.code#', format: 
> 'gif',
>   > transparent:'false'});
>   >
>   > Aileen 




More information about the Users mailing list