Changeset 7822 for trunk/src/map
- Timestamp:
- Apr 18, 2010, 10:23:42 AM (15 years ago)
- Location:
- trunk/src/map/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/map/inc/nodemapWL.js
r7820 r7822 358 358 { 359 359 map.setCenter(markerArray[i].getLatLng(), 15); 360 loadXMLDoc("inc/node_info.php?type=single&name="+value+"") 360 361 } 361 362 } -
trunk/src/map/inc/suggestions.php
r7820 r7822 2 2 require_once("../../config.php"); 3 3 require_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']); 4 8 5 $markers = get_node_array($config['kml_file']); 9 6 10 $suggested_markers = array(); 7 11 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 */ 8 15 if(isset($_GET['value'])) 9 16 { … … 15 22 } 16 23 24 /* 25 * Fill the markernames array with all the names from markers we have on the map. 26 */ 17 27 foreach($markers as $marker) 18 28 { … … 20 30 } 21 31 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 */ 22 35 if (strlen($typed_value) > 0) 23 36 { 24 37 for($i=0; $i<count($markernames); $i++) 25 38 { 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 } 29 46 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 */ 35 52 if ($suggested_markers == null) 36 53 { … … 45 62 } 46 63 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 */ 47 68 echo "<select multiple onchange='goToMarker(this.options[this.selectedIndex].text)'>"; 48 69 foreach($suggested_markers as $name)
Note:
See TracChangeset
for help on using the changeset viewer.