|
POST
|
am I missing a Require??? require([ "esri/map", "esri/tasks/query", "esri/tasks/QueryTask", "esri/geometry/webMercatorUtils", "dojo/dom", "dojo/on", "esri/layers/FeatureLayer", "esri/dijit/Legend","esri/symbols/SimpleFillSymbol", "esri/renderers/SimpleRenderer", "esri/symbols/SimpleMarkerSymbol","esri/layers/LabelClass", "esri/dijit/BasemapToggle","esri/dijit/HomeButton", "esri/dijit/Search", "esri/dijit/LocateButton","esri/layers/GraphicsLayer","esri/InfoTemplate", "esri/Color", "dojo/_base/array", "dojo/parser", "esri/InfoTemplate", "esri/renderers/ClassBreaksRenderer","dijit/form/CheckBox", "dojo/dom-construct", "dojo/keys","esri/SnappingManager","esri/dijit/Measurement","esri/tasks/GeometryService","esri/config", "esri/sniff","esri/dijit/BasemapGallery", "esri/dijit/Bookmarks","esri/layers/OpenStreetMapLayer","esri/dijit/OverviewMap","dgrid/Grid","dojo/_base/declare","dgrid/Selection", "dgrid/OnDemandGrid","dojo/store/Memory","dgrid/Keyboard", "esri/layers/LabelLayer", "esri/symbols/TextSymbol", "esri/symbols/Font", "esri/symbols/SimpleLineSymbol", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/AccordionContainer","esri/dijit/Scalebar","dijit/TitlePane", "dojo/domReady!" ], function( Map, Query, QueryTask, webMercatorUtils, dom, on, FeatureLayer, Legend, SimpleFillSymbol, SimpleRenderer, SimpleMarkerSymbol, LabelClass, BasemapToggle, HomeButton, Search, LocateButton, GraphicsLayer,InfoTemplate, Color, arrayUtils, parser, InfoTemplate, ClassBreaksRenderer, CheckBox, domConstruct, keys,SnappingManager, Measurement, GeometryService,esriConfig, has,BasemapGallery, Bookmarks,OpenStreetMapLayer,OverviewMap,Grid,declare,Selection, OnDemandGrid,Memory,Keyboard, LabelLayer, TextSymbol, Font, SimpleLineSymbol ) {
... View more
03-30-2017
09:20 AM
|
0
|
13
|
2832
|
|
POST
|
I did this and now getting them in the DIV but Still not in the grid....uggg function showResultsCountySquad (results) {
var resultItems = [];
var resultCount = results.features.length;
for (var i = 0; i < resultCount; i++) {
var featureAttributes = results.features[i].attributes;
for (var attr in featureAttributes) {
resultItems.push("<b>" + attr + ":</b> " + featureAttributes[attr] + "<br>");
}
resultItems.push("<br>");
}
dom.byId("inforesultsCountySquad").innerHTML = resultItems.join("");
var data = array.map(results.features, function(feature) {
var featureAttributes = feature.attributes;
for (var attr in featureAttributes) {
resultItems.push("<b>" + attr + ":</b> " + featureAttributes[attr] + "<br>");
}
resultItems.push("<br>");
return {
// property names used here match those used when creating the dgrid
"County_Nam": feature.attributes[window.outFields[0]],
"Case_Numbe": feature.attributes[window.outFields[1]],
"Date_Arres": feature.attributes[window.outFields[2]],
"Violation_": feature.attributes[window.outFields[3]],
"Officer_Na": feature.attributes[window.outFields[4]]
};
});
var memStore = new Memory({ data: data });
window.grid.set("store", memStore);
}
... View more
03-30-2017
09:16 AM
|
0
|
14
|
2832
|
|
POST
|
I have been trying to do just that....no go... I put this in there and now I dont even get results in the DIV I am using index of outfields 0-4 var map = new Map("map", {
basemap: "dark-gray",
center: [-79.665, 37.629],
zoom: 8,
logo: false,
showLabels : true
});
// QUERY FOR County and Squad
var queryTask = new QueryTask("https://xxx/arcgis/rest/services/Projects/xxxx/FeatureServer/5");
var query = new Query();
query.outSpatialReference = {wkid:4326}; //4326 //102100 //3857
query.returnGeometry = true;
query.outFields = ["*"];
on(dom.byId("executeCountySquad"), "click", executeCountySquad);
function executeCountySquad () {
query.where = "County_Nam = '"+ (dom.byId("CountyName").value) +"' AND Squad = '"+ (dom.byId("Squad").value) +"' ";
queryTask.execute(query, showResultsCountySquad);
}
function showResultsCountySquad (results) {
var resultItems = [];
var resultCount = results.features.length;
var data = array.map(results.features, function(feature) {
var featureAttributes = feature.attributes;
for (var attr in featureAttributes) {
resultItems.push("<b>" + attr + ":</b> " + featureAttributes[attr] + "<br>");
}
resultItems.push("<br>");
return {
// property names used here match those used when creating the dgrid
"County_Nam": feature.attributes[outFields[0]],
"Case_Numbe": feature.attributes[outFields[1]],
"Date_Arres": feature.attributes[outFields[2]],
"Violation_": feature.attributes[outFields[3]],
"Officer_Na": feature.attributes[outFields[4]]
};
dom.byId("inforesultsCountySquad").innerHTML = resultItems.join("");
});
var memStore = new Memory({ data: data });
window.grid.set("store", memStore);
}
... View more
03-30-2017
09:02 AM
|
0
|
15
|
2832
|
|
POST
|
I cant seem to get this working...I have a query that works but just send to a DIV...I am trying to use this queries results to use in the dGrid as well.... Maybe you can see what the heck is going on... So I create the Grid (which I can see in my app when I run it with the header labels) Create a Query Task On the click of a button I set the WHERE statement I then run a Query Task Execute that populates the DIV.....THIS WORKS FINE I then (from the example) call a populateGrid Function to populate the Grid Here I am creating another Query Task and run it.... Nothing gets populated in the Grid????? var map = new Map("map", {
basemap: "dark-gray",
center: [-79.665, 37.629],
zoom: 8,
logo: false,
showLabels : true
});
// create the dgrid
window.grid = new (declare([Grid, Selection]))({
// use Infinity so that all data is available in the grid
bufferRows: Infinity,
columns: {
"County_Nam": "County_Nam",
"Case_Numbe": "Case Number",
"Date_Arres": "Arrest",
"Violation_": "Violation",
"Officer_Na": "Officers"
}
}, "grid");
// QUERY FOR County and Squad
var queryTask = new QueryTask("https://xxx/arcgis/rest/services/Projects/xxx/FeatureServer/5");
var query = new Query();
query.outSpatialReference = {wkid:4326}; //4326 //102100 //3857
query.returnGeometry = true;
query.outFields = ["*"];
on(dom.byId("executeCountySquad"), "click", executeCountySquad);
function executeCountySquad () {
query.where = "County_Nam = '"+ (dom.byId("CountyName").value) +"' AND Squad = '"+ (dom.byId("Squad").value) +"' ";
queryTask.execute(query, showResultsCountySquad);
populateGrid(Memory);
}
function populateGrid(Memory) {
alert("You are in Populate Grid");
var qt = new QueryTask("https://xxx/arcgis/rest/services/Projects/xxx/FeatureServer/5");
var query = new Query();
query.outSpatialReference = {wkid:4326}; //4326 //102100 //3857
query.where = "County_Nam = '"+ (dom.byId("CountyName").value) +"' AND Squad = '"+ (dom.byId("Squad").value) +"' ";
query.returnGeometry = false;
query.outFields = ["County_Nam","Case_Numbe","Date_Arres","Violation_","Officer_Na"];
qt.execute(query, function(results) {
var data = array.map(results.features, function(feature) {
return {
// property names used here match those used when creating the dgrid
"County_Nam": feature.attributes[window.outFields[0]],
"Case_Numbe": feature.attributes[window.outFields[1]],
"Date_Arres": feature.attributes[window.outFields[2]],
"Violation_": feature.attributes[window.outFields[3]],
"Officer_Na": feature.attributes[window.outFields[4]]
};
});
var memStore = new Memory({ data: data });
window.grid.set("store", memStore);
});
}
function showResultsCountySquad (results) {
var resultItems = [];
var resultCount = results.features.length;
for (var i = 0; i < resultCount; i++) {
var featureAttributes = results.features[i].attributes;
for (var attr in featureAttributes) {
resultItems.push("<b>" + attr + ":</b> " + featureAttributes[attr] + "<br>");
}
resultItems.push("<br>");
}
dom.byId("inforesultsCountySquad").innerHTML = resultItems.join("");
... View more
03-30-2017
08:15 AM
|
0
|
17
|
2832
|
|
POST
|
I have an app that has a few different queries that query the same data...it then places this data in DIV <div id="inforesults">Results:</div> Everything seems to be working fine I just desire more functionality. What I would like to do is: Move the data into a table format that has sorting Allow the user to select a record and highlight the map and visa versa. Just not sure where to go from here. What are my options for a results container that would achieve this. Maybe something that I can easily stylize with CSS // QUERY FOR County and Squad
var queryTask = new QueryTask("https://xxxx/arcgis/rest/services/Projects/xxxx/FeatureServer/5");
var query = new Query();
query.outSpatialReference = {wkid:4326}; //4326 //102100 //3857
query.returnGeometry = true;
query.outFields = ["*"];
on(dom.byId("executeCountySquad"), "click", executeCountySquad);
function executeCountySquad () {
query.where = "County_Nam = '"+ (dom.byId("CountyName").value) +"' AND Squad = '"+ (dom.byId("Squad").value) +"' ";
queryTask.execute(query, showResultsCountySquad);
}
function showResultsCountySquad (results) {
var resultItems = [];
var resultCount = results.features.length;
alert(resultCount)
for (var i = 0; i < resultCount; i++) {
var featureAttributes = results.features[i].attributes;
for (var attr in featureAttributes) {
resultItems.push("<b>" + attr + ":</b> " + featureAttributes[attr] + "<br>");
}
resultItems.push("<br>");
}
dom.byId("inforesults").innerHTML = resultItems.join("");
}
//======================================================
<input id="executeCountySquad" type="button" value="Get Details County Squad">
<div id="inforesultsCountySquad" style="padding:5px; font-size:8px; height:Auto; margin:5px; background-color:#eee;">Results:</div>
... View more
03-30-2017
05:03 AM
|
0
|
30
|
8179
|
|
POST
|
Trying this but no cigar var CountyName = (dom.byId("CountyName").value); // THIS WORKS BUT need a variable //query.where = "County_Nam = 'Accomack' AND Squad = '13'"; query.where = "County_Nam = '+ CountyName +' AND Squad = '13'";
... View more
03-29-2017
02:02 PM
|
0
|
0
|
2126
|
|
POST
|
Any ideas on how to modify this to include more than one input parameter? function execute () { alert("Execute"); query.text = dom.byId("CountyName").value; query.text = dom.byId("Squad").value; queryTask.execute(query, showResults); }
... View more
03-29-2017
01:48 PM
|
0
|
1
|
2126
|
|
POST
|
Yea was messing around with that but cant figure out where they are specifying what Field to query from the stateName textbox
... View more
03-29-2017
01:44 PM
|
0
|
0
|
2126
|
|
POST
|
Are there any examples out there showing how to Query a Service via User input and return results to a table? AND have that table interact with the map features. Click the map and it highlights in the table and visa versa Example: 1 drop down box for County 1 text field year User specifies parameters and then on submit the table updates and the features are rendered in the map
... View more
03-29-2017
12:45 PM
|
0
|
5
|
2728
|
|
POST
|
I am trying to get this example working....well I have it working but my Service has 75K records and it times out. I am trying to figure out how to start the app and NOT load all my data. I ONLY want to load my data once the user selects from the Menu Items. This way I can make sure the returned set of records is manageable FeatureTable - Custom Menu Items | ArcGIS API for JavaScript 3.20 I am not seeing how to do this..I imagine I still have to query all the records first? Can anyone help with a thought or two... Thanks in Advance
... View more
03-29-2017
12:28 PM
|
0
|
0
|
865
|
|
POST
|
Wow...great replays and great info guys....Much appreciated...this is more than I am willing to invest in resource wise and time wise....I will stick with the single JS file...will just try and make a bit more pretty.... Very very appreciative for your thoughts and comments...Cheers
... View more
03-23-2017
04:03 PM
|
0
|
0
|
2565
|
|
POST
|
I have an index.html page and a main.js page. I am referencing the js page in html as such: <script src="js/main.js"></script> my main.js page is getting very long and want to do some house cleaning. Can I create another .js page for instance and move all my Feature Layers in there....like below Would I reference this in the HTML page or the Main.js page? var Conservation = new FeatureLayer("https://vafwisdev.dgif.virginia.gov/arcgis/rest/services/Projects/AVL_Locations/MapServer/7", {
mode: FeatureLayer.MODE_SNAPSHOT,
visible: false
});
legendLayers.push({ layer: Conservation, title: 'Conservation Lands' });
... View more
03-23-2017
11:54 AM
|
0
|
4
|
3345
|
|
POST
|
This is a totally stupid question and I am drawing a complete blank... How do I apply the Simple Marker Symbol to my Feature Layer? var layer1 = new FeatureLayer("https://xxxx/arcgis/rest/services/Projects/AVL/MapServer/1", {
mode: FeatureLayer.MODE_ONDEMAND,
});
var markerSymbol = new SimpleMarkerSymbol();
markerSymbol.setPath(path);
markerSymbol.setColor(new Color(color));
markerSymbol.setOutline(null);
markerSymbol.setSize("32");
layer1.set????? (markersymbol)
... View more
03-19-2017
08:52 AM
|
0
|
1
|
2053
|
|
POST
|
Is there a way to track a live feed via Javascript api? I have location data from vehicles feed and want to map that.
... View more
03-02-2017
05:39 AM
|
0
|
1
|
1127
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2018 11:09 AM | |
| 1 | 09-10-2018 06:26 AM | |
| 1 | 09-15-2022 11:02 AM | |
| 1 | 05-21-2021 07:35 AM | |
| 1 | 08-09-2022 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-19-2022
09:23 PM
|