POST
|
After featLayer.setDefinitionExpression, try the below code: var extLayer = esri.graphicsExtent(featLayer.graphics);
... View more
11-21-2013
07:44 AM
|
0
|
0
|
275
|
POST
|
var layerId = "Stewardship"; layerId must be a number, not a text string. Change it to var layerId = "0"; and try again.
... View more
11-21-2013
06:57 AM
|
0
|
0
|
577
|
POST
|
Here is the revision. // assume cboLayer is a dijit/form/ComboBox type control var layerId = cboLayer.get("value"); // assume all the layer are coming from the same feature service. var featLayer = new FeatureLayer("http://tfsgis-iisd01:6080/arcgis/rest/services/Stewardship_SA3/FeatureServer/" + layerId, { mode: FeatureLayer.MODE_SELECTION, id: 'stewardship_' + layerId, outFields: ['*'] });
... View more
11-20-2013
01:49 PM
|
0
|
0
|
577
|
POST
|
I am using Portal.queryItems method trying to search for all feature services or map services owned by ESRI or from ArcGIS Online. Here is my code snippet. However, the items returned are not only the feature services or map services, but also map document, feature data, etc. How can I build the query string so that only feature services or map services will be returned. Thanks in advance. queryPortal: function (portalUser) {
var portal = new Portal.Portal("https://www.arcgis.com/").signIn().then(function (portalUser) {
var q_string = "(type: \"Feature Service\" OR \"Map Service\")";
// if query items under "My Content"
switch (selScope.value) {
case "esri":
q_string += " AND owner: esri";
default:
break;
}
// query by key word
if (txtSearch.value) {
q_string = (me.txtSearch.value.replace(/\s/g, "")) + " " + q_string;
}
var queryParams = {
q: q_string,
sortField: me.selScope.value === "arconline" ? "numViews" : "title", // title | created | type | owner | avgRating | numRatings | numComments | numViews
sortOrder: "asc", // "asc" | "desc"
num: 100 // maximum number of items returned
};
portalUser.portal.queryItems(queryParams).then(createGallery);
}).otherwise(function (error) {
console.log("Error occurred while signing in: %s", error.message);
});
}
... View more
11-20-2013
06:09 AM
|
1
|
0
|
469
|
POST
|
No need to define the css classes using JS. Why not using #info table tr:nth-child(odd/even) to define the css style directly in the css file? #info table tr:nth-child(odd) {
/* styles for odd rows */
}
#info table tr:nth-child(even) {
/* styles for even rows */
}
... View more
11-17-2013
03:25 PM
|
0
|
0
|
409
|
POST
|
Try to use dojo/on as below. on(map.infoWindow.domNode, "mouseout", function() {
map.infoWindow.hide();
});
... View more
11-14-2013
07:24 PM
|
0
|
0
|
515
|
POST
|
Kelly, I don't see anywhere in the JS API that Popup class has set method and zoomFactor property. I understand that Popup is a dijit that has setters and getters. But should the ESRI Javascript API mention it and add zoomFactor property to Popup dijit? Such simple additions might save us lots of time to figure out solutions for simple tasks.
... View more
11-12-2013
04:58 PM
|
0
|
0
|
156
|
POST
|
Hi Kelly, I don't see a REST operation that can be used to update the item data. Can you point out which operation is for editing and updating the item data? Thanks, Jason
... View more
11-12-2013
04:38 PM
|
0
|
0
|
415
|
POST
|
Oops...I have already removed all the contents under the 2.0 folder. It seems not clear which contents are related to Operations Dashboard though. Thanks anyway for the reminder. It will be nice if the uninstall can and should do these things for us. Jason
... View more
11-11-2013
04:13 AM
|
0
|
0
|
499
|
POST
|
I have made some small changes, and it should work now. One of the issue is that one record has invalid (x: 0, y: -7.081154551613622e-10), which should be ignored. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <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>Find Task</title> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } #map { margin: 0; padding: 0; width: 100%; height: 100%; } </style> <script src="http://js.arcgis.com/3.7/"></script> <script> dojo.require("esri.map"); dojo.require("esri.tasks.find"); dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); var findTask, findParams, map; function init() { map = new esri.Map("map",{ basemap:"topo", center: [-147.0, 64.8], zoom: 6 }); // draw all sites to the map var sites_layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://ltergis.iab.uaf.edu/arcgis/rest/services/database_test/mapserver"); map.addLayer(sites_layer); //create find task with url to map service findTask = new esri.tasks.FindTask("http://ltergis.iab.uaf.edu/arcgis/rest/services/database_test/mapserver"); //create find parameters findParams = new esri.tasks.FindParameters(); findParams.returnGeometry = true; findParams.layerIds = [0]; findParams.searchFields = ["site_id"]; var sr = new esri.SpatialReference({wkid:102100}); findParams.outSpatialReference = sr; } //set the search text to find parameters function execute(searchText) { findParams.searchText = searchText; findTask.execute(findParams, showResults); } //symbology for graphics function showResults(results) { var markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 1), new dojo.Color([0, 255, 0, 0.25])); //find results return an array of findResult. map.graphics.clear(); var dataForGrid = []; //Build an array of attribute information and add each found graphic to the map dojo.forEach(results, function(result) { var graphic = result.feature; if (graphic.geometry.x === 0 || graphic.geometry.y === 0) { console.warn(graphic.geometry.toJson()); return; } switch (graphic.geometry.type) { case "point": graphic.setSymbol(markerSymbol); break; } //add graphics to map map.graphics.add(graphic); }); //zoom to selected graphics (not working) if (map.graphics.graphics.length > 1) { var graExtent = esri.graphicsExtent(map.graphics.graphics); map.setExtent(graExtent); } else if (map.graphics.graphics.length === 1) { map.centerAndZoom(map.graphics.graphics[0], 12); } } dojo.addOnLoad(init); </script> </head> <body> <div dojotype="dijit.layout.BorderContainer" style="width:100%;height:100%;margin:0" design="headline" gutters="true "> <div class="details" dojotype="dijit.layout.BorderContainer" region="top" style="height:30px;"> Find sites: <input type="text" id="searchText" value="fsl" /> <input type="button" value="Find" onclick="execute(dojo.byId('searchText').value);"/> </div> <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="border:1px solid #000;"></div> </div> </body> </html>
... View more
11-10-2013
10:00 AM
|
0
|
0
|
449
|
POST
|
Glad to help, Ben:) Please consider to mark the thread as Answered so other people may find it helpful. Thanks.
... View more
11-08-2013
09:50 AM
|
0
|
0
|
521
|
POST
|
If you like to use button, then try to use dijit/form/ToggleButton. It has the button's look-n-feel, and function like a checkbox.
... View more
11-08-2013
09:40 AM
|
0
|
0
|
613
|
POST
|
Ben, In your code, you only change the titleText of the second template, not all of them. this.templates[ 1].layoutOptions.titleText = mapTitle; Change it to: array.forEach(this.templates, function(aTemplate) {
aTemplate.layoutOptions.titleText = mapTitle;
}); Not sure how you implement the print GUI. In my app, I use a <select> element to host all the template options, so the user can select which template they like. Then after prompt for the map title, you will know which template's titleText to change instead of changing for all templates.
... View more
11-08-2013
09:35 AM
|
0
|
0
|
521
|
POST
|
Try to make the below changes. If mapTitle is not declared, declare it and give its initial value right below function createPrintDijit() {: var mapTitle = "Default Title"; Change: t.layoutOptions = {"titleText": mapTitle,} To: t.layoutOptions = {"titleText": mapTitle}
... View more
11-08-2013
09:05 AM
|
0
|
0
|
521
|
POST
|
Geoff, it's not hard to incorporate multiple filter options. Here is the sample code just showing the idea. var filter = ""; function executeHandicapQuery(handicapBtn) { map.graphics.clear(); map.infoWindow.hide(); elm = dojo.byId('handicapBtn'); str = "Yes"; var where = "HANDICAPACCESS = '" + str + "'"; filter = filter ? filter + " AND " + where : where; query.where = filter; queryTask.execute(query, showResults); populateGrid(Memory, query.where); //populate dgrid with results fl.setDefinitionExpression(query.where); } function executeRestroomQuery(restroomBtn) { map.graphics.clear(); map.infoWindow.hide(); elm = dojo.byId('restroomBtn'); str = "Yes"; var where = "RESTROOMS = '" + str + "'"; filter = filter ? filter + " AND " + where : where; query.where = filter; queryTask.execute(query, showResults); populateGrid(Memory, query.where); //populate dgrid with results fl.setDefinitionExpression(query.where); } But quickly you will ask another question: I don't want to keep adding the filters. I want to have the freedom to decide how to form the filter freely. In that case, I'd suggest you using checkbox group instead of buttons. The user can build the filter by checking/unchecking each filter option. Here is just the general idea, not a working code. HTML: <div class="filterOptionContainer"> <input type="checkbox" id="filter1" class="clsFilter" /> <input type="checkbox" id="filter2" class="clsFilter" /> <button type="button" onclick="onFilterClick">Filter</button> </div> JS: var filter = ""; var whereClause = { filter1: "HANDICAPACCESS = 'Yes'", filter2: "RESTROOMS = 'Yes'" }; function onFilterClick() { map.graphics.clear(); map.infoWindow.hide(); filter = ""; // dojoQuery is the alias of module dojo/query dojoQuery(".clsFilter").forEach(function(aFilterNode) { if (aFilterNode.checked) { filter += filter ? " AND " + whereClause[aFilterNode.id] : whereClause[aFilterNode.id]; } })); query.where = filter; queryTask.execute(query, showResults); populateGrid(Memory, filter); //populate dgrid with results fl.setDefinitionExpression(filter); }
... View more
11-08-2013
08:52 AM
|
1
|
0
|
613
|
Title | Kudos | Posted |
---|---|---|
1 | 09-17-2013 05:16 AM | |
1 | 08-29-2013 10:58 AM | |
1 | 11-06-2013 04:34 AM | |
6 | 10-20-2020 02:09 PM | |
1 | 11-20-2013 06:09 AM |
Online Status |
Offline
|
Date Last Visited |
12-13-2021
02:09 PM
|