Permalink
Browse files

surpress output of osm_type/id for non-OSM objects in reverse xml

  • Loading branch information...
1 parent b25ecf1 commit 8286abbeb479a18df7b560daccad7673e3f77297 @lonvia lonvia committed Feb 5, 2014
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/template/address-xml.php
@@ -22,7 +22,8 @@
{
echo "<result";
if ($aPlace['place_id']) echo ' place_id="'.$aPlace['place_id'].'"';
- if ($aPlace['osm_type'] && $aPlace['osm_id']) echo ' osm_type="'.($aPlace['osm_type']=='N'?'node':($aPlace['osm_type']=='W'?'way':'relation')).'"'.' osm_id="'.$aPlace['osm_id'].'"';
+ $sOSMType = ($aPlace['osm_type'] == 'N'?'node':($aPlace['osm_type'] == 'W'?'way':($aPlace['osm_type'] == 'R'?'relation':'')));
+ if ($sOSMType) echo ' osm_type="'.$sOSMType.'"'.' osm_id="'.$aPlace['osm_id'].'"';
if ($aPlace['ref']) echo ' ref="'.htmlspecialchars($aPlace['ref']).'"';
if (isset($aPlace['lat'])) echo ' lat="'.htmlspecialchars($aPlace['lat']).'"';
if (isset($aPlace['lon'])) echo ' lon="'.htmlspecialchars($aPlace['lon']).'"';

0 comments on commit 8286abb

Please sign in to comment.