POST
|
Brian, You could always put a graphic on top of that feature? See this example. Hope this helps! Tim This seems to have worked for me. Seems like kind of a work around, but it did the trick.
... View more
03-13-2014
06:52 AM
|
0
|
0
|
797
|
POST
|
The best way to do this would be to set the FeatureLayer's selection symbol then call the selectFeatures() method. I originally thought of this, but I would like my users to still be able to click on and select other features in the same FeatureLayer within this view. However the view would remain focused on the original feature.
... View more
03-13-2014
06:51 AM
|
0
|
0
|
795
|
POST
|
Is there a way to set a specific symbol on only a single feature in a FeatureLayer on a map? I typically think of symbology being set on a layer and the same goes for a selection symbol. In this case, I have a specific map view in my app that centers and zooms to a specific feature on a map and then shows all attributes for that feature in a table next to the map. The other features in the layer are still visible on the map and it may not be readily visible which feature is being focused so I'd like to change the symbol of that one feature. Any ideas how this could be accomplished?
... View more
03-11-2014
08:45 AM
|
0
|
5
|
1291
|
POST
|
I am starting to develop a new Javascript application using the Esri Javascript API. I'd like to organize my app using MVC structures. I have heard about Backbone.js, but I've never used it. I was looking at the documentation and tutorials for Backbone.js and it looks very promising. However, it looks like Backbone.js has built in functionality for interacting with a database from a model. I have not been able to figure out how to override this built in behavior so Backbone.js models can communicate with feature services using esri/tasks/query or esri/layers/FeatureLayer.applyEdits. Does anyone have experience doing this or have any idea how I might accomplish this?
... View more
02-18-2014
05:45 AM
|
1
|
3
|
2805
|
POST
|
Even if I make the webmap public and leave the layers secure, the createMap call tries to access the secured services and will prompt the user for credentials. I think I may have found a solution. I created a web service that simply calls the generateToken REST endpoint and returns the token to the client. Then I have a Javascript function that creates new Credential objects for each secured resource with the returned token. I can then add each credential to esriKernel.id.credentials. By using the web service, my username and password are still protected in server side code so users have not access to it, but the app can still retrieve a token to save in the IdentityManger.
... View more
01-08-2014
10:23 AM
|
0
|
0
|
1648
|
POST
|
Currently everything is shared with Everyone (public) and everything works without requiring the user to login. What I'm trying to do now is make it so certain services are only accessible via the app. That way the only people who can work with the data are those who have access to the application.
... View more
01-07-2014
12:13 PM
|
0
|
0
|
1648
|
POST
|
I think this will still prompt the user for credentials during the createMap call because it has to access the secured resources before returning the layers.
... View more
01-07-2014
12:00 PM
|
0
|
0
|
1648
|
POST
|
In my case, I am not creating individual FeatureLayers because I am using arcgisUtils.createMap() to load data from ArcGIS Online. Is there a way I could do the same thing with the webmap?
... View more
01-07-2014
11:41 AM
|
0
|
0
|
1648
|
POST
|
I have a Javascript Web Map Application using the Esri JS API that is accessing data in ArcGIS Online. I don't want my users to have to log in to ArcGIS Online in order to access the content so I'd like the app to log in instead. So far I was able to accomplish this using a proxy page that attaches a token to any requests for secured services. This method works, but the proxy page creates a bottleneck and the performance decrease is very noticeable when using the app even when panning and zooming. I've been looking at the documentation for the IdentityManager, IdentityManagerBase, and Credential classes in the JS API to see if there is a way to recreate the process used when the user is prompted for credentials by adding credentials to the Identity Manager programmatically. So far I cannot figure out how to save a token in the IdentityManager for use by future requests. Is there a way that I could use my proxy page to retrieve a token when the app is loaded and then add the token to the IdentityManager so it would automatically be added to any necessary requests and the user would not be prompted for credentials?
... View more
01-07-2014
10:42 AM
|
0
|
13
|
11850
|
IDEA
|
I often upload empty layers into AGOL for use in JS web applications for data collection. Everytime I upload the layer I am required to configure the layer in the AGOL Web Map Viewer and save a Web Map. There should be an easy way to configure a layer in a web map and simply change the feature service it is pointing to. This is very similar to the ability to change the data source of a layer in ArcGIS Desktop. Similarly, it would be very helpful to be able to do the same thing with a web map configuration.
... View more
12-09-2013
08:44 AM
|
11
|
3
|
755
|
POST
|
I was just looking over the Esri JS API documentation and the Esri REST API documentation at query operations. I noticed that the query REST endpoint is called by the FeatureLayer.queryFeatures function. The query REST endpoint has an option for returnDistinctValues to get a list of unique values in a field. Why isn't this an option for the Query object in the JS API. It's always a lot of trouble to have to sift through the results of a query to get the unique values and it's even worse when there are more values than are returned by a single query.
... View more
10-29-2013
07:47 AM
|
0
|
5
|
3065
|
POST
|
I again did some experimentation. Just have a look on the code below: <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Simple Map</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css">
<style>
html, body, #map, #map1 {
height: 80%;
width: 100%;
margin: 10;
padding: 0;
}
body {
background-color: #FFF;
overflow: hidden;
font-family: "Trebuchet MS";
}
</style>
<script src="http://js.arcgis.com/3.7/"></script>
<script>
var map,map1;
require(["esri/map", "esri/layers/FeatureLayer",
"esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol",
"esri/renderers/SimpleRenderer", "esri/graphic", "esri/lang",
"dojo/_base/Color", "dojo/number", "dojo/dom-style",
"dijit/TooltipDialog", "dijit/popup", "dojo/domReady!"], function(
Map, FeatureLayer,
SimpleFillSymbol, SimpleLineSymbol,
SimpleRenderer, Graphic, esriLang,
Color, number, domStyle,
TooltipDialog, dijitPopup
) {
map = new Map("mapDiv", {
basemap: "streets",
center: [-80.94, 33.646],
zoom: 8,
slider: false
});
map1 = new Map("map1", {
basemap: "streets",
center: [-80.94, 33.646],
zoom: 8,
slider: false
});
var southCarolinaCounties = new FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3")
map.addLayer(southCarolinaCounties);
var southCarolinaCounties1 = new FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3")
map1.addLayer(southCarolinaCounties1);
});
</script>
</head>
<body>
<div id="mapDiv"></div>
<div id="map1"></div>
</body>
</html>
Basically I have to take two separate variables for defining same feature layer and then adding them to different map divs. P.S.: It was a random experiment so exclude unnecessary variables or require additions. Abhy Thanks Abhy, The problem with this method is that it is actually creating 2 different FeatureLayer objects. That means that if one FeatureLayer has features selected, that selection will not be reflected in the other FeatureLayer. I'd like to keep the FeatureLayers in sync with each other. I suppose I could just listen for events like onSelectionComplete, etc. and then perform the selection again on the second layer, but I was hoping for a better solution.
... View more
10-29-2013
06:49 AM
|
0
|
0
|
669
|
POST
|
I am working on a mobile web app using jQuery Mobile. I have multiple "pages" in my app, but they are technically all in one html doc. The main page of my app has a map in it created using a webmap from ArcGIS Online. Another page in the app also needs to have a map in it and I would like to add a single feature layer from the main map to the second map. I tried:
self.map = new Map(self.mapDiv, {
basemap : "hybrid",
logo: false,
showInfoWindowOnClick : false,
slider: false
});
if (self.currentLayer) {
self.map.addLayer(self.currentLayer);
self.map.setExtent(graphicsUtils.graphicsExtent(self.currentLayer.graphics));
} Where self refers to the module this function is in. self.currentLayer is a FeatureLayer object taken directly from the main map. The above code successfully creates a map on the second page, but no features are visible on the map. Is it possible to have multiple maps with the same FeatureLayer shown in both? I'd like both maps to honor the same queries/selections/definition expressions and symbology.
... View more
10-28-2013
02:00 PM
|
0
|
5
|
820
|
POST
|
I have been learning about the NumpyArrayToFeatureClass function in the Data Access Module of Arcpy. In the docs it says: NumPyArrayToFeatureClass will not overwrite an existing feature class, even if the overwriteOutput environment is set to True. However, there is no mention of whether this means that the function will fail or will it append data to an existing feature class. Can anyone tell me if this will append data to an existing feature class?
... View more
10-14-2013
09:17 AM
|
0
|
1
|
617
|
POST
|
Can I programmatically select a template in a TemplatePicker widget? I haven't found any methods of the widget itself to select and item. Is that possible?
... View more
09-20-2013
10:28 AM
|
0
|
4
|
1873
|
Title | Kudos | Posted |
---|---|---|
1 | 12-17-2012 09:04 AM | |
1 | 09-12-2013 02:12 PM | |
11 | 12-09-2013 08:44 AM | |
1 | 02-18-2014 05:45 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|