Ignore:
Timestamp:
Apr 14, 2020, 11:13:32 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Map/Map.php

    r4 r7  
    5353  function Geolocate($Text)
    5454  {
    55     return(null);
    56   }
    57 
    58   function Show()
    59   {
    60     return('');
     55    return null;
     56  }
     57
     58  function Show()
     59  {
     60    return '';
    6161  }
    6262
     
    6666    $Result = substr($Text, 0, strpos($Text, $End) - 1);
    6767    $Text = substr($Text, strlen($End));
    68     return($Result);
     68    return $Result;
    6969  }
    7070}
     
    107107        <script>Loader.load()</script>';
    108108
    109     return($Output);
     109    return $Output;
    110110  }
    111111}
     
    117117    $Origins = array();
    118118    $Destinations = array();
    119     foreach($this->Path as $Index => $PathItem)
     119    foreach ($this->Path as $Index => $PathItem)
    120120    if ($Index > 0)
    121121    {
     
    134134      $I++;
    135135    }
    136     return($Points);
     136    return $Points;
    137137  }
    138138
     
    142142    array_shift($WayPoints);
    143143    array_pop($WayPoints);
    144     if(count($WayPoints) > 0)
     144    if (count($WayPoints) > 0)
    145145      $WaypointsQuery = '&waypoints='.implode('|', $WayPoints);
    146146      else $WaypointsQuery = '';
     
    151151      '&destination='.$this->Path[count($this->Path) - 1].''.
    152152      '" style="border: 1px solid black"></iframe>';
    153     return($Output);
     153    return $Output;
    154154  }
    155155}
     
    176176  {
    177177    $this->Points = array();
    178     foreach($TextPathItems as $TextPathItem)
     178    foreach ($TextPathItems as $TextPathItem)
    179179    {
    180180      $Result = $this->Geolocate($TextPathItem);
     
    184184
    185185    $WayPoints = array();
    186     foreach($this->Points as $Point)
     186    foreach ($this->Points as $Point)
    187187    {
    188188      $WayPoints[] = $Point['Longitude'];
     
    208208    $Points = array();
    209209    $Separator = '<gml:pos>';
    210     while(strpos($Result, $Separator) !== false)
     210    while (strpos($Result, $Separator) !== false)
    211211    {
    212212      $Result = substr($Result, strpos($Result, $Separator) + strlen($Separator));
     
    215215      $Points[] = array('Longitude' => $PosParts[0], 'Latitude' => $PosParts[1]);
    216216    }
    217     return(array('TotalDistance' => $TotalDistance, 'TotalTime' => $TotalTime,
    218       'Points' => $Points));
     217    return array('TotalDistance' => $TotalDistance, 'TotalTime' => $TotalTime,
     218      'Points' => $Points);
    219219  }
    220220
     
    222222  {
    223223    $WayPoints = array();
    224     foreach($this->Points as $Point)
     224    foreach ($this->Points as $Point)
    225225    {
    226226      $WayPoints[] = $Point['Longitude'];
Note: See TracChangeset for help on using the changeset viewer.