POST
|
App2.js
require(["dojo/data/ObjectStore",
"dijit/registry",
"dojo/store/Memory",
"dgrid/OnDemandGrid",
"dojo/ready",
"esri/tasks/query",
"esri/tasks/QueryTask",
"dojo/dom",
"dojo/on",
"dojo/_base/array",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojo/domReady!"],
function(ObjectStore,
registry,
Memory,
Grid,
ready,
Query,
QueryTask,
dom,
on,
array){
ready(function(){
var myQueryTask, myQuery;
myQueryTask = new QueryTask("http://.../ArcGIS/rest/services/aasggeothermal/AZWellHeaders/MapServer/0");
myQuery = new Query();
myQuery.returnGeometry = false;
myQuery.outFields = ["apino","otherid","wellname","county","twp","rge","section_","drillertotaldepth","formationtd","field","relatedresource","welltype"];
function runQuery(){
var apiNo = dom.byId('apinum').value;
var otherId = dom.byId('stateperm').value;
var wellName = dom.byId('wellnameid');
var county = dom.byId('countyid');
var twp = dom.byId('twpid');
var rge = dom.byId('rgeid');
var section = dom.byId('sectionid');
var drillerDepth = dom.byId('depthid');
var formation = dom.byId('formationtdid');
var field = dom.byId('fieldid');
myQuery.where ="apino like '%" + apiNo + "%'" + " OR " + "otherid like '%" + otherId + "%'";
myQueryTask.execute(myQuery,updateGrid);
}
function apiQuery(){
var apiNo = dom.byId('apinum').value;
myQuery.where ="apino like '%" + apiNo + "%'";
myQueryTask.execute(myQuery,updateGrid);
}
function stPerQuery(){
var otherId = dom.byId('stateperm').value;
myQuery.where ="otherid like '%" + otherId + "%'" + " AND " +"apino like '02-%'";
myQueryTask.execute(myQuery,updateGrid);
}
function countQuery(){
var county = dom.byId('countyid').value;
myQuery.where ="county like '%" + county+ "%'" + " AND " +"apino like '02-%'";
myQueryTask.execute(myQuery,updateGrid);
}
function fieldQuery(){
var field = dom.byId('fieldid').value;
myQuery.where ="field like '%" + field + "%'" + " AND " +"apino like '02-%'";
myQueryTask.execute(myQuery,updateGrid);
}
function twnQuery(){
var twp = dom.byId('twpid').value;
myQuery.where ="twp like '%" + twp + "%'" + " AND " +"apino like '02-%'";
myQueryTask.execute(myQuery,updateGrid);
}
function rgeQuery(){
var rge = dom.byId('rgeid').value;
myQuery.where ="rge like '%" + rge + "%'" + " AND " +"apino like '02-%'";
myQueryTask.execute(myQuery,updateGrid);
}
function sectQuery(){
var section = dom.byId('sectionid').value;
myQuery.where ="section_ like '%" + section + "%'" + " AND " +"apino like '02-%'";
myQueryTask.execute(myQuery,updateGrid);
}
function operQuery(){
var operator = dom.byId('operatorid').value;
myQuery.where ="operator like '%" + operator + "%'" + " AND " +"apino like '02-%'";
myQueryTask.execute(myQuery,updateGrid);
}
function wellNaQuery(){
var wellName = dom.byId('wellnameid').value;
myQuery.where ="wellname like '%" + wellName + "%'" + " AND " +"apino like '02-%'";
myQueryTask.execute(myQuery,updateGrid);
}
function depthQuery(){
var drillerDepth = dom.byId('depthid').value;
myQuery.where ="drillertotaldepth >=" + drillerDepth + " AND " +"apino like '02-%'";
myQueryTask.execute(myQuery,updateGrid);
}
function formQuery(){
var formation = dom.byId('formationtdid').value;
myQuery.where ="formationtd like '%" + formation + "%'" + " AND " +"apino like '02-%'";
myQueryTask.execute(myQuery,updateGrid);
}
function showResults(myFeatures){
console.log(myFeatures);
var s = "";
for (var i=0, il=myFeatures.features.length; i < il; i++) {
var featureAttributes = myFeatures.features.attributes;
for (att in featureAttributes) {
s = s + "<strong>" + att + ": </strong>" + featureAttributes[att] + "<br />";
}
}
dojo.byId("info").innerHTML = s;
}
function updateGrid(featureSet){
console.log(featureSet);
var data=[];
var grid = registry.byId('grid');
array.forEach(featureSet.features, function (entry) {
var logs = [],
las = [],
folders = [],
relatedResource = entry.attributes.relatedresource === null ? "no value" : entry.attributes.relatedresource;
var raw = relatedResource.split("|");
raw.forEach(function (bit){
var resource = bit.split(", ");
if (resource[0] && resource[1]){
var url = resource[1].trim();
var name = resource[0].trim();
}
var anchor = "<li><a href='" + url + "' target='_blank'>" + name + "</a></li>";
if (url != null ){
if ( url.indexOf(".tif", url.length -4) !==-1){
logs.push(anchor);
}
if ( url.indexOf(".pdf", url.length -4) !==-1){
folders.push(anchor);
}
if ( url.indexOf(".las", url.length -4) !==-1){
las.push(anchor);
}
}
});
data.push({
objectid:entry.attributes.objectid,//0
apino:entry.attributes.apino,//1
otherid:entry.attributes.otherid,//2
wellname:entry.attributes.wellname,//3
county:entry.attributes.county,//4
twp:entry.attributes.twp,//5
rge:entry.attributes.rge,//6
section_:entry.attributes.section_,//8
drillertotaldepth:entry.attributes.drillertotaldepth,//9
formationtd:entry.attributes.formationtd,//10
logField: '<ul>' + logs.join(" ") + '</ul>',
lasField: '<ul>' + las.join(" ") + '</ul>',
folderField: '<ul>' + folders.join(" ") + '</ul>'
});
});
var dataForGrid= {
items: data
};
console.log(data);
var store = new ObjectStore({objectStore: new Memory({data:dataForGrid}) });
grid.setStore(store);
}
on(dom.byId("executeApi"), "click", apiQuery);
on(dom.byId("executeSP"), "click", stPerQuery);
on(dom.byId("executeCount"), "click", countQuery);
on(dom.byId("executeField"), "click", fieldQuery);
on(dom.byId("executePLSS"), "click", twnQuery);
on(dom.byId("executeOper"), "click", operQuery);
on(dom.byId("executeWellN"), "click", wellNaQuery);
on(dom.byId("executeDepth"), "click", depthQuery);
on(dom.byId("executeForm"), "click", formQuery);
});
});
CSS
head{
height: 100%;
width: 100%;
}
body {
background: -webkit-gradient(linear, left bottom, left top, color-stop(0.46, rgb(250, 243, 232)), color-stop(0.67, rgb(244, 226, 207)), color-stop(0.87, rgb(233, 202, 161))) no-repeat;
height: 100%;
width: 100%;
margin: 0;
}
#titleBar{
position:relative;
overflow: hidden;
}
#titleText{
padding-left: 1px;
text-align: left;
z-index: 5;
position: absolute;
left: 1%;
font-family: "Helvetica Nueue","Trebuchet MS",Arial,"Nimbus Sans L",FreeSans,sans-serif;
font-weight: bold;
font-size: 125%;
overflow: inherit;
}
#titleImg{
position: absolute;
right: 1%;
top: 5%;
z-index: 5;
padding-right: 1px;
overflow: inherit;
}
#navigationMenu {
background: -webkit-gradient(linear,left bottom,left top,color-stop(0.08, #B87147),color-stop(0.54, #9B440E) );
border: 1px gray;
padding:1px;
color: #feffff;
text-align: center;
z-index: 5;
}
#navigationMenu li {
display:inline;
padding: 25px;
}
.mapMenus a:link{
color: #feffff;
text-decoration: none;
}
.mapMenus a:visited{
color: #feffff;
text-decoration: none;
}
.mapMenus a:hover{
color: #feffff;
text-decoration: underline;
}
.mapMenus a:active{
color: #feffff;
text-decoration: none;
}
#search_info {
border-left:1px solid gray;
border-right:1px solid gray;
border-top:1px solid gray;
border-bottom:1px solid gray;
background: #E9CAA1;
}
#image_box {
border:1px solid gray;
float:right;
padding-right:10px;
padding-top:10px;
padding-left:10px;
padding-bottom:10px;
margin-top:10px;
margin-right:10px;
}
#img_info {
border-top:1px solid gray;
padding-bottom:-10px;
padding-left:10px;
padding-right:10px;
margin-left:-10px;
margin-right:-10px;
}
form table {
border:1px solid gray;
width: 382px;
}
#outGrid{
font-size: 75%;
}
... View more
09-25-2013
09:12 AM
|
0
|
0
|
547
|
POST
|
My website is not filling the screen. My CSS sets the html and body to a height of 100%. On top of that my dojo grid is not displaying with the correct CSS. Anyone have any ideas on why either of those don't display correctly? [HTML] <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Text Search</title> <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/esri/css/esri.css"> <script> var dojoConfig = { parseOnLoad:true }; </script> <script src="http://js.arcgis.com/3.6/"></script> <script src="Scripts/App2.js"></script> <script> dojo.require("dojox.grid.DataGrid"); </script> <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/dojo/dojox/grid/resources/Grid.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/dojo/dojox/grid/resources/tundraGrid.css"> <link rel="stylesheet" href="Styles/Base.css"> <style> </style> </head> <body class="tundra"> <div id="titleBar"> <div id="titleText" class="mapMenus"> <a href='http://azogcc.az.gov/'>ARIZONA OIL AND GAS <br>CONSERVATION COMMISSION</a> </div> <div id="navigationMenu" class="mapMenus"> <ul> <li><a href='http://azogcc.az.gov/'>Home</a></li> <li><a href='http://azgs.az.gov/'>AZGS</a></li> <li><a href='http://welldata.azogcc.az.gov/index.html'>Map Search</a></li> <li><a href='http://welldata.azogcc.az.gov/PyCh_index.html'>Text Search</a></li> </ul> </div> <div id="titleImg" class="mapMenus"> <a href='http://azgs.az.gov/'><img src="photos/AZ_state_seal2.png" height="49" width="49"></a> </div> </div> <div id="search_info" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'"> <p> <span id="TextSearch"><strong>Text Search:</strong></span> Complete one or multiple fields and press the Submit Search button to search for wells based on their attributes. Selecting LAS data will open the LAS data in a text file. The selected LAS data can be saved and downloaded by using the save page as function. </p> </div> <div id="search_body" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline', gutters:false" style="width: 100%; height: 100%; margin: 0;"> <div id="image_box" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'right'"> <image src="photos/Arizona_Meridians_Labled.jpg" height="385" width="350"> <div id="img_info"> <p>Map of Arizona State Meridians</p> </div> </image> </div> <div id="forum" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'left'"> <form action=""> <table> <tr> <td class="label"> <label for="apinum">API Number</label> </td> <td> <input type="text" name="apino" id="apinum" size="14" maxlength="14" placeholder="02-005-00000"><br> </td> </tr> <tr> <td> <input type="button" id="executeApi" value="Search by API"/> </td> </tr> </table> </form> </div> <div id="outGrid" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: bottom"> <!-- https://developers.arcgis.com/en/javascript/jssamples/fl_paging.html --> <table data-dojo-type="dojox.grid.DataGrid" escapeHTMLInData="false" jsid="grid" id="grid" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'" style="height:100%; width:100%"> <thead> <tr> <th field="apino" width="auto">API No</th> <th field="otherid" width="auto">State Permit No</th> <th field="wellname" width="auto">Operator</th> <th field="county" width="auto">County</th> <th field="twp" width="auto">Township</th> <th field="rge" width="auto">Range</th> <th field="section_" width="auto">Section</th> <th field="drillertotaldepth" width="auto">Depth (ft)</th> <th field="formationtd" width="auto">Formation at Depth</th> <th field="folderField" width="auto" >Well Folder</th> <th field="logField" width="auto" >Scanned Well Log</th> <th field="lasField" width="auto" >LAS Data</th> </tr> </thead> </table> </div> </div> </body> </html> [/HTML]
require(["dojo/data/ObjectStore",
"dijit/registry",
"dojo/store/Memory",
"dgrid/OnDemandGrid",
"dojo/ready",
"esri/tasks/query",
"esri/tasks/QueryTask",
"dojo/dom",
"dojo/on",
"dojo/_base/array",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojo/domReady!"],
function(ObjectStore,
registry,
Memory,
Grid,
ready,
Query,
QueryTask,
dom,
on,
array){
ready(function(){
var myQueryTask, myQuery;
myQueryTask = new QueryTask("http://.../ArcGIS/rest/services/aasggeothermal/AZWellHeaders/MapServer/0");
myQuery = new Query();
myQuery.returnGeometry = false;
myQuery.outFields = ["apino","otherid","wellname","county","twp","rge","section_","drillertotaldepth","formationtd","field","relatedresource","welltype"];
function runQuery(){
var apiNo = dom.byId('apinum').value;
var otherId = dom.byId('stateperm').value;
var wellName = dom.byId('wellnameid');
var county = dom.byId('countyid');
var twp = dom.byId('twpid');
var rge = dom.byId('rgeid');
var section = dom.byId('sectionid');
var drillerDepth = dom.byId('depthid');
var formation = dom.byId('formationtdid');
var field = dom.byId('fieldid');
myQuery.where ="apino like '%" + apiNo + "%'" + " OR " + "otherid like '%" + otherId + "%'";
myQueryTask.execute(myQuery,updateGrid);
}
function apiQuery(){
var apiNo = dom.byId('apinum').value;
myQuery.where ="apino like '%" + apiNo + "%'";
myQueryTask.execute(myQuery,updateGrid);
}
on(dom.byId("executeApi"), "click", apiQuery);
});
});
[ATTACH=CONFIG]27747[/ATTACH]
... View more
09-25-2013
08:47 AM
|
0
|
6
|
957
|
POST
|
Does anyone one know of a way to set a definition expression on a query? I have about 4,000 records in my service but I want to limit all queries to about 1,000 of those records.
... View more
09-16-2013
12:55 PM
|
0
|
2
|
2073
|
POST
|
Do two things: 1. Add "dijit/registry" to the dependency list, and use registry as the alias. 2. Change: var grid = dom.byId('grid'); To: var grid = registry.byId('grid'); I made those changes and it is still not showing up in my grid. Any other idea?
... View more
09-16-2013
11:46 AM
|
0
|
0
|
409
|
POST
|
My query that I am running returns good results in my console but will not display in my dojo grid. My function that populates the grid performs some extra work by pulling multiple hyperlinks out of one field and separating into different columns in the grid based on the extensions. Can anyone see why my function doesn't populate my grid? I can post more code if anyone needs. require(["dojo/store/Memory","dojox/grid/DataGrid", "dojo/ready", * * "esri/tasks/query","esri/tasks/QueryTask", * * "dojo/dom","dojo/on","dojo/_base/array","dojo/domReady!"], function(Memory,DataGrid,ready,Query,QueryTask,dom,on,array){ ready(function(){ var myQueryTask, myQuery; myQueryTask = new QueryTask("http://.../ArcGIS/rest/services/aasggeothermal/AZWellHeaders/MapServer/0"); myQuery = new Query(); myQuery.returnGeometry = false; myQuery.outFields = ["*"]; function runQuery(){ var apiNo = dom.byId('apinum').value; var otherId = dom.byId('stateperm'); myQuery.where ="apino like '%" + apiNo + "%'" + " OR " + "otherid like '%" + otherId + "%'"; myQueryTask.execute(myQuery,updateGrid); } function updateGrid(featureSet){ var data=[]; var grid = dom.byId('grid'); array.forEach(featureSet.features, function (entry) { var logs = [], las = [], folders = [], relatedResource = entry.attributes.relatedresource === null ? "no value" : entry.attributes.relatedresource; var raw = relatedResource.split("|"); raw.forEach(function (bit){ var resource = bit.split(", "); if (resource[0] && resource[1]){ var url = resource[1].trim(); var name = resource[0].trim(); } var anchor = "<li><a href='" + url + "' target='_blank'>" + name + "</a></li>"; if (url != null ){ if ( url.indexOf(".tif", url.length -4) !==-1){ logs.push(anchor); } if ( url.indexOf(".pdf", url.length -4) !==-1){ folders.push(anchor); } if ( url.indexOf(".las", url.length -4) !==-1){ las.push(anchor); } } }); data.push({ objectid:entry.attributes.objectid,//0 apino:entry.attributes.apino,//1 otherid:entry.attributes.otherid,//2 wellname:entry.attributes.wellname,//3 county:entry.attributes.county,//4 twp:entry.attributes.twp,//5 rge:entry.attributes.rge,//6 section_:entry.attributes.section_,//8 drillertotaldepth:entry.attributes.drillertotaldepth,//9 formationtd:entry.attributes.formationtd,//10 logField: '<ul>' + logs.join(" ") + '</ul>', lasField: '<ul>' + las.join(" ") + '</ul>', folderField: '<ul>' + folders.join(" ") + '</ul>' }); }); var dataForGrid= { items: data }; console.log(data); var store = new Memory({data:dataForGrid}); grid.setStore(store); } [HTML] <div id="outGrid" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'"> <table data-dojo-type="dojox.grid.DataGrid" escapeHTMLInData="false" jsid="grid" id="grid" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'" style="height:100%; width:100%"> <thead> <tr> <th field="apino" width="auto">API No</th> <th field="otherid" width="auto">State Permit No</th> <th field="wellname" width="auto">Operator</th> <th field="county" width="auto">County</th> <th field="twp" width="auto">Township</th> <th field="rge" width="auto">Range</th> <th field="section_" width="auto">Section</th> <th field="drillertotaldepth" width="auto">Depth (ft)</th> <th field="formationtd" width="auto">Formation at Depth</th> <th field="folderField" width="auto" >Well Folder</th> <th field="logField" width="auto" >Scanned Well Log</th> <th field="lasField" width="auto" >LAS Data</th> </tr> </thead> </table> </div> [/HTML] I'm just learning to use version 3.6 and AMD. I am more familiar with 3.5 and Legacy.
... View more
09-16-2013
08:51 AM
|
0
|
3
|
1077
|
POST
|
Thanks for the help. I have only worked the the dojo grids once before and I stumbled my way through.
... View more
09-13-2013
08:47 AM
|
0
|
0
|
411
|
POST
|
Can anyone tell me why my grid CSS is not being applied? As far as I can see I don't have any other css overwriting it. [HTML] <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Text Search</title> <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/esri/css/esri.css"> <script src="http://js.arcgis.com/3.6/"></script> <script src="Scripts/App2.js"></script> <link rel="stylesheet" href="Styles/Base.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/dojo/dojox/grid/resources/Grid.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/dojo/dojox/grid/resources/tundraGrid.css"> <style> </style> </head> <body> <div id="outGrid"> <!--data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'"--> <!-- https://developers.arcgis.com/en/javascript/jssamples/fl_paging.html --> <table data-dojo-type="dojox.grid.DataGrid" escapeHTMLInData="false" jsid="grid" id="grid" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'" style="height:100%; width:100%"> <thead> <tr> <th field="apino" width="auto">API No</th> <th field="otherid" width="auto">State Permit No</th> <th field="wellname" width="auto">Operator</th> <th field="county" width="auto">County</th> <th field="twp" width="auto">Township</th> <th field="rge" width="auto">Range</th> <th field="section_" width="auto">Section</th> <th field="drillertotaldepth" width="auto">Depth (ft)</th> <th field="formationtd" width="auto">Formation at Depth</th> <th field="folderField" width="auto" >Well Folder</th> <th field="logField" width="auto" >Scanned Well Log</th> <th field="lasField" width="auto" >LAS Data</th> </tr> </thead> </table> </div> </body> [/HTML]
... View more
09-12-2013
02:57 PM
|
0
|
2
|
846
|
POST
|
Everytime I try to run my query I get Error {code: 400, message: "Unable to complete operation.", details: Array[1], log: undefined, httpCode: 400} init.js From what I understand this is a pretty generic error so I don't have much to work with. Can anyone with a little more experience see what is causing the error? require(["dojox/grid/DataGrid", "dojo/ready", "esri/tasks/query","esri/tasks/QueryTask", "dojo/dom","dojo/on","dojo/domReady!"], function(DataGrid,ready,Query,QueryTask,dom,on){ ready(function(){ var myQueryTask, myQuery; myQueryTask = new QueryTask("http://services.azgs.az.gov/ArcGIS/rest/services/aasggeothermal/AZWellHeaders/MapServer/0"); myQuery = new Query(); myQuery.returnGeometry = false; myQuery.outFeilds = ["*"] function runQuery(){ var apiNo = dom.byId('apinum').value; var otherId = dom.byId('stateperm'); myQuery.where ="apino like '%" + apiNo + "%'" + "OR" + "otherid like '%" + otherId + "%'"; myQueryTask.execute(myQuery,showResults); } function showResults(myFeatures){ console.log(myFeatures); var s = ""; for (var i=0, il=myFeatures.features.length; i < il; i++) { var featureAttributes = myFeatures.features.attributes; for (att in featureAttributes) { s = s + "<strong>" + att + ": </strong>" + featureAttributes[att] + "<br />"; } } dojo.byId("info").innerHTML = s; } on(dom.byId("executeButton"), "click", runQuery); }); });
... View more
09-12-2013
01:09 PM
|
0
|
1
|
580
|
POST
|
I know this is going to be a lot of code but can anyone tell me why nothing happens when I click my submit search button. It should run my query but I get nothing. JavaScript: dojo.require("dojo.data.ItemFileReadStore"); require(["dojox/grid/DataGrid", "dojo/ready",//"dojo/data/ItemFileReadStore", "esri/tasks/query","esri/tasks/QueryTask", "dojo/dom","dojo/on","dojo/domReady!"], function(ready,on,Query,QueryTask,dom){ ready(function(){ //function init(){ var myQueryTask, myQuery; myQueryTask = new QueryTask("http://.../ArcGIS/rest/services/aasggeothermal/AZWellHeaders/MapServer/0"); myQuery = new Query(); myQuery.returnGeometry = false; myQuery.outFeilds = ["*"] //} function runQuery(){ //myQuery.text = dom.byId("twpid").value; var apiNo = dom.byId('apinum').value; var otherId = dojo.byId('stateperm'); var wellName = dojo.byId('wellnameid'); var county = dojo.byId('countyid'); var twp = dojo.byId('twpid'); var rge = dojo.byId('rgeid'); var section = dojo.byId('sectionid'); var drillerDepth = dojo.byId('depthid'); var formation = dojo.byId('formationtdid'); var field = dojo.byId('fieldid'); myQuery.where ="apino = '" +apiNo +"'"; //apino otherid wellname county twp rge section_ drillertotaldepth formationtd field myQueryTask.execute(myQuery,updateGrid); } on(dom.byId("executeButton"), "click", runQuery); }); }); HTML code: [HTML] <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Text Search</title> <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/esri/css/esri.css"> <script src="http://js.arcgis.com/3.6/"></script> <script src="Scripts/App2.js"></script> <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/dojo/dojox/grid/resources/Grid.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/dojo/dojox/grid/resources/tundraGrid.css"> <link rel="stylesheet" href="Styles/Base.css"> <style type="text/css"> </style> </head> <body> <div id="tab_body"> <div id="titleBar"> <div id="titleText" class="mapMenus"> <a href='http://azogcc.az.gov/'>ARIZONA OIL AND GAS <br>CONSERVATION COMMISSION</a> </div> <div id="titleImg" class="mapMenus"> <a href='http://azgs.az.gov/'><img src="photos/AZ_state_seal2.png" height="49" width="49"></a> </div> </div> <div id="navigationMenu" class="mapMenus"> <ul> <li><a href='http://azogcc.az.gov/'>Home</a></li> <li><a href='http://azgs.az.gov/'>AZGS</a></li> <li><a href='http://welldata.azogcc.az.gov/OilGasViewer.html'>Map Search</a></li> <li><a href='http://welldata.azogcc.az.gov/PyCh_index.html'>Text Search</a></li> </ul> </div> <div id="image_box"> <image src="photos/Arizona_Meridians.jpg"> <div id="img_info"> <p>Map of Arizona State Meridians</p> </div> </image> </div> <form action=""> <div id="search_body"> <div id="search_info"> <p> <span id="TextSearch">Text Search:</span> Complete one or multiple fields and press the Submit Search button to search for wells based on their attributes. Selecting LAS data will open the LAS data in a text file. The selected LAS data can be saved and downloaded by using the save page as function. </p> </div> <table> <tr> <td class="label"> <label for="apinum">API Number</label> </td> <td> <input type="text" name="apino" id="apinum" size="14" maxlength="14"><br> </td> </tr> <tr> <td class="label"> <label for="stateperm"> State Permit</label> </td> <td> <input type="text" name="otherid" id="stateperm" size="4" maxlength="4"><br> </td> </tr> <tr> <td class="label"> <label for="countyid">County</label> </td> <td> <select name="county" id="countyid"> <option value=" "> </option> <option value="Apache">Apache</option> </select> </td> </tr> <tr> <td class="label"> <label for="fieldid">Field Name</label> </td> <td> <input type="text" name="field" id="fieldid" size="30" maxlength="30"><br> </td> </tr> <tr> <td class="label"> <label for="twpid">Township</label> </td> <td> <input type="text" name="twp" id="twpid" size="4" maxlength="4"><br> </td> </tr> <tr> <td class="label"> <label for="rgeid">Range</label> </td> <td> <input type="text" name="rge" id="rgeid" size="4" maxlength="4"><br> </td> </tr> <tr> <td class="label"> <label for="sectionid">Section</label> </td> <td> <select name="section_" id="sectionid"> <option value=""> </option> <option value="1">1</option> <option value="2">2</option> </select> </td> </tr> <tr> <td> <label for="operatorid">Operator</label> </td> <td> <input type="text" name="operator" id="operatorid" size="30" maxlength="30"><br> </td> </tr> <tr> <td class="label"> <label for="wellnameid">Well Name</label> </td> <td> <input type="text" name="wellname" id="wellnameid" size="30" maxlength="30"><br> </td> </tr> <tr> <td class="label"> <label for="depthid">Well Depth</label> </td> <td> <input type="text" name="drillertotaldepth" id="depthid" size="10" maxlength="10"><br> </td> </tr> <tr> <td class="label"> <label for="formationtdid">Formation at Total Depth</label> </td> <td> <input type="text" name="formationtd" id="formationtdid" size="30" maxlength="30"><br> </td> </tr> <tr> <td> <input type="button" id="executeButton" value="Submit Search"/> </td> <td> <input type="reset" value="Reset Search"/> </td> </tr> </table> </div> </form> <div id="results"> <!--data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'">--> <!-- https://developers.arcgis.com/en/javascript/jssamples/fl_paging.html --> <table data-dojo-type="dojox.grid.DataGrid" escapeHTMLInData="false" jsid="grid" id="grid" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'" style="height:100%; width:100%"> <thead> <tr> <th field="apino" width="auto">API No</th> <th field="otherid" width="auto">State Permit No</th> <th field="wellname" width="auto">Operator</th> <th field="county" width="auto">County</th> <th field="twp" width="auto">Township</th> <th field="rge" width="auto">Range</th> <th field="section_" width="auto">Section</th> <th field="drillertotaldepth" width="auto">Depth (ft)</th> <th field="formationtd" width="auto">Formation at Depth</th> <th field="folderField" width="auto" >Well Folder</th> <th field="logField" width="auto" >Scanned Well Log</th> <th field="lasField" width="auto" >LAS Data</th> </tr> </thead> </table> </div> </div> </body> </html>[/HTML]
... View more
09-10-2013
02:56 PM
|
0
|
1
|
771
|
POST
|
How would you write this if you wanted to query using a second attribute as well?
... View more
09-09-2013
10:52 AM
|
0
|
0
|
684
|
POST
|
Can anyone give me a link to valid SQL statements that I can use when building my where and text queries?
... View more
09-09-2013
10:38 AM
|
0
|
1
|
544
|
POST
|
I'm trying to run a query on a feature by using multiple inputs fields to preform the search. I found this example but I can only get it to take one text field as an input. <!DOCTYPE html> <html> <head> <title>State Info</title> <link rel="stylesheet" type="text/css" href="http://jsdev.arcgis.com/3.6/js/dojo/dijit/themes/claro/claro.css"> <script type="text/javascript" src="http://jsdev.arcgis.com/3.6/"></script> <script type="text/javascript"> require([ "dojo/ready", "dojo/on", "esri/tasks/query", "esri/tasks/QueryTask", "dojo/domReady!"], function(ready, on, Query, QueryTask) { ready(function() { var myQuery, myQueryTask; myQueryTask = new QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"); myQuery = new Query(); myQuery.returnGeometry = false; myQuery.outFields = ["STATE_NAME","POP2007","MALES","FEMALES","STATE_ABBR"]; function execute() { var stateName = dojo.byId('stateName').value; var stateAbr = dojo.byId('test').value; myQuery.text = stateName; myQuery.text = stateAbr; myQueryTask.execute(myQuery, showResults); } function showResults(myFeatureSet) { var s = ""; for (var i=0, il=myFeatureSet.features.length; i < il; i++) { var featureAttributes = myFeatureSet.features.attributes; for (att in featureAttributes) { s = s + "<strong>" + att + ": </strong>" + featureAttributes[att] + "<br />"; } } dojo.byId("info").innerHTML = s; } on(dojo.byId("executeButton"), "click", execute); }); }); </script> </head> <body> <form action=""> US state name : <input type="text" id="stateName" value="California" /> <input type="text" id="test" value="U" /> <input type="button" id="executeButton" value="Get Details" /> </form> <br /> <br /> <div id="info" class="tundra" style="padding:5px; margin:5px; background-color:#eee;"> </div> </body> </html> Does anyone have an idea on how to get to take multiple parameters?
... View more
09-06-2013
09:07 AM
|
0
|
1
|
1321
|
POST
|
I've written a zoom function that is supposed to zoom to a point by creating a bounding box based on the coordinantes of the point. It attempts to zoom the new extent but it gives me an error and then the map resizes and layers redraw incorrectly at different scales. The scale bar displays NaN instead of numbers.
function makeZoomButton(id){//id is objectid
var zBtn = "<div data-dojo-type='dijit.form.Button'><img src='photos/bg_magnify.png'";
zBtn = zBtn + " width='18' height='18'";
zBtn = zBtn + " onClick=\"zoomRow('"+id+"')\"></div>"; //activates zoomRow function
return zBtn;
}
function zoomRow(id){
var grid = dijit.byId('grid');
var clickedWell = grid.getItem(id);
var selectedWell = map.graphics;
var distance = 1000;
var newExtent = new esri.geometry.Extent({
"xmin": selectedWell.x - distance,
"ymin": selectedWell.y - distance,
"xmax": selectedWell.x + distance,
"ymax": selectedWell.y + distance,
"spatialReference":{"wkid":4326}
});
console.log(map.graphics.graphics);
dojo.forEach(map.graphics.graphics,function(graphic){
console.log(graphic);
if((graphic.attributes) && graphic.attributes.FID === clickedWell.FID){
selectedWell = graphic.geometry;
return;
}
});
map.setExtent(newExtent);
}
Anyone have any ideas on what is going on and how to fix it? My well layer I am using in my zoon function is in 4326 on the server but I am not sure about the others. [ATTACH=CONFIG]27123[/ATTACH]
... View more
08-30-2013
11:44 AM
|
0
|
3
|
655
|
POST
|
In my previous post, I assume all the map.graphics.graphics are points and clickedWell contains the feature attributes. If my assumption is not your case, you will need to modify it accordingly. What I would recommend is to create a graphics layer for each specific purpose instead of using the general map.graphics, so you have control on what graphics type you will add to each graphics layer. Specific to your question, what is the value of selectedWell after the forEach loop? If undefined, then no matching graphic found. Your assumption was correct. I just set it equal to map.graphics.graphics after my last post and that seemed to solve that problem. Now my extent gets screwed up when it attempts to zoom. It looks like it is losing the coordinate system. All the layers that only appear at certain extents try to draw at the same time and my map goes blank. Any ideas on that one? [ATTACH=CONFIG]27118[/ATTACH]
... View more
08-30-2013
09:30 AM
|
0
|
0
|
735
|
POST
|
function zoomRow(id) {
var grid = dijit.byId('grid');
var clickedWell = grid.getItem(id);
var selectedWell;
var distance = 500;
dojo.forEach(map.graphics.graphics, function (graphic) {
if ((graphic.attributes) && graphic.attributes.FID === clickedWell.FID) {
selectedWell = graphic.geometry;
return;
}
});
var newExtent = new esri.geometry.Extent({
"xmin": selectedWell.x - distance,
"ymin": selectedWell.y - distance,
"xmax": selectedWell.x + distance,
"ymax": selectedWell.y + distance,
"spatialReference": {
"wkid": 4326
}
});
map.setExtent(taxLotExtent);
console.log(map.graphics.graphics);
} Thanks for the help. Now it's not liking selectedWell.x , I know its because I never set selectedWell to anything. Any idea on how to do that?
... View more
08-30-2013
09:07 AM
|
0
|
0
|
735
|
Title | Kudos | Posted |
---|---|---|
2 | 12-27-2018 03:35 PM | |
1 | 06-08-2018 07:57 AM |
Online Status |
Offline
|
Date Last Visited |
07-08-2021
03:14 PM
|