|
POST
|
Tracy, you should set labelAttr and searchAttr the same value as George mentioned before. select.set ("labelAttr", "label");
select.set ("searchAttr", "label");
... View more
09-30-2013
11:53 AM
|
0
|
0
|
332
|
|
POST
|
This should work.
var djtHomeButton = new HomeButton({
map: map
}, "HomeButton");
djtHomeButton._homeNode.title = "This is the new title";
djtHomeButton.startup();
... View more
09-29-2013
08:17 PM
|
0
|
0
|
722
|
|
POST
|
Try:
var myMap; // global variable representing the map
require([
"dijit.layout.BorderContainer",
"dijit.layout.ContentPane",
"dijit.layout.AccordionContainer",
"esri.map",
"esri.geometry.Extent",
"esri/layers/ArcGISTiledMapServiceLayer",
"esri/layers/ArcGISDynamicMapServiceLayer",
"dojo/domReady!"
], function(BorderContainer, ContentPane, AccordionContainer, Map, Extent, ArcGISTiledMapServiceLayer, ArcGISDynamicMapServiceLayer) {
var initialExtent = new Extent({"xmin":-13050590.679808607,"ymin":3848824.1306140213,"xmax":-13033430.566958608,"ymax":3863366.2752452563,"spatialReference":{"wkid":102100}});
myMap = new Map("mapDiv", {extent:initialExtent});
var baseLayer = new ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
var opLayer1 = new ArcGISDynamicMapServiceLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/MapServer",{ opacity:0.8 });
myMap.addLayers([baseLayer, opLayer1]);
});
... View more
09-27-2013
01:42 PM
|
0
|
0
|
316
|
|
POST
|
George is right. Set idProperty to 'value' instead. var dataStore = new Memory({data:districtList, idProperty:"value"});
... View more
09-27-2013
11:59 AM
|
0
|
0
|
1830
|
|
POST
|
For FilteringSelect working with data store, use Memory instead for simplicity. Here is the way to set its options with Memory store. Add "dojo/store/Memory" to the dependency list, and take Memory as the module alias. var memStore = new Memory(districtList); select.set("store", memStore);
... View more
09-27-2013
10:41 AM
|
0
|
0
|
1830
|
|
POST
|
Thanks Zach for the reply. I am using the first generation iPad, which runs at iOS 5.1.1:( That seems to be the most update-to-date iOS this iPad can have. Have you figured out why the click event triggered twice when tap only once?
... View more
09-27-2013
09:50 AM
|
0
|
0
|
426
|
|
POST
|
Hi fellow GIS folks, I have a custom drawing tool developed using JSAPI 3.6, which allows the users to draw points, lines, polygons and texts. It works great on desktop browsers, like Chrome, Firefox, and IE. However, when I test the function on an iPad, the point graphic is added to the map twice every time when I tap on the map. The issue only occurs with point graphics. Line and polygon graphics are all added once. Questions: Does the tap gesture trigger the onDrawEnd event twice, or any other cause? What is the best debug tool to troubleshoot the JS app on iPad? The online search shows not promising result. The best bet so far is weinre. But with it, you cannot set breakpoints. Am I missing something? We only have windows machine, so Mac option does not work for me. Thanks in advance. Jason Z.
... View more
09-27-2013
07:29 AM
|
0
|
2
|
933
|
|
POST
|
It's ok to use square brackets, but need to quote the attribute name, like schoolFeatures.attributes["Facility"]. If using schoolFeatures.attributes[Facility], then Facility should be a string variable holding the field name. I did miss that part in my previous post.
... View more
09-26-2013
11:27 AM
|
0
|
0
|
963
|
|
POST
|
Results is an object, not the array itself. Change: data = arrayUtil.map(results, function(schoolFeatures){
return {
'facility': schoolFeatures.attributes[Facility],
'address': schoolFeatures.attributes[Address],
'city': schoolFeatures.attributes[City],
};
}); To: data = arrayUtil.map(results.featureSet.features, function(schoolFeature){
return {
'facility': schoolFeature.attributes[Facility],
'address': schoolFeature.attributes[Address],
'city': schoolFeature.attributes[City],
};
});
... View more
09-26-2013
10:06 AM
|
0
|
0
|
963
|
|
POST
|
Hi Russell, With the information provided, it's kind of hard for people to figure out what your problem is. Can you post your code and point out which line of the code causes the issue? ESRI posted another approach here you may find it useful.
... View more
09-26-2013
06:25 AM
|
0
|
0
|
722
|
|
POST
|
Glad to help. Please consider mark your thread as "Answered" so other people may find it helpful. Thanks.
... View more
09-26-2013
06:12 AM
|
0
|
0
|
2039
|
|
POST
|
You can use polyline.getPoint(pathIndex,pointIndex) function to get the point you need. For instance, First point of the first path: polyline.getPoint(0,0) Last point of the first path: var lastIdx = polyline.paths[0].length - 1;
var lastPnt = polyline.getPoint(0, lastIdx)
... View more
09-26-2013
05:22 AM
|
0
|
0
|
2039
|
|
POST
|
Try this. function populateDropDownList(){ var queryTask = new QueryTask(educationLayer.url + "/3"); var query = new Query(); query.outFields = ["DIST_NAME", "DIST_CODE"]; // assuming DIST_CODE is the field for district id query.where = "1=1"; query.returnGeometry = false; queryTask.on('complete', resultsHandler); queryTask.on('error', errorHandler); queryTask.execute(query); } function resultsHandler(results){ select = registry.byId("distSelect");// a dijit.form.Select districtList.length = 0; var numResults = results.featureSet.features.length; for (var j = 0; j < numResults; j++) { var distName = results.featureSet.features .attributes.DIST_NAME; var distID = results.featureSet.features .attributes.DIST_CODE; districtList.push({label: distName, value: distID}); } districtList.sort(function(item1, item2) { var label1 = item1.label.toLowerCase(), label2 = item2.label.toLowerCase(); return (label1 > label2) ? 1 : (label1 < label2) ? -1 : 0; }); select.addOption(districtList); }
... View more
09-25-2013
02:09 PM
|
0
|
0
|
1830
|
|
POST
|
Create a feature layer, and use setDefinitionExpression to filter the features based on their attribute data. Here is a sample.
... View more
09-25-2013
02:00 PM
|
0
|
0
|
533
|
|
POST
|
Hi Curt, Instead of using the icon url, why not using imageData directly to save some client-server round traffic? For your reference, below is the excerpt of the JSON string returned from the legend request.
var legendResponse = {
"layers": [{
"layerId": 0,
"layerName": "ROW",
"layerType": "Feature Layer",
"minScale": 1000000,
"maxScale": 0,
"legend": [{
"label": "",
"url": "393c5a8cc17bc07be57e6aedb7519a27",
"imageData": "iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAENJREFUOI1jYaAyYGFgYGAoWMHwnxqGTYhgYGShhkHIAMXACREMjOQYguxD2rpw1MBRA0cNHB4GUqNcpI0LyS0HsQEAa34JUaZbYooAAAAASUVORK5CYII=",
"contentType": "image/png"
}]
}, Here is the code to build an image node. var layerLegend = legendResponse.layers[0].legend;
legendImgNode = domConstruct.create("img", {
src: "data:" + layerLegend.contentType + ";base64," + layerLegend.imageData
});
... View more
09-24-2013
05:38 AM
|
0
|
0
|
2698
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-17-2013 05:16 AM | |
| 1 | 11-06-2013 04:34 AM | |
| 1 | 08-29-2013 10:58 AM | |
| 6 | 10-20-2020 02:09 PM | |
| 1 | 11-20-2013 06:09 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-17-2024
08:41 AM
|