[mapserver-users] How to integrate Openlayers + MapScript C# + Postgis

Stephen Woodbridge woodbri at swoodbridge.com
Thu Mar 14 07:02:16 PDT 2013


On 3/14/2013 9:24 AM, Marco Araujo wrote:
> Hi everybody,
>
> I'm trying to develop an application (ASP.NET C#) that gets the database
> (postgis) map through conditions "where" and process adjustments by
> mapscript and provide the map to be viewed by openlayer.

If I understand correctly, you want to use .NET to control what is 
displayed in the map.

First I would make sure that you can not do everything you need using 
mapserver cgi parameter substitution as this might be much simpler.

> Can anyone guide me on how I should proceed?

Assuming that the above will not work, then you are going to have to 
make you mapscript application simulate a WMS service so you can call it 
from OpenLayers.

Now:

data ---> mapserver ----> OpenLayers

In this you would program in JavaScript and change the url for the map 
requests to pass parameters and do parameter substitution in the 
mapfile. This is a standard Web 2.0 approach.

With mapscript:

data ---> your.net -----> OpenLayers

Here you have to simulate a WMS service so you can talk to OpenLayers 
and then read the parameters from OpenLayers to control your .NET code 
and how it interacts with mapserver. Since you have to pass parameters 
to the server anyway, I would start and see if you can do it with the 
existing mapserver code.

-Steve W

> I need a WMS (mapserver) to display dynamic data (from database)?
>
> Already have the following:
> 1. up and running MapServer CGI in my Windows2008 (64bits) under IIS 7.5
> (not apache).
>
> 2. The database postgis mount but I have no idea how to retrieve the data
> and presents it in openlayers.
>
> 3. Tests (successfully) with openlayers presenting a static map of
> mapserver as follows:
> /layer = new OpenLayers.Layer.WMS("WorldMap",
> "http://localhost/MapServer/mapserv.exe?
> map=C:/maps/itasca.map&mode=map&template=openlayers&layer=lakespy2&layer=dlgstln2");/
>
> If you can help me I appreciate it.
>
> Sincerely,
> Marco Araujo
> Brazil / Sao Paulo
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>



More information about the mapserver-users mailing list