[OpenLayers-Users] about text layers

Alexandre Dube adube at mapgears.com
Wed Feb 24 11:55:21 EST 2010


Karina,

 You need to have your features served by a "feature server".  MapServer 
can do that for you.  The OGC standard for that is "WFS" so you can try 
to set a WFS server layer in MapServer :
 http://mapserver.org/ogc/wfs_server.html

 and then read it with a OpenLayers.Layer.Vector layer using a WFS 
protocol :
 http://openlayers.org/dev/examples/wfs-states.html

 If you have trouble with the Feature Name Space property, try :
 featureNS: "http://mapserver.gis.umn.edu/mapserver"

  Also, don't forget to "reply-to-all" to have the MailingList aware of 
our discussion.  Others may want to comment too.

Kind regards,

Alexandre


Karina Guardado wrote:
> Hi,
>
> I reviewed the examples you gave me but I have a question. When I 
> create my wms layer I provide the url and the name of the layer from 
> mapserver in my mapfile like this
>
>  var estaciones = new OpenLayers.Layer.WMS("estaciones", 
> "http://myurl/cgi-bin/mapserv?MAP=/var/www/amss_wms2.map",
>                 {layers:'estaciones', transparent: 
> "true",format:"image/gif"});
>
> but in the example I can see something like this
>
> var vectors1 = new OpenLayers.Layer.Vector("Vector Layer 1", {
>                 styleMap: new OpenLayers.StyleMap({
>                     "default": new 
> OpenLayers.Style(OpenLayers.Util.applyDefaults({
>                         externalGraphic: "../img/marker-green.png",
>                         graphicOpacity: 1,
>                         rotation: -45,
>                         pointRadius: 10
>                     }, OpenLayers.Feature.Vector.style["default"])),
>                     "select": new OpenLayers.Style({
>                         externalGraphic: "../img/marker-blue.png"
>                     })
>                 })
>             });
>
> But I can't see where I should write the name of my layer and the url 
> it is confused to me. So please if you could help me how to convert my 
> wms layer into the vector layer I would really thanks a lot to you.
>
> karina
>
> On Wed, Feb 24, 2010 at 9:43 AM, Alexandre Dube <adube at mapgears.com 
> <mailto:adube at mapgears.com>> wrote:
>
>     Karina,
>
>     Karina Guardado wrote:
>
>         Hello everybody,
>
>     Hi
>
>
>
>         but I would like that users could be able to click on one
>         point and get the information without using this text markers.
>         I found information about  vector and gml layers with text
>         format but I would like to know how to use them to work with
>         more than one layer  or if there are other solutions that
>         someone could recomend.
>
>     You're right about using Vector layers.  It shouldn't matter if
>     you have more than one if you use the SelectFeature control for
>     feature selection.  You can give it an array of Vector layers, so,
>     on your map, regardless on which feature from any Vector layer,
>     you should be able to select it.
>
>     See more about this control in these examples :
>
>     http://openlayers.org/dev/examples/select-feature-multilayer.html
>     http://openlayers.org/dev/examples/select-feature-openpopup.html
>
>     Kind regards,
>
>     Alexandre
>
>
>
>         thanks in advance.
>
>         Karina Guardado
>         El Salvador
>         ------------------------------------------------------------------------
>
>         _______________________________________________
>         Users mailing list
>         Users at openlayers.org <mailto:Users at openlayers.org>
>         http://openlayers.org/mailman/listinfo/users
>          
>
>
>
>     -- 
>     Alexandre Dubé
>     Mapgears
>     www.mapgears.com <http://www.mapgears.com>
>
>


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Users mailing list