Commit 1b4d1a1c authored by Scott Ames's avatar Scott Ames
Browse files

merge

parents 0854e0ef a92028bb
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -103,12 +103,3 @@ var newAutocomplete = new autoComplete({
        window.location.href = encodedURLString;
    }
});
 No newline at end of file

/*
function unrenderBox(){
  var newAutocomplete = new autoComplete({
      resultsList: {
        render = false,
      },
  }),
}*/
 No newline at end of file
+29 −0
Original line number Diff line number Diff line
	//Declares global variable name array.
	var nameArray = [];      

	//Pushs data onto nameArray variable.
	function loadGeoJson(data) {
	//Sets index to 0.
	var index = 0;
	//While the feature at the current index is not null.
    while (data.features[index] != null){
		//Log the feature name.
		console.log(data.features[index].properties.clean_feature + " " + index);
		//Push the json object at the current index onto nameArray.
		nameArray.push(data.features[index].properties);
		//Increment index.
        index++;
         }
	}
	//Ajax call to WFS server with the features/data need.
	$.ajax({
		//URL of WFS server.
		// Old URL https://astrocloud.wr.usgs.gov/dataset/data/nomenclature/MARS/WFS?version=1.1.0.0&service=WFS&request=GetFeature&srsname=EPSG4326&outputFormat=application/json
		url: "https://wms.wr.usgs.gov/cgi-bin/mapserv?map=/var/www/html/mapfiles/earth/moon_nomen_wfs.map&service=WFS&version=1.1.0&&TYPENAME=MOON_POINT&REQUEST=getfeature&PropertyName=clean_feature&outputformat=application/json;%20subtype=geojson&Filter=%3CFilter%3E%3CPropertyIsLike%20wildcard=%27*%27%20singleChar=%27.%27%20escape=%27!%27%3E%3CPropertyName%3Eclean_feature%3C/PropertyName%3E%3CLiteral%3EA*%3C/Literal%3E%3C/PropertyIsLike%3E%3C/Filter%3E",
		//Data type of file on WFS server/above URL.
		dataType: 'json',
		//When the server is successfully connect to, run loadGeoJson function.
		success: loadGeoJson,
		//Timeout on connection to server (WILL NEED TO LOWER WHEN NEW SERVER IS AVAILABLE).
		timeout : 320000
		});
 No newline at end of file
+4 −33
Original line number Diff line number Diff line
@@ -15,45 +15,16 @@
	<!--Link to demo stylesheet, keeping for now in case I need it.
		<head><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@7.2.0/dist/css/autoComplete.min.css">
	</head>-->
	<script src="./render.js"></script>
	<!-- Declares id of input field which will be used for the autcomplete.-->
	<input id="autoComplete" tabindex="1"></input>  <!-- Default "id" value = "autoComplete"> -->
	<input id="autoComplete" tabindex="1" onfocusout="unrenderBox()" onfocusin="renderBox()"></input>  <!-- Default "id" value = "autoComplete"> -->
	<body>
	<!-- Gets the other autocomplete file library for use (Doesn't look like I need this, keeping it for now just in case).
	<script src="./autoComplete.js/dist/js/autoComplete.min.js"></script> -->
	<!-- Gets require.js for use in autcomplete.-->
	<script src="./require.js"></script>
	<script>  

	//Declares global variable name array.
	var nameArray = [];      

	//Pushs data onto nameArray variable.
	function loadGeoJson(data) {
	//Sets index to 0.
	var index = 0;
	//While the feature at the current index is not null.
    while (data.features[index] != null){
		//Log the feature name.
		console.log(data.features[index].properties.clean_feature + " " + index);
		//Push the json object at the current index onto nameArray.
		nameArray.push(data.features[index].properties);
		//Increment index.
        index++;
         }
	}
	//Ajax call to WFS server with the features/data need.
	$.ajax({
		//URL of WFS server.
		// Old URL https://astrocloud.wr.usgs.gov/dataset/data/nomenclature/MARS/WFS?version=1.1.0.0&service=WFS&request=GetFeature&srsname=EPSG4326&outputFormat=application/json
		url: "https://wms.wr.usgs.gov/cgi-bin/mapserv?map=/var/www/html/mapfiles/earth/moon_nomen_wfs.map&service=WFS&version=1.1.0&&TYPENAME=MOON_POINT&REQUEST=getfeature&PropertyName=clean_feature&outputformat=application/json;%20subtype=geojson&Filter=%3CFilter%3E%3CPropertyIsLike%20wildcard=%27*%27%20singleChar=%27.%27%20escape=%27!%27%3E%3CPropertyName%3Eclean_feature%3C/PropertyName%3E%3CLiteral%3EA*%3C/Literal%3E%3C/PropertyIsLike%3E%3C/Filter%3E",
		//Data type of file on WFS server/above URL.
		dataType: 'json',
		//When the server is successfully connect to, run loadGeoJson function.
		success: loadGeoJson,
		//Timeout on connection to server (WILL NEED TO LOWER WHEN NEW SERVER IS AVAILABLE).
		timeout : 320000
		});
	</script>
	<!-- Gets the current server-->
	<script src="./getServer.js"></script>
	<!-- Declares main js file for autocomplete functionality.-->
	<script src="./customIndex.js"></script>

+2 −1
Original line number Diff line number Diff line
@@ -327,7 +327,8 @@ div.search_wrapper {
}

#autoComplete{
  border:     none;
  border-style: solid;
  border-width: 2px;
  color:   #000000;
  height:     21px;
  width:     150px;

AutoComplete/render.js

0 → 100644
+6 −0
Original line number Diff line number Diff line
function unrenderBox(){
    document.getElementById("#autoComplete_list").style.visibility = "hidden";
}
function renderBox(){
    document.getElementById("#autoComplete_list").style.visibility = "visible";
}
 No newline at end of file