Changeset 7822 for trunk/src/map


Ignore:
Timestamp:
Apr 18, 2010, 10:23:42 AM (15 years ago)
Author:
janveeden
Message:

Added commenting in suggestions.php. Clicking on a node from a list now also displays the nodeinfo.

Location:
trunk/src/map/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/map/inc/nodemapWL.js

    r7820 r7822  
    358358                {
    359359                        map.setCenter(markerArray[i].getLatLng(), 15);
     360                        loadXMLDoc("inc/node_info.php?type=single&name="+value+"")
    360361                }
    361362        }
  • trunk/src/map/inc/suggestions.php

    r7820 r7822  
    22require_once("../../config.php");
    33require_once($config['root']."/map/inc/kmlHandler.php");
     4/*
     5 * Get the array containing all the nodes
     6 */
     7$markers = get_node_array($config['kml_file']);
    48
    5 $markers = get_node_array($config['kml_file']);
     9
    610$suggested_markers = array();
    711
     12/*
     13 * Get the value that has been sent in the url, if theres no value in the url, the value will be nothing.
     14 */
    815if(isset($_GET['value']))
    916{
     
    1522}
    1623
     24/*
     25 * Fill the markernames array with all the names from markers we have on the map.
     26 */
    1727foreach($markers as $marker)
    1828{
     
    2030}
    2131
     32/*
     33 * If the typed value is equal to the first part of a node name, the nodename is inserted into the $suggested_markers array
     34 */
    2235if (strlen($typed_value) > 0)
    23   {
     36{
    2437  for($i=0; $i<count($markernames); $i++)
    2538    {
    26         $hint= "";
    27     if (strtolower($typed_value)==strtolower(substr($markernames[$i],0,strlen($typed_value))))
    28       {
     39                $hint= "";
     40                if (strtolower($typed_value)==strtolower(substr($markernames[$i],0,strlen($typed_value))))
     41                {
     42                        $suggested_markers[]=$markernames[$i];
     43                }
     44   }
     45}
    2946
    30         $suggested_markers[]=$markernames[$i];
    31      }
    32    }
    33  }
    34  
     47/*
     48 * If there are no suggested markers, check if there is something that has been typed.
     49 * If so there are no suggestions found.
     50 * Else there has been nothing typed, so we show all the markers we have.
     51 */
    3552if ($suggested_markers == null)
    3653{
     
    4562}
    4663
     64/*
     65 * Make a list with all the suggested markers we have.
     66 * onchange we call the goToMarker function in nodemapWL.js and set the constructor with the value of the selected option.
     67 */
    4768echo "<select multiple onchange='goToMarker(this.options[this.selectedIndex].text)'>";
    4869foreach($suggested_markers as $name)
Note: See TracChangeset for help on using the changeset viewer.