[OpenLayers-Users] Getting all points for a geom?

Guillermo Lopez Mackinnon gmlopez.mackinnon at gmail.com
Mon Dec 8 08:53:19 EST 2008


Hey! Many thanks!
That sounds like a great hint and like the correct approach too :-)!

What should I do with the controls variable? Add it to the layer at creation
time?

For example:

controls = {
...
featureinfocontrol: new OpenLayers.Control.SelectFeature(myvectorlayer,
{onSelect: featureinfo});
}

var cities = new OpenLayers.Layer.WFS(
                "Cities",
                "http://localhost:8080/geoserver/wfs",
                {typename: 'topp:cities'},
                {
                    typename: 'cities',
                    featureNS: 'http://www.openplans.org/topp',
                    extractAttributes: true,
                    controls: controls

                }
            );

Is the code above correct? Did I understand correctly or do I have to add
this control to the map as the other controls?

I'll try it out and let you know in case I have any problem. If it works
I'll post the solution.


Guillermo

On Mon, Dec 8, 2008 at 1:30 PM, Adorian Ardelean <mynature at gmail.com> wrote:

> Hi Guillermo,
>
> Look if you can use:
> *feature.attributes["city_name"]*
>
> example
> featureinfo = function(feature)
> {
> alert(*feature.attributes["city_name"])*;
> }
>
> controls = {
> ...
> featureinfocontrol: new OpenLayers.Control.SelectFeature(myvectorlayer,
> {onSelect: featureinfo});
> }
> ...
>
> All the best,
> Adorian
>
>
>
> On Mon, Dec 8, 2008 at 12:37 PM, Guillermo Lopez Mackinnon <
> gmlopez.mackinnon at gmail.com> wrote:
>
>> Thanks for your reply!
>> Actually, I meant the feature attributes like for instance "city_name",
>> "population" and so on. I´d like to display some of them when the user
>> clicks on a feature and since I may have several layers, doing it in the way
>> I explained in my initial post it'll be pretty tedious so I'd say it should
>> be some other way (a correct way) of doing this kind of stuff. Am I right?
>>
>>
>> Thanks again for your help!
>>
>> Guillermo
>>
>>
>> On Mon, Dec 8, 2008 at 11:40 AM, Adorian Ardelean <mynature at gmail.com>wrote:
>>
>>> Hi Nino,
>>>
>>> Do you mean all nodes of a polygon? If yes, you could explore Vector
>>> Formats Example in http://openlayers.org/dev/examples/ where is shows
>>> also how you could output coordinates of a feature in various formats.
>>>
>>> All the best,
>>> Adorian
>>>
>>>
>>> On Mon, Dec 8, 2008 at 11:24 AM, Nino Saturnino Martinez Vazquez Wael <
>>> nino.martinez at jayway.dk> wrote:
>>>
>>>> How can I extract all points for a geometry?
>>>>
>>>>
>>>> http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Geometry/Collection-js.html#OpenLayers.Geometry.Collection
>>>> , do I need to call a field directly?
>>>>
>>>>
>>>> --
>>>> -Wicket for love
>>>>
>>>> Nino Martinez Wael
>>>> Java Specialist @ Jayway DK
>>>> http://www.jayway.dk
>>>> +45 2936 7684
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at openlayers.org
>>>> http://openlayers.org/mailman/listinfo/users
>>>>
>>>
>>>
>>>
>>> --
>>> Dr. Adorian Ardelean
>>> coordinator of myNature Project
>>>
>>> http://mybiosis.info/nature/portal.php?pagename=firstpage [a Romanian
>>> biodiversity-database]
>>> http://mybiosis.info/nature/portal.php?pagename=adorian [CV]
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openlayers.org
>>> http://openlayers.org/mailman/listinfo/users
>>>
>>>
>>
>
>
> --
> Dr. Adorian Ardelean
> coordinator of myNature Project
>
> http://mybiosis.info/nature/portal.php?pagename=firstpage [a Romanian
> biodiversity-database]
> http://mybiosis.info/nature/portal.php?pagename=adorian [CV]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081208/8c28ed8f/attachment.html


More information about the Users mailing list