Code standards, fix base path at least for php includes and use single quotes more often
[busui.git] / include / common-geo.inc.php
blob:a/include/common-geo.inc.php -> blob:b/include/common-geo.inc.php
--- a/include/common-geo.inc.php
+++ b/include/common-geo.inc.php
@@ -27,13 +27,13 @@
     if (sizeof($mapPoints) < 1)
         return 'map error';
     if (sizeof($mapPoints) === 1) {
-        $markers = 'markers={$mapPoints[0][0]},{$mapPoints[0][1]}';
+        $markers = 'markers='.$mapPoints[0][0].','.$mapPoints[0][1];
     } else {
         if (!$numbered) {
             $markers = 'markers=';
         }
         if ($path) {
-            $markers.= 'markers={$mapPoints[0][0]},{$mapPoints[0][1]}&amp;path=';
+            $markers.= 'markers='.$mapPoints[0][0].','.$mapPoints[0][1].'&amp;path=';
         }
         foreach ($mapPoints as $index => $mapPoint) {
             if ($twotone && $index == 0) {
@@ -56,15 +56,23 @@
         }
     }
     $output = '';
-    if ($collapsible)
-        $output.= '<div class="map" data-role="collapsible" data-collapsed="true"><h3>Open Map...</h3>';
-    if (isIOSDevice())
+    if ($collapsible) {
+        $output.= '<div class="map geo" itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates" data-role="collapsible" data-collapsed="true"><h3>Open Map...</h3>
+                <meta itemprop="latitude" content="'.$mapPoints[0][0].'" />
+                 <abbr class="latitude" title="'.$mapPoints[0][0].'"></abbr> 
+ <abbr class="longitude" title="'.$mapPoints[0][1].'"></abbr>
+    <meta itemprop="longitude" content="'.$mapPoints[0][1].'" />';
+    }
+    if (isIOSDevice()) {
         $output.= '<img class="hiresmap" src="http://maps.googleapis.com/maps/api/staticmap?size=' . $width . 'x' . $height . '&amp;' . $markers . '&amp;scale=2&amp;sensor=true" width=' . $width . ' height=' . $height . '" alt="map of stop location">';
-    else
+    }
+    else {
         $output.= '<img class="lowresmap" src="http://maps.googleapis.com/maps/api/staticmap?size=' . $width . 'x' . $height . '&amp;' . $markers . '&amp;scale=1&amp;format=jpg&amp;sensor=true" width=' . $width . ' height=' . $height . '" alt="map of stop location">';
-
-    if ($collapsible)
+    }
+    
+    if ($collapsible) {
         $output.= '</div>';
+    }
     return $output;
 }