|
POST
|
One last question....replaced my Map Service with a Secured Map Service....the credential window opens and I type the Correct User and Password but no results.... Any thoughts? Something I need to add to deal with Secured Services? THanks again
... View more
06-13-2014
06:11 AM
|
0
|
0
|
1270
|
|
POST
|
I got the additional fields like this for the WHERE clause function execute () {
alert("1");
//query.text = dom.byId("stateName").value;
query.where =
"Class = '"+dom.byId("stateName").value+"' AND Type = 'R' AND County = 'Franklin' ";
alert(dom.byId("stateName").value);
queryTask.execute(query, showResults);
}
Now just trying to show more fields in the Result..how do I grab and display those? THANKS UPADTE: GO the extra fields by listing them in the
query.outFields = [
"OBJECTID","BARRIER_FR","SITENAME",
"WATERBODY","CLASS","ACCESSAREA",
"TYPE","NO_OFRAMPS","COUNTY","LOCATION",
"Lat","Long","Number"
];
THANKS A TON...got it now...
... View more
06-13-2014
06:04 AM
|
0
|
0
|
1270
|
|
POST
|
Thanks Mudit Agarwal... Question.... how would I add more than one field in the query WHERE How would I show more fields in the result?
... View more
06-13-2014
05:59 AM
|
0
|
0
|
1270
|
|
POST
|
I am trying to get this sample to work....the example from ESRI works of course https://developers.arcgis.com/javascript/jssamples/query_nomap.html I created a JSFiddle http://jsfiddle.net/Jaykapalczynski/N8M2q/10/ then added my Map Service and Query Definition Only other thing I changed was the value of the Value <input type="text" id="stateName" value="Potomac River"> which I verified was a legit value for this field. After these two changes I am NOT able to get to the "ALERT 3" inside the Function showResults(results) The Map Service has Map, Query, Data as Operations Allowed. My questions are: Why does this not work with my Map Service...is there something that I am missing here? I am not seeing where the query is targeting a specific field? The value I am lloking for is in the "WATERBODY" field Lastly: Can this be modified to query more than one field/value? Thanks
... View more
06-13-2014
04:51 AM
|
0
|
6
|
1650
|
|
POST
|
Any idea how to get a zoom tool to run once and deactivate until clicked again?
... View more
06-05-2014
06:24 AM
|
0
|
0
|
509
|
|
POST
|
Please see Previous post first... This is how I am passing the selected feature to the "LeftPane" currently.....So looking to morph this code and the one in your example to allow the user to select on the Secured Service and Unsecured Service. I assume keeping the code separate and passing to different Content Panes Need to get this to a side container of some sort because in the first instance above I have the popupWindow set to false app.map.infoWindow.set("popupWindow", false); Thoughts? Appreciated. Can I combine and select any of the features in my map below with the code below?
function initializeSidebar(map){
var popup = map.infoWindow;
//when the selection changes update the side panel to display the popup info for the
//currently selected feature.
connect.connect(popup, "onSelectionChange", function(){
displayPopupContent(popup.getSelectedFeature());
});
//when the selection is cleared remove the popup content from the side panel.
connect.connect(popup, "onClearFeatures", function(){
dom.byId("featureCount").innerHTML = "Click Identify Tool to select feature(s)";
registry.byId("leftPane").set("content", "");
domUtils.hide(dom.byId("pager"));
});
//When features are associated with the map's info window update the sidebar with the new content.
connect.connect(popup, "onSetFeatures", function(){
displayPopupContent(popup.getSelectedFeature());
dom.byId("featureCount").innerHTML = popup.features.length + " feature(s) selected";
//enable navigation if more than one feature is selected
popup.features.length > 1 ? domUtils.show(dom.byId("pager")) : domUtils.hide(dom.byId("pager"));
});
}
function displayPopupContent(feature){
if(feature){
var content = feature.getContent();
registry.byId("leftPane").set("content", content);
}
}
function selectPrevious(){
app.map.infoWindow.selectPrevious();
}
function selectNext(){
app.map.infoWindow.selectNext();
}
function clearContent() {
registry.byId("leftPane").set("content", "");
domUtils.hide(dom.byId("pager"));
}
... View more
06-05-2014
06:00 AM
|
0
|
0
|
480
|
|
POST
|
THanks Ken....I am seeing where you are going with this and think that its a good start.... First: In my app I have a Secured Service that requires Credentials, I have this set up to allow the user to select features that render after positive credential check. These results from the identify (only selects one feature at a time) are passed and displayed in a pane (not a popup) WORKING great Second: In this same app I have a Map service that is not secured. If the user does not have credentials they can still enter the site and identify on other public features... It is here that I am trying to leverage the additional identify. I am bring in one map service and must distinguish between layers in order to identify and return results. But as in the First above I do not want a popup....I want the features to be displayed in a Pane off to the side. Actually I think the First above is using a SELECT and the Second is using IDENTIFY I tried to utilize that example you gave and send the results to the "LeftPane" defined in HTML In the example Below I am simply trying to get the Map Service to Identify and send results to a pane not a popup
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Identify with Popup</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.9/js/esri/css/esri.css">
<style>
html, body, #map {
height:100%;
width:100%;
margin:0;
padding:0;
}
/*---------------------------------------------------------------------------------------------------------*/
/* NewLayer window in the top right corner*/
.divLayerContainerNewLayer
{
position: absolute;
top: 45px;
right: 0px;
width: 200px;
z-index: 1000;
}
.divLayerHolderNewLayer
{
width: 190px;
height: 400px;
background: rgba(0,0,0,0.9);
-pie-background: rgba(0,0,0,0.9);
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
behavior: url("styles/PIE.htc");
opacity:.8;
}
.divLayerContentHolderNewLayer
{
overflow: auto;
padding: 5px;
height: 390px;
width: 185px;
}
#leftPane{
background-color:transparent;
border:1px solid red;
font-family:tahoma;
font-size:10px;
height: 350px;
}
</style>
<script src="https://js.arcgis.com/3.9/"></script>
<script>
var map;
require([
"esri/map",
"esri/InfoTemplate",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/tasks/IdentifyTask",
"esri/tasks/IdentifyParameters",
"esri/dijit/Popup",
"dojo/_base/array",
"esri/Color",
"dojo/dom-construct",
"dojo/domReady!"
], function (
Map, InfoTemplate, ArcGISDynamicMapServiceLayer, SimpleFillSymbol,
SimpleLineSymbol, IdentifyTask, IdentifyParameters, Popup,
arrayUtils, Color, domConstruct
) {
var identifyTask, identifyParams;
/*
var popup = new Popup({
fillSymbol: new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color([255, 0, 0]), 2), new Color([255, 255, 0, 0.25]))
}, domConstruct.create("div"));
*/
map = new Map("map", {
basemap: "gray",
center: [-77.4329, 37.5410],
zoom: 7
// infoWindow: popup
});
map.on("load", mapReady);
var parcelsURL = "https://fwisweb1.dgif.virginia.gov/arcgis/rest/services/Public/DGIF_Public/MapServer";
map.addLayer(new ArcGISDynamicMapServiceLayer(parcelsURL,
{ opacity: .55 }));
function mapReady () {
map.on("click", executeIdentifyTask);
//create identify tasks and setup parameters
identifyTask = new IdentifyTask(parcelsURL);
identifyParams = new IdentifyParameters();
identifyParams.tolerance = 3;
identifyParams.returnGeometry = true;
identifyParams.layerIds = [0, 4];
identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;
identifyParams.width = map.width;
identifyParams.height = map.height;
}
function executeIdentifyTask (event) {
identifyParams.geometry = event.mapPoint;
identifyParams.mapExtent = map.extent;
var deferred = identifyTask
.execute(identifyParams)
.addCallback(function (response) {
// response is an array of identify result objects
// Let's return an array of features.
return arrayUtils.map(response, function (result) {
var feature = result.feature;
var layerName = result.layerName;
feature.attributes.layerName = layerName;
if (layerName === 'Birding Trail Sites') {
var taxParcelTemplate = new InfoTemplate("",
"${LOOP_NAME} <br/> Owner of record: ${SITE_NAME}");
feature.setInfoTemplate(taxParcelTemplate);
}
else if (layerName === 'Birding Trail Loops') {
console.log(feature.attributes.PARCELID);
var buildingFootprintTemplate = new InfoTemplate("",
"Parcel ID: ${Loop_Name}");
feature.setInfoTemplate(buildingFootprintTemplate);
}
return feature;
});
});
// InfoWindow expects an array of features from each deferred
// object that you pass. If the response from the task execution
// above is not an array of features, then you need to add a callback
// like the one above to post-process the response and return an
// array of features.
//map.infoWindow.setFeatures([deferred]);
//map.infoWindow.show(event.mapPoint);
var popup = map.infoWindow;
connect.connect(popup, "onSelectionChange", function(){
displayPopupContent(popup.getSelectedFeature());
});
//When features are associated with the map's info window update the sidebar with the new content.
connect.connect(popup, "onSetFeatures", function(){
displayPopupContent(popup.getSelectedFeature());
});
} // END OF executeIdentifyTask
function displayPopupContent(feature){
if(feature){
var content = feature.getContent();
registry.byId("leftPane").set("content", content);
}
}
});
</script>
</head>
<body>
<div id="map">
<div id="divLayerContainerNewLayer" class="divLayerContainerNewLayer hideContainerHeightNewLayer" >
<div id="divLayerHolderNewLayer" class="divLayerHolderNewLayer">
<div id="divLayerContainerHolderNewLayer" style="position: relative">
<div id="divLayerContentHolderNewLayer" class="divLayerContentHolderNewLayer" style="position: absolute;
overflow: hidden">
<div id="leftPane" data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="region:'center'">
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
... View more
06-05-2014
05:53 AM
|
0
|
0
|
480
|
|
POST
|
Got it...Was an order thing... Was this
<!-- Reference the js frame work from ESRI-->
<script src="https://js.arcgis.com/3.9/"></script>
<script type="text/javascript">
// helpful for understanding dojoConfig.packages vs. dojoConfig.paths:
// http://www.sitepen.com/blog/2013/06/20/dojo-faq-what-is-the-difference-packages-vs-paths-vs-aliases/
var dojoConfig = {
paths: {
//if you want to host on your own server, download and put in folders then use path like:
agsjs: location.pathname.replace(/\/[^/]+$/, '') + '/src/agsjs'
}
};
</script>
Not this
<script type="text/javascript">
// helpful for understanding dojoConfig.packages vs. dojoConfig.paths:
// http://www.sitepen.com/blog/2013/06/20/dojo-faq-what-is-the-difference-packages-vs-paths-vs-aliases/
var dojoConfig = {
paths: {
//if you want to host on your own server, download and put in folders then use path like:
agsjs: location.pathname.replace(/\/[^/]+$/, '') + '/src/agsjs'
}
};
</script>
<!-- Reference the js frame work from ESRI-->
<script src="https://js.arcgis.com/3.9/"></script>
... View more
06-04-2014
11:18 AM
|
1
|
0
|
4501
|
|
POST
|
The above falls apart as soon as I add the below "agsjs/dijit/TOC", TOC, I add the above and I get this..error in the console GET https://js.arcgis.com/3.9/js/dojo/agsjs/dijit/TOC.js 404 (Not Found) init.js:39 Error {src: "dojoLoader", info: Array[2], stack: (...), message: "scriptError"} init.js:40 src: dojoLoader init.js:41 info: ["https://js.arcgis.com/3.9/js/dojo/agsjs/dijit/TOC.js", Event] 0: "https://js.arcgis.com/3.9/js/dojo/agsjs/dijit/TOC.js" 1: Event length: 2 __proto__: Array[0]
... View more
06-04-2014
10:02 AM
|
0
|
0
|
1482
|
|
POST
|
didnt want to paste everything this is my full require
require([
"dojo/ready","dojo/on","dojo/_base/connect","dojo/dom","dojo/dom-construct",
"dojo/keys", "esri/SnappingManager", "esri/dijit/Measurement", "esri/sniff",
"dojo/parser","dijit/registry","esri/layers/FeatureLayer","esri/layers/ArcGISDynamicMapServiceLayer",
"esri/InfoTemplate","esri/renderers/UniqueValueRenderer","esri/renderers/SimpleRenderer",
"esri/symbols/SimpleMarkerSymbol", "esri/symbols/PictureMarkerSymbol",
"esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol",
"esri/map", "esri/dijit/HomeButton", "esri/dijit/LocateButton", "dijit/form/CheckBox",
"esri/dijit/OverviewMap", "esri/dijit/Legend","esri/toolbars/draw", "esri/layers/ImageParameters",
"esri/dijit/Geocoder", "esri/geometry/screenUtils", "dojo/query", "dojo/_base/Color",
"esri/config", "esri/kernel","dojo/cookie", "dojo/_base/unload",
"esri/geometry/Extent", "esri/layers/ArcGISTiledMapServiceLayer",
"esri/renderers/ClassBreaksRenderer", "agsjs/dijit/TOC",
"esri/tasks/query", "esri/tasks/QueryTask","esri/tasks/GeometryService", "esri/tasks/BufferParameters",
"esri/TimeExtent", "dojo/number", "dojo/date/locale","dojo/store/Memory", "dgrid/OnDemandGrid",
"dojox/layout/ScrollPane","dgrid/ColumnSet", "dgrid/OnDemandGrid", "dojo/_base/array", "dojo/dom-style",
"dojo/number","dojo/_base/declare", "dgrid/Keyboard", "dgrid/Selection", "dgrid/extensions/ColumnHider",
"dgrid/extensions/ColumnResizer","esri/lang", "dojo/_base/lang","dojo/dom-style", "dijit/TooltipDialog",
"dijit/popup","esri/Color", "esri/graphic","esri/toolbars/navigation","esri/symbols/PictureFillSymbol",
"esri/symbols/CartographicLineSymbol","esri/dijit/BasemapGallery","esri/dijit/BasemapToggle","esri/request",
"esri/config","dojo/_base/array","esri/geometry/scaleUtils", "esri/symbols/PictureMarkerSymbol", "dojo/json",
"dojo/sniff","esri/tasks/locator", "esri/symbols/Font", "esri/symbols/TextSymbol",
"esri/urlUtils", "esri/dijit/InfoWindowLite", "esri/geometry/Multipoint", "esri/geometry/Point",
"esri/geometry/webMercatorUtils","esri/layers/ArcGISImageServiceLayer", "dojox/data/CsvStore", "dojox/encoding/base64",
"esri/dijit/Print","esri/tasks/PrintTemplate","esri/arcgis/utils","esri/domUtils","esri/dijit/Popup",
"dojo/fx/Toggler", "dojo/fx",
"esri/IdentityManager", "dojo/fx",
"dijit/form/Button", "dijit/form/Textarea", "dijit/Dialog",
"dijit/layout/BorderContainer", "dijit/layout/ContentPane",
"dijit/layout/AccordionContainer", "dijit/Toolbar",
"esri/dijit/Scalebar", "dijit/TitlePane", "dijit/form/CheckBox",
"dojo/domReady!"
], function(
ready,on,connect,dom,domConstruct,
keys, SnappingManager, Measurement, has,
parser,registry,FeatureLayer,ArcGISDynamicMapServiceLayer,
InfoTemplate,UniqueValueRenderer,SimpleRenderer,
SimpleMarkerSymbol, PictureMarkerSymbol,
SimpleLineSymbol, SimpleFillSymbol,
Map, HomeButton, LocateButton, CheckBox,
OverviewMap, Legend, Draw, ImageParameters,
Geocoder, screenUtils, query, Color,
esriConfig, kernel, cookie, baseUnload,
Extent, ArcGISTiledMapServiceLayer,
ClassBreaksRenderer, TOC,
Query, QueryTask,GeometryService, BufferParameters,
TimeExtent, number, locale,Memory, OnDemandGrid,
ScrollPane,ColumnSet, Grid, array, domStyle,
dojoNum,declare, Keyboard, Selection, ColumnHider,
ColumnResizer,esriLang, lang, domStyle, TooltipDialog,
dijitPopup,Color,Graphic,Navigation,PictureFillSymbol,
CartographicLineSymbol,BasemapGallery,BasemapToggle,request,
esriConfig,arrayUtils,scaleUtils, PictureMarkerSymbol, JSON,
sniff,Locator, Font, TextSymbol,
urlUtils, InfoWindowLite, Multipoint, Point,
webMercatorUtils,ArcGISImageServiceLayer, CsvStore, base64,
Print,PrintTemplate,arcgisUtils,domUtils,Popup,
Toggler, coreFx
) {
... View more
06-04-2014
10:01 AM
|
0
|
0
|
1482
|
|
POST
|
Getting error when trying to add this for the TOC example above...thoughts.....app just stalls out. But works fine in another HTML page I have????? require(["dojo/_base/connect",
"agsjs/dijit/TOC"],
function(connect, dom, parser, on,Color,
TOC){ Failed to load resource: the server responded with a status of 404 (Not Found) https://js.arcgis.com/3.9/js/dojo/agsjs/dijit/TOC.js Error init.js:40 src: dojoLoader init.js:41 info: Array[2] Seems when I mess around with the Require definitions its sometimes it blows up and does not run...something specific I need to refresh? Refresh the website and cleared my cache... really weird because it works in another html I have
... View more
06-04-2014
09:39 AM
|
0
|
0
|
1482
|
|
POST
|
I was able to get it to work in CHROME but I had to select "load unsafe script" not sure why....maybe because I am trying to load http and https, something to do with our certificate?
... View more
06-04-2014
08:25 AM
|
0
|
0
|
3020
|
|
POST
|
Getting a bunch of errors in Chrome....things timing out...not sure why... anyone help diagnose these errors? See image below
... View more
06-04-2014
08:21 AM
|
0
|
0
|
3020
|
| 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
|