Changeset 6181
- Timestamp:
- 02/10/08 11:18:48 (1 year ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Format/OSM.js (modified) (2 diffs)
- trunk/openlayers/tests/Format/test_OSM.html (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Format/OSM.js
r6131 r6181 132 132 ways[i].tags); 133 133 feat.osm_id = parseInt(ways[i].id); 134 feat.fid = "way." + feat.osm_id; 134 135 feat_list[i] = feat; 135 136 } … … 157 158 } 158 159 feat.osm_id = parseInt(node_id); 160 feat.fid = "node." + feat.osm_id; 159 161 feat_list.push(feat); 160 162 } trunk/openlayers/tests/Format/test_OSM.html
r6131 r6181 27 27 } 28 28 function test_Format_OSM_node_with_tags(t) { 29 t.plan( 4);29 t.plan(5); 30 30 var f = new OpenLayers.Format.OSM(); 31 31 var features = f.read(osm_test_data['node_with_tags']); … … 33 33 t.eq(feat.attributes, {'a':'b'}, "attributes match"); 34 34 t.eq(feat.osm_id, 200545, "internal osm_id property set correctly"); 35 t.eq(feat.fid, "node.200545", "OSM-based FID set correctly."); 35 36 t.eq(feat.geometry.x, -1.8166417, "lon is correct"); 36 37 t.eq(feat.geometry.y, 52.5503033, "lat is correct"); 37 38 } 38 39 function test_Format_OSM_way(t) { 39 t.plan( 7);40 t.plan(8); 40 41 var f = new OpenLayers.Format.OSM(); 41 42 var features = f.read(osm_test_data['way']); … … 43 44 var feat = features[0]; 44 45 t.eq(feat.osm_id, 4685537, "OSM ID set correctly."); 46 t.eq(feat.fid, "way.4685537", "OSM-based FID set correctly."); 45 47 t.eq(feat.geometry.CLASS_NAME, "OpenLayers.Geometry.Polygon", "returned as polygon"); 46 48 t.eq(feat.geometry.components[0].components.length, 11, "Correct number of components");
