[OpenLayers-Users] getting Feature Info data directly from .shpfiles

Sarah Schuessler sarah_flip at yahoo.de
Mon Mar 22 04:08:58 EDT 2010


HI,

did you already see this:
http://www.openlayers.org/dev/examples/
(and http://dev.openlayers.org/releases/OpenLayers-2.8/examples/) ?


HTH.

best regards
Sarah



________________________________
Von: sunny74 <sb.ray at hotmail.com>
An: users at openlayers.org
Gesendet: Samstag, den 20. März 2010, 21:17:14 Uhr
Betreff: Re: [OpenLayers-Users] getting Feature Info data directly from .shpfiles


Hi Arnd,

Thanks for our reply.

You have understood my question rightly.
I want to display the attributes of a layer(one layer is one .shp file) in a
pop up using openlayers.This 
we get to see if the .shp file is converted to a DB table.

1) You have given some mapfile code.But I am not sure exactly where to
insert within the layer definition.
So if a typical layer of mine is as given below can u pls tell me where I
have to insert the mapfile statements.

LAYER
    NAME 'STATE'
    TYPE POLYGON
    DATA 'C:\ms4w\Apache\cgi-bin\Shape\STATE.shp'
    METADATA
      'wms_title' 'STATE'
    END
    STATUS DEFAULT
    TRANSPARENCY 100
    PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    ''
    END
    CLASS
       NAME 'STATE' 
       STYLE
         SYMBOL 0 
         SIZE 2 
         OUTLINECOLOR 0 0 0
         COLOR 255 255 127
       END
    END
  END

  Where do I write info_format = text/plain for getting the attributes as
plain text.

2) How do I collect the attribute data in a javascript function or
openlayers event,function.Presently I am only making 
   a WMS  call to each of the layers in a mapfile as shown below.

function init() {

         //alert("in init");
         map = new OpenLayers.Map('<%=map.ClientID%>');

         //
         layer = new OpenLayers.Layer.WMS("OpenLayers WMS",
                "http://localhost:9000/cgi-bin/mapserv.exe?", { map:
'Shape/newwr1.map', layers: 'STATE', 'format': 'png' });

         layer1 = new OpenLayers.Layer.WMS("BASIC",
                "http://localhost:9000/cgi-bin/mapserv.exe?", { map:
'Shape/newwr1.map', transparent: 'true', layers: 'basic', 'format': 'png'
});


           map.addLayers([layer,layer1]);
          map.setCenter(new OpenLayers.LonLat(73.25, 20.35), 6);




          }
The above function is just showing the map layers in a div.
If I have a similar js function what kind of a call do I make to get the
attribute data.

Is there any complete example given somewhere?
Pls reply soon.


-- 
View this message in context: http://n2.nabble.com/getting-Feature-Info-data-directly-from-shp-files-tp4767879p4769867.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users


__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100322/7bb6c046/attachment.html


More information about the Users mailing list