Changeset 7805 for trunk/src/map/inc


Ignore:
Timestamp:
Apr 17, 2010, 4:22:35 PM (15 years ago)
Author:
janveeden
Message:

Comitted some images I forgot to upload. Searchlist now shows nodes, and filters on name automatically while typing. Next up is getting it to filter on locations of nodes too.

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

Legend:

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

    r7802 r7805  
    1414//This function is called from index.php
    1515function initialize_map() {
     16        suggestMarkers("");
    1617        //We will only do this function if the browser is compatible
    1718        if (GBrowserIsCompatible()) {
     
    270271
    271272//Code from w3schools. http://www.w3schools.com/dom/dom_http.asp
    272 function loadXMLDoc(url)
     273function loadXMLDoc(url, targetDiv)
    273274{
    274275xmlhttp=null;
     
    283284if (xmlhttp!=null)
    284285  {
    285   xmlhttp.onreadystatechange=state_Change;
     286  xmlhttp.onreadystatechange=state_Change();
    286287  xmlhttp.open("GET",url,true);
    287288  xmlhttp.send(null);
     
    308309}
    309310
     311function loadSuggest(url)
     312{
     313xmlhttp=null;
     314if (window.XMLHttpRequest)
     315  {// code for Firefox, Opera, IE7, etc.
     316  xmlhttp=new XMLHttpRequest();
     317  }
     318else if (window.ActiveXObject)
     319  {// code for IE6, IE5
     320  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
     321  }
     322if (xmlhttp!=null)
     323  {
     324  xmlhttp.onreadystatechange=state_ChangeSuggest;
     325  xmlhttp.open("GET",url,true);
     326  xmlhttp.send(null);
     327  }
     328else
     329  {
     330  alert("Your browser does not support XMLHTTP.");
     331  }
     332}
     333
     334function state_ChangeSuggest()
     335{
     336if (xmlhttp.readyState==4)
     337  {// 4 = "loaded"
     338  if (xmlhttp.status==200)
     339    {// 200 = "OK"
     340    document.getElementById("searchlist").innerHTML=xmlhttp.responseText;
     341    }
     342  else
     343    {
     344    alert("Problem retrieving data:" + xmlhttp.statusText);
     345    }
     346  }
     347}
     348
    310349function toggleGoogleSearchMap()
    311350{
     
    330369}
    331370
    332 
    333 
    334 
    335 
     371function suggestMarkers(value)
     372{
     373        loadSuggest("inc/suggestions.php?value="+value);
     374}
     375
     376
     377
     378
     379
Note: See TracChangeset for help on using the changeset viewer.