Changeset 7 for trunk/Modules/Map/Map.php
- Timestamp:
- Apr 14, 2020, 11:13:32 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Map/Map.php
r4 r7 53 53 function Geolocate($Text) 54 54 { 55 return (null);56 } 57 58 function Show() 59 { 60 return ('');55 return null; 56 } 57 58 function Show() 59 { 60 return ''; 61 61 } 62 62 … … 66 66 $Result = substr($Text, 0, strpos($Text, $End) - 1); 67 67 $Text = substr($Text, strlen($End)); 68 return ($Result);68 return $Result; 69 69 } 70 70 } … … 107 107 <script>Loader.load()</script>'; 108 108 109 return ($Output);109 return $Output; 110 110 } 111 111 } … … 117 117 $Origins = array(); 118 118 $Destinations = array(); 119 foreach ($this->Path as $Index => $PathItem)119 foreach ($this->Path as $Index => $PathItem) 120 120 if ($Index > 0) 121 121 { … … 134 134 $I++; 135 135 } 136 return ($Points);136 return $Points; 137 137 } 138 138 … … 142 142 array_shift($WayPoints); 143 143 array_pop($WayPoints); 144 if (count($WayPoints) > 0)144 if (count($WayPoints) > 0) 145 145 $WaypointsQuery = '&waypoints='.implode('|', $WayPoints); 146 146 else $WaypointsQuery = ''; … … 151 151 '&destination='.$this->Path[count($this->Path) - 1].''. 152 152 '" style="border: 1px solid black"></iframe>'; 153 return ($Output);153 return $Output; 154 154 } 155 155 } … … 176 176 { 177 177 $this->Points = array(); 178 foreach ($TextPathItems as $TextPathItem)178 foreach ($TextPathItems as $TextPathItem) 179 179 { 180 180 $Result = $this->Geolocate($TextPathItem); … … 184 184 185 185 $WayPoints = array(); 186 foreach ($this->Points as $Point)186 foreach ($this->Points as $Point) 187 187 { 188 188 $WayPoints[] = $Point['Longitude']; … … 208 208 $Points = array(); 209 209 $Separator = '<gml:pos>'; 210 while (strpos($Result, $Separator) !== false)210 while (strpos($Result, $Separator) !== false) 211 211 { 212 212 $Result = substr($Result, strpos($Result, $Separator) + strlen($Separator)); … … 215 215 $Points[] = array('Longitude' => $PosParts[0], 'Latitude' => $PosParts[1]); 216 216 } 217 return (array('TotalDistance' => $TotalDistance, 'TotalTime' => $TotalTime,218 'Points' => $Points) );217 return array('TotalDistance' => $TotalDistance, 'TotalTime' => $TotalTime, 218 'Points' => $Points); 219 219 } 220 220 … … 222 222 { 223 223 $WayPoints = array(); 224 foreach ($this->Points as $Point)224 foreach ($this->Points as $Point) 225 225 { 226 226 $WayPoints[] = $Point['Longitude'];
Note:
See TracChangeset
for help on using the changeset viewer.