]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/template/search-xml.php
Add options to output polygon in various formats: polygon_geojson=1&polygon_svg=1...
[nominatim.git] / lib / template / search-xml.php
index bdf1eab53ae93b19a8f04eca3b7ac83d6e8e4be1..84e177750b020b7c919126517b1fdab4dfb8485f 100644 (file)
                        }
                }
 
                        }
                }
 
+               if (isset($aResult['asgeojson']))
+               {
+                       echo ' geojson=\'';
+                       echo $aResult['asgeojson'];
+                       echo '\'';
+               }
+
+               if (isset($aResult['assvg']))
+               {
+                       echo ' geosvg=\'';
+                       echo $aResult['assvg'];
+                       echo '\'';
+               }
+
+               if (isset($aResult['astext']))
+               {
+                       echo ' geotext=\'';
+                       echo $aResult['astext'];
+                       echo '\'';
+               }
+
                if (isset($aResult['zoom']))
                {
                        echo " zoom='".$aResult['zoom']."'";
                if (isset($aResult['zoom']))
                {
                        echo " zoom='".$aResult['zoom']."'";
 
                echo " class='".htmlspecialchars($aResult['class'])."'";
                echo " type='".htmlspecialchars($aResult['type'])."'";
 
                echo " class='".htmlspecialchars($aResult['class'])."'";
                echo " type='".htmlspecialchars($aResult['type'])."'";
-               if ($aResult['icon'])
+               if (isset($aResult['icon']) && $aResult['icon'])
                {
                        echo " icon='".htmlspecialchars($aResult['icon'], ENT_QUOTES)."'";
                }
 
                {
                        echo " icon='".htmlspecialchars($aResult['icon'], ENT_QUOTES)."'";
                }
 
-               if (isset($aResult['address']))
+               if (isset($aResult['address']) || isset($aResult['askml']))
                {
                        echo ">";
                {
                        echo ">";
+               }
+
+               if (isset($aResult['askml']))
+               {
+                       echo "\n";
+                       echo $aResult['askml'];
+               }
+
+               if (isset($aResult['address']))
+               {
+                       echo "\n";
                        foreach($aResult['address'] as $sKey => $sValue)
                        {
                                $sKey = str_replace(' ','_',$sKey);
                        foreach($aResult['address'] as $sKey => $sValue)
                        {
                                $sKey = str_replace(' ','_',$sKey);
                                echo htmlspecialchars($sValue);
                                echo "</$sKey>";
                        }
                                echo htmlspecialchars($sValue);
                                echo "</$sKey>";
                        }
+               }
 
 
+               if (isset($aResult['address']) || isset($aResult['askml']))
+               {
                        echo "</place>";
                }
                else
                        echo "</place>";
                }
                else