[OpenLayers-Users] Pop-up and GML/KML/ ... layers

Jean Pommier (IGE) jean.pommier at ige.fr
Wed Feb 6 10:55:53 EST 2008


Mmmh, are you sure of the syntax of your GML. What did you use to generate
it ?
I'm not so used to GML, but it looks quite weird : elmProperty is REALLY a
conform gml tag ??
Mine (ogr2ogr generated GML, then i changed a few minor things) looks like
this :
    <gml:featureMember>
        <ogr:allcircuits fid="ID1">
            <ogr:geometryProperty>
                <gml:LineString>
                    <gml:coordinates>9.468016813294355,24.571030547444423
6.003057388645857,23.697212985408044 6.002689662946409,23.696395817186783
6.00264880453534,23.695742082609684 6.00264880453534,23.694965772799492
</gml:coordinates>
                </gml:LineString>
            </ogr:geometryProperty>
            <ogr:Id>1</ogr:Id>
            <ogr:tId>DJ-TA-1</ogr:tId>
            <ogr:itineraire><![CDATA[circuit2]]></ogr:itineraire>
            <ogr:categorie><![CDATA[Grandes traversées]]></ogr:categorie>
             <ogr:url><![CDATA[mon url]]></ogr:url>
            <ogr:duree>8</ogr:duree>
            <ogr:mode>1</ogr:mode>
        </ogr:allcircuits>
    </gml:featureMember>

You could also use firebug to explore your javascript objects : maybe you'll
find the right path...

2008/2/6, Jacolin Yves <yjacolin at free.fr>:
>
> Thanks for this tips. Here is a snapshoot of my GML:
>   <gml:featureMember>
>     <gml:elmProperty>
>       <gml:Property name="CODEFICHE">001</gml:Property>
>       <gml:Property name="LIBFICHE">001-Lyon 1 Nord</gml:Property>
>       <gml:Property name="MONOFICHE">002</gml:Property>
>       <gml:Property name="FICHE">001</gml:Property>
>       <gml:Property name="CODEFICHEF">1</gml:Property>
>     </gml:elmProperty>
>     <gml:Point>
>       <gml:coordinates>537171.089628033,5743668.39683698</gml:coordinates>
>     </gml:Point>
>   </gml:featureMember>
>
> I tried feature.attributes.CODEFICHE, but undefined is displayed.
>
> Any idea? Thank :)
>
> Y.
> Le Wednesday 06 February 2008 15:02:55 Jean Pommier (IGE), vous avez écrit
> :
> > Hi Yves,
> > Yes, you can. The syntax is feature.attributes.<fieldName>, you'll get
> the
> > field value for the current feature
> > Is it OK ?
> > If you need an example, i have one not so far...
> > Jean
> >
> > 2008/2/6, Jacolin Yves <yjacolin at free.fr>:
> > > Hi Pierre,
> > >
> > > Following this example, I have to parse my GML to find the data
> somewhere
> > > I
> > > want to show on my tooltips. Is it the "normal" way? Is it possible to
> > > get it
> > > with  something like "feature.data.<fieldName>" to display it in the
> > > pop-up ?
> > >
> > > Am I clear? I hope so :)
> > >
> > > Y.
> > >
> > > Le Wednesday 06 February 2008 14:02:48 Pierre GIRAUD, vous avez écrit
> :
> > > > Are you drawing features in a Vector-type layer ?
> > > > If so, is this example usefull ?
> > > > http://openlayers.org/dev/examples/select-feature-openpopup.html
> > > >
> > > > Regards,
> > > > Pierre
> > > >
> > > > On Feb 6, 2008 1:02 PM, Jacolin Yves <yjacolin at free.fr> wrote:
> > > > > Hi list,
> > > > >
> > > > > I would like to test the pop-up feature in openlayers. If I add a
> > > > > GML, KML or some other type of layer. How can I easily retrieve
> data
> > > > > from
> > >
> > > the
> > >
> > > > > GML, KML, after clicking on the map ?
> > > > >
> > > > > Do I need to retrieve the latLong from the click event, then parse
> > > > > the GML, and then build the content of the pop-up? Or can I
> retrieve
> > > > > data from the GML layer loaded in OL? An another method?
> > > > >
> > > > > Could you provide some easy exemple for this?
> > > > >
> > > > > Sorry if my question seems obvious. I am new in Javascript OO :)
> > > > >
> > > > > Regards,
> > > > >
> > > > > Y.
> > > > > --
> > > > > Yves Jacolin
> > > > > ---
> > > > > http://softlibre.gloobe.org
> > > > > _______________________________________________
> > > > > Users mailing list
> > > > > Users at openlayers.org
> > > > > http://openlayers.org/mailman/listinfo/users
> > >
> > > --
> > > Yves Jacolin
> > > ---
> > > http://softlibre.gloobe.org
> > > _______________________________________________
> > > Users mailing list
> > > Users at openlayers.org
> > > http://openlayers.org/mailman/listinfo/users
>
>
>
> --
> Yves Jacolin
> ---
> http://softlibre.gloobe.org
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Information Géographique et Environnement
39 chemin Canto Laouzeto
31100 Toulouse
France

Port  +33 6 09 23 21 36
Fax   +33 5 61 86 09 23
Mail : jean.pommier at ige.fr
Site web : www.ige.fr
Suivez de près l'actualité d'IGE grâce à notre fil RSS :
http://www.ige.fr/actualites/rss.php
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080206/c68c59f4/attachment.html


More information about the Users mailing list