Hello,

Your area is open because the node 1 should me two timms in the osm file !

A valide osm file I just download:
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' generator='JOSM'>
  <bounds minlat='46.502819699999996' minlon='6.681785' maxlat='46.5029046'
maxlon='6.6818922999999995' origin='CGImap 0.0.2' />
  <node id='431055458' timestamp='2009-07-14T08:59:30Z' uid='130849'
user='eric6quatre' visible='true' version='3' changeset='1824385'
lat='46.5027691' lon='6.6822428' />
  <node id='431055459' timestamp='2009-07-14T08:59:30Z' uid='130849'
user='eric6quatre' visible='true' version='3' changeset='1824385'
lat='46.502712' lon='6.682191' />
  <node id='431055461' timestamp='2009-07-14T08:59:30Z' uid='130849'
user='eric6quatre' visible='true' version='3' changeset='1824385'
lat='46.5028624' lon='6.6818405' />
  <node id='431055462' timestamp='2009-07-14T08:59:30Z' uid='130849'
user='eric6quatre' visible='true' version='3' changeset='1824385'
lat='46.5029195' lon='6.6818923' />
  <way id='37064251' timestamp='2009-12-10T10:23:27Z' uid='17835'
user='Stéphane Brunner' visible='true' version='3' changeset='3339876'>
    <nd ref='431055458' />
    <nd ref='431055459' />
    <nd ref='431055461' />
    <nd ref='431055462' />
    <nd ref='431055458' />
    <tag k='addr:city' v='Lausanne' />
    <tag k='addr:country' v='CH' />
    <tag k='amenity' v='school' />
    <tag k='building' v='yes' />
  </way>
</osm>


CU
Stéphane Brunner



2010/10/21 walter.nordmann <[email protected]>

>
> hi,
>
> i'm trying to load some osm-data to ol but don't get what i need.
> i want to draw a filled area but ol just use it as polyline/linestring.
>
> my test-data:
> <?xml version='1.0' encoding='UTF-8'?>
> <osm version='0.6' generator='site 77'>
> <node id='1' lat='50.121938' lon='8.0825758'/>
> <node id='2' lat='50.1219622' lon='8.0825024'/>
> <node id='3' lat='50.1229272' lon='8.0828036'/>
> <node id='4' lat='50.1230205' lon='8.083425'/>
> <node id='5' lat='50.1230138' lon='8.083489'/>
> <node id='6' lat='50.121938' lon='8.0825758'/>
> <way id='100000'>
> <nd ref='1'/>
> <nd ref='2'/>
> <nd ref='3'/>
> <nd ref='4'/>
> <nd ref='5'/>
> <nd ref='6'/>
> <tag k='area' v='yes' />
> </way>
> </osm>
>
> a little bit code:
>
> var myStyle3 = new OpenLayers.StyleMap({
>                    "default":  new OpenLayers.Style({
>                                    strokeColor:   '#ffcc00',
>                                    cursor:        'help',
>                                    strokeWidth:   10,
>                                    strokeOpacity: 0.5,
>                                    fillcolor:     '#ffcc00'
>                    }),
> ...snip ...
> format:         new OpenLayers.Format.OSM({
>                                        checkTags: true,
>                                        areaTags:  'area'
>                                        }),
>
> and some firebug:
> <polyline id="OpenLayers.Geometry.LineString_2024"
> points="420.923,518.643 407.241,511.607 463.388,231.034 579.226,203.907
> 591.156,205.855 420.923,518.643"
> fill="none" stroke="#ffcc00" stroke-opacity="0.5" stroke-width="10"
> stroke-linecap="round" stroke-linejoin="round" cursor="help"/>
>
> ol ist just drawing the line but not the area. everything else (color,
> linetype,cursor) is ok
>
> regards
> walter
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Format-OSM-and-areaTags-tp5658428p5658428.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to