- The following values are determined sever-side on the first request. + The following values are determined server-side on the first request. As the server has no location information to work from, these values will all be unknown:
- Country -
- ${country.hasValue() ? country.getValue() : "Unknown: ".concat(country.getNoValueMessage())}
- State -
- ${state.hasValue() ? state.getValue() : "Unknown: ".concat(state.getNoValueMessage())}
- County -
- ${county.hasValue() ? county.getValue() : "Unknown: ".concat(county.getNoValueMessage())}
- Town/City -
- ${town.hasValue() ? town.getValue() : "Unknown: ".concat(town.getNoValueMessage())}
When the button below is clicked, JavaScript running on the client-side will be used to obtain additional evidence (i.e. the location information from the device). If no additional information appears then it may indicate an external problem such as JavaScript being disabled in your browser. @@ -74,11 +74,11 @@ if (data.location) { fieldValues.push(["Country", data.location.country]); fieldValues.push(["State", data.location.state]); - fieldValues.push(["County", data.location.country]); + fieldValues.push(["County", data.location.county]); fieldValues.push(["Town/City", data.location.town]); } else { - fieldValue.push(["Location data is empty. This probably means that something has gone wrong with the JavaScript evaluation.", ""]) + fieldValues.push(["Location data is empty. This probably means that something has gone wrong with the JavaScript evaluation.", ""]) } displayValues(fieldValues); }, 'location'); @@ -88,7 +88,7 @@ var list = document.createElement("dl"); fieldValues.forEach(function (entry) { var name = document.createElement("dt"); - var value = document.createElement('dv'); + var value = document.createElement('dd'); var bold = document.createElement('strong'); var fieldname = document.createTextNode(entry[0]); var fieldvalue = document.createTextNode(entry[1]); diff --git a/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java b/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java index f7580ce01..b7d974347 100644 --- a/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java +++ b/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java @@ -132,19 +132,19 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re "\n" + "
\n" + - " The following values are determined sever-side on the first request.\n" + + " The following values are determined server-side on the first request.\n" + " As the server has no location information to work from, these \n" + " values will all be unknown:\n" + "
\n" + "- \n" +
"
- Country \n" + - "
- " + (country.hasValue() ? country.getValue() : "Unknown: " + country.getNoValueMessage()) + " \n" + "
- State \n" + - "
- " + (state.hasValue() ? state.getValue() : "Unknown: " + state.getNoValueMessage()) + " \n" + "
- County \n" + - "
- " + (county.hasValue() ? county.getValue() : "Unknown: " + county.getNoValueMessage()) + " \n" + "
- Town/City \n" + - "
- " + (town.hasValue() ? town.getValue() : "Unknown: " + town.getNoValueMessage()) + " \n" + "
\n" + " When the button below is clicked, JavaScript running on the client-side will be used to obtain additional evidence (i.e. the location information from the device). If no additional information appears then it may indicate an external problem such as JavaScript being disabled in your browser.\n" + @@ -171,11 +171,11 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re " if (data.location) {\n" + " fieldValues.push([\"Country\", data.location.country]);\n" + " fieldValues.push([\"State\", data.location.state]);\n" + - " fieldValues.push([\"County\", data.location.country]);\n" + + " fieldValues.push([\"County\", data.location.county]);\n" + " fieldValues.push([\"Town/City\", data.location.town]);\n" + " }\n" + " else {\n" + - " fieldValue.push([\"Location data is empty. This probably means that something has gone wrong with the JavaScript evaluation.\", \"\"])\n" + + " fieldValues.push([\"Location data is empty. This probably means that something has gone wrong with the JavaScript evaluation.\", \"\"])\n" + " }\n" + " displayValues(fieldValues);\n" + " }, 'location');\n" + @@ -185,7 +185,7 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re " var list = document.createElement('dl');\n" + " fieldValues.forEach(function (entry) {\n" + " var name = document.createElement('dt');\n" + - " var value = document.createElement('dv');\n" + + " var value = document.createElement('dd');\n" + " var bold = document.createElement('strong');\n" + " var fieldname = document.createTextNode(entry[0]);\n" + " var fieldvalue = document.createTextNode(entry[1]);\n" +