|
POST
|
Thanks Matt - that certainly enabled the suggestion menu. However, the autoNavigate functionality won't work. The entire map goes blank and I get a console error: Error: Invalid value for <image> attribute x="NaN" Error: Invalid value for <image> attribute y="NaN" The REST Endpoint returns correct coords if I use it directly (although when building the geocoder, I didn't manually specific (x,y) like you can at 10.3). I assume the default of just taking the (x,y) from the SHAPE field would do. Anyway, thoughts here? Stilling using the same code as above, except with the "suggest" parameter.
... View more
01-05-2015
08:39 AM
|
0
|
10
|
2404
|
|
POST
|
So an additional detail I've discovered is that it's the holding down of the shift key that is the problem, not the caps itself. In other words, if caps lock is on, this doesn't become a problem, but if the shift key is held down, it does. So if caps lock is on, AND the shift key is held down (hence all input being in lower case), the problem still exists. So it's the shift key. The reason I found this out is because of of our custom geocoders uses airport codes (DCA, LAX, SFO) as input. Users are used to entering in these items as all-caps acronyms, but as JS API 3.10+, the auto suggest doesn't work. Seems like a bug to me.
... View more
12-29-2014
12:51 PM
|
0
|
1
|
1318
|
|
POST
|
Hoping to get a response from Esri on a couple geocoder related problems: The geocoder dijit starting at 3.10 (everything seems to work find at 3.9) doesn't send a query to a geocoding service if the input is in all caps until the user enters a space. That is, it ignores the minCharacters property and just doesn't try to get a list of results from the geocoding service. However, if the user input is in lowercase or camel case, minCharacters is honored and the dijit sends a request to the service at the appropriate time. I have investigated this behavior with both ArcGIS World Geocoding service and a 10.2.2 custom Geocode Service. Also, ArcGIS Geocode Service at 10.3 is much different than earlier versions (suggest query and magic keys and such). I don't think version 3.12 of the API was written with 10.3 in mind, so all applications using the standard geocoder dijit will break if you upgrade to 10.3 (please see this post: ArcGIS 10.3 GeocodeServer and JS 3.12 Geocoder Widget Any thoughts on that?
... View more
12-29-2014
10:21 AM
|
0
|
4
|
5335
|
|
POST
|
<!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>Geocoder Widget</title> <link rel="stylesheet" href="http://js.arcgis.com/3.12/esri/css/esri.css"> <style> html, body, #map { height:100%; width:100%; margin:0; padding:0; } body { background-color:#FFF; overflow:hidden; font-family:"Trebuchet MS"; } #search { display: block; position: absolute; z-index: 2; top: 20px; left: 75px; } </style> <script src="http://js.arcgis.com/3.12/"></script> <script> var map; var geocoder; var locatorUrl = "http:myserver:6080/arcgis/rest/services/Locators/AirportsGeocode/GeocodeServer"; require([ "esri/map", "esri/dijit/Geocoder", "dojo/domReady!" ], function( Map, Geocoder ) { map = new Map("map",{ basemap: "dark-gray", center: [-97,38], // lon, lat zoom: 5 }); var myGeocoders = [{ url: locatorUrl, name: "AirportsGeocode", singleLineFieldName: "SingleKey" }]; geocoder = new Geocoder({ map: map, autoComplete: true, autoNavigate: true, showResults: true, highlightLocation: true, maxLocations: 5, minCharacters: 2, arcgisGeocoder: false, geocoders: myGeocoders, value: "LAX" },"search"); geocoder.startup(); }); </script> </head> <body> <div id="search"></div> <div id="map"></div> </body> </html>
... View more
12-23-2014
05:53 AM
|
0
|
12
|
2404
|
|
POST
|
I have a 10.3 Geocode Server with suggest enabled, and trying to upgrade my applications with the geocoder widget using 3.12 JS API. Previous versions (10.2 Server and 3.11 API) worked great with auto suggest and auto navigate, and the Esri's world geocoding service plays very nicely with the geocoder widget at 3.12 (particularly like the highlightLocation feature), but everything seems broken with a custom GeocodeServer. Autosuggest doesn't work, auto navigate doesn't work even when you choose an exact match, etc. etc. Is this supposed to work with the geocode widget or do we have to write custom functionality (using the suggest and grabbing the magickey and then doing single line input). Seems like 10.3 has come slightly ahead of 3.12 API - do we have to wait until 3.13 or 4.0 for this to be fixed, or is it a bug? Here is my source code:
... View more
12-22-2014
09:04 AM
|
0
|
13
|
8246
|
|
POST
|
According to this I am supposed to be able to add a csv file with address (City, State, Zip, etc) components, and Portal for ArcGIS can geocode those locations and add them as a layer to the map. I can do this with CSVs with point (lat/lon) coordinates just fine, but whenever I try with address components, I get an error that says: "File does not seem to contain fields with point coordinates." I have tried with Esri's default geocoder as well as my own (which supports city/state geocoding) but it still doesn't work. I can accept if this functionality isn't supported in Portal, but the documentation clearly says it does. Is there something I'm doing wrong? (Also, I tested the same in ArcGIS for Organizations, and it worked, so there is no problem with my CSV). I have also tried using the Add from File button in Portal, but I get the same error. Thanks!
... View more
12-04-2014
10:01 AM
|
0
|
1
|
3952
|
|
POST
|
I wrote a script to determine how long it takes to set arcpy.env.workspace to a series of feature datasets within an enterprise geodatabase(SDE 10.2.2 on SQL Server 2012), and these are my results. You can see that some of the assignments take longer than 3 minutes, and it's just assigning a workspace! 7.3149998188seconds to set EONGIS.SDE.faa as workspace 1.0720000267seconds to set EONGIS.SDE.mlquery as workspace 222.508000135seconds to set EONGIS.SDE.naturalhazards as workspace 79.6970000267seconds to set EONGIS.SDE.partnerfeeds as workspace 0.561000108719seconds to set EONGIS.SDE.space as workspace 2.94499993324seconds to set EONGIS.SDE.Boundaries as workspace 221.398999929seconds to set EONGIS.SDE.naturalhazards2 as workspace For reference, here is the script: import arcpy, time
uri = r"C:\EsriEON\eon\publishing\connections\eon_connection.sde"
arcpy.env.workspace = uri
dsets = arcpy.ListDatasets()
for dset in dsets:
start = time.time()
arcpy.env.workspace = uri + "\\" + dset
end = time.time()
print str(end-start) + "seconds to set " + dset + " as workspace"
So obviously the naturalhazards feature dataset is the most problematic. But so is partnerfeeds. Naturalhazards2 is an exact copy of the original naturalhazards. I created naturalhazards2 to see if there was some corruption in naturalhazards. Here's some contextual information... My geodatabase is mostly feature datasets with feature classes inside, but also has some locators, and a toolbox. There is nothing unique about any of the feature datasets except the data within them. Each contains between 2 and 6 feature classes and that's it, and each is used as the source for some server map services. Does anyone have any suggestions on why these times may vary so much? How to troubleshoot why some may be taking longer than others? Thanks!
... View more
12-02-2014
12:39 PM
|
0
|
1
|
4187
|
|
POST
|
I'm trying to create a layer "widget" that essentially specifies a feature layer, renderer, and infoWindow and can be reused across multiple applications. This would provide consistency across our maps, and dictate one location if we wanted to change icons, rendering, or info window contents (which could also also be overwritten for specific applications). Anyway, I'm having trouble with some JS heavy stuff that I don't understand. I want to create some scale dependent rendering based on an attribute field that shows more feature types (greater detailed feature types) as you zoom in. In a standard application, I achieved this by:
map.on('zoom-end', function(result){
var query = "ZoomLevel <= " + result.level.toString();
layer.setDefinitionExpression(query)});
However, when I did this in my reusable widget, it didn't work, because my layer object wasn't accessible within the scope of the 'zoom-end' callback. I know through research that I need to use Dojo's lang.hitch function, but am unclear how to implement it. The below code works when I instantiate the object in my app, but when I zoom in, it throws and error saying this.airportsLayer is undefined (the zoom-end callback doesn't have access to the scope). Can anyone advise me how to use lang.hitch appropriately to create the desired effect (which is once instantiated, it automatically sets the zoom-end handler on the map). Thanks!
define([
"dojo/_base/declare",
"esri/layers/FeatureLayer",
"esri/InfoTemplate",
"esri/symbols/PictureMarkerSymbol",
"esri/renderers/UniqueValueRenderer",
"esri/symbols/SimpleFillSymbol",
"esri/Color",
"dojo/_base/lang",
"dojo/domReady!"
],
function(
declare,
FeatureLayer,
InfoTemplate,
PictureMarkerSymbol,
UniqueValueRenderer,
SimpleFillSymbol,
Color,
lang
) {
return declare(null, {
constructor: function(map) { //constructor requires your desired name
this.map = map;
this.infoTemplate = new InfoTemplate("Airport Code: ${LocationID}", "<ul><li><b>Name: </b>${FacilityName}</li><li><b>Address: </b>${OwnerAddress}, ${OwnerCSZ}</li><li><b>Flights Daily: </b>${FlDaily}</li><li>${UseType} ${Type}</li></ul>");
this.airportsLayer = new FeatureLayer("http://myserver:6080/arcgis/rest/services/EON/FAA/MapServer/0", {
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["ZoomLevel", "Type", "OEP35", "Image", "LocationID", "FacilityName", "OwnerAddress", "OwnerCSZ", "Part139", "OEP35", "UseType", "Type", "FlDaily", "Image", "URL", "URL2"],
infoTemplate: this.infoTemplate,
visible: true
});
this.defaultSymbol = new SimpleFillSymbol().setColor(new Color([255, 255, 255, 0.75]));
this.renderer = new UniqueValueRenderer(this.defaultSymbol, "Image");
this.renderer.addValue("military-airport-part139.png", new PictureMarkerSymbol("../../icons/airports/military-airport-part139.png", 24, 24));
this.renderer.addValue("military-airport.png", new PictureMarkerSymbol("../../icons/airports/military-airport.png", 16, 16));
this.renderer.addValue("military-heliport.png", new PictureMarkerSymbol("../../icons/airports/military-heliport.png", 16, 16));
this.renderer.addValue("private-airport.png", new PictureMarkerSymbol("../../icons/airports/private-airport.png", 16, 16));
this.renderer.addValue("private-airport-part139.png", new PictureMarkerSymbol("../../icons/airports/private-airport-part139.png", 24, 24));
this.renderer.addValue("private-balloonport.png", new PictureMarkerSymbol("../../icons/airports/private-balloonport.png", 16, 16));
this.renderer.addValue("private-gliderport.png", new PictureMarkerSymbol("../../icons/airports/private-gliderport.png", 16, 16));
this.renderer.addValue("private-heliport.png", new PictureMarkerSymbol("../../icons/airports/private-heliport.png", 16, 16));
this.renderer.addValue("private-seaplane base.png", new PictureMarkerSymbol("../../icons/airports/private-seaplane.png", 16, 16));
this.renderer.addValue("private-ultralight.png", new PictureMarkerSymbol("../../icons/airports/private-ultralight.png", 16, 16));
this.renderer.addValue("public-airport.png", new PictureMarkerSymbol("../../icons/airports/public-airport.png", 16, 16));
this.renderer.addValue("public-airport-oep35.png", new PictureMarkerSymbol("../../icons/airports/public-airport-oep35.png", 32, 32));
this.renderer.addValue("public-airport-part139.png", new PictureMarkerSymbol("../../icons/airports/public-airport-part139.png", 24, 24));
this.renderer.addValue("public-balloonport.png", new PictureMarkerSymbol("../../icons/airports/public-balloonport.png", 16, 16));
this.renderer.addValue("public-gliderport.png", new PictureMarkerSymbol("../../icons/airports/public-gliderport.png", 16, 16));
this.renderer.addValue("public-heliport.png", new PictureMarkerSymbol("../../icons/airports/public-heliport.png", 16, 16));
this.renderer.addValue("public-seaplane base.png", new PictureMarkerSymbol("../../icons/airports/public-seaplane.png", 16, 16));
this.renderer.addValue("public-ultralight.png", new PictureMarkerSymbol("../../icons/airports/public-ultralight.png", 16, 16));
this.airportsLayer.setRenderer(this.renderer);
this.airportsLayer.setDefinitionExpression("OEP35 = 1");
this.setZoomDependentRendering = lang.hitch(this, this.setZoomDependentRendering)
this.setZoomDependentRendering();
},
setZoomDependentRendering: function() {
this, this.map.on('zoom-end', function(a) {
var query = "ZoomLevel <= " + a.level.toString();
console.log(a);
console.log(this.airportsLayer);
this.airportsLayer.setDefinitionExpression(query);
});
}
});
});
... View more
07-21-2014
01:33 PM
|
0
|
0
|
834
|
|
POST
|
I have a point feature layer, and want to determine which areas have 5 or more points within 100 miles (not necessarily which points have 4 or more points within 100 miles from it). I'm unclear on how to do this, and am open to suggestions. Would hexagonal binning work for this, or should I create a raster? What about as new points get added (as they do about one every 10 minutes or so). Would I have to redo the entire analysis, or is there a way to fold the new point into the previous analysis, to see if the addition now satisfies the condition. Thanks!
... View more
07-09-2014
09:46 AM
|
0
|
1
|
3700
|
|
POST
|
Hi, I've been tasked with automating the daily publishing of an Oracle table to an ArcGIS for Server instance. There is no SDE installed on Oracle, and I have little control over the database instance itself. My solution to this is the following: 1. Install ArcMap on a server machine. 2. Have a recurring Python script that updates a local geodatabase with a fresh copy of the table from the Oracle instance. 3. Automate republishing of the data to an ArcGIS for server instance using ArcGIS for Server admin utilities and arcpy.mapping. Is there a simpler way to do this? If not, does anyone have any tips on how to get started on accessing Oracle database through Python using OBDC connections? Thanks!
... View more
03-14-2014
09:35 AM
|
0
|
2
|
2211
|
|
POST
|
I copied the cluster layer implementation from https://developers.arcgis.com/javascript/jssamples/layers_point_clustering.html. I looked at the ClusterLayer.js file, and saw a comment that the labelOffset doesn't work in IE. So as I expected, when I loaded my map in IE, the clusters didn't show with their corresponding cluster size, as they do in Chrome and Firefox. However, when I checked the live sample of the demo in IE (http://developers.arcgis.com/javascript/samples/layers_point_clustering/), the cluster numbers do appear. So does anyone know why they won't show up in my map (using IE) if they show up in the sample. I'm using the same copy of ClusterLayer.js that the demo is using. Thanks!
... View more
03-12-2014
09:43 AM
|
0
|
0
|
735
|
|
POST
|
hmmm, I don't see the behavior anymore. It must have been fixed in a recent Chrome update.
... View more
03-12-2014
08:50 AM
|
0
|
0
|
1867
|
|
POST
|
I am running into a problem with the JS API v3.8 in which the maps 'extent-change' event is fired with a single mouse click (not double or shift+click, just a simple click on the map), even though a single mouse click does not cause the map's extent to actually change. Normally this isn't a problem unless you have a need to run some real code when the extent actually changes. This behavior is unfortunately preventing my popup window from appearing, because I have a function attached to the 'extent-change' event which actually clears the feature layer. But one click should just show the popup, and not fire the 'extent-change'. UPDATE: this only seems to be affecting Chrome Regardless, see the following code to reproduce in the simplest manner possible: <!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.8/js/esri/css/esri.css"> <style> html, body, #map { height: 100%; width: 100%; margin: 0; padding: 0; } body { background-color: #FFF; overflow: hidden; font-family: "Trebuchet MS"; } </style> <script src="http://js.arcgis.com/3.8/"></script> <script> var map; require(["esri/map", "dojo/domReady!"], function( Map) { map = new Map("map", { basemap: "gray", center: [-97, 38], zoom: 5, sliderStyle: "small" }); map.on('extent-change', function(){console.log('extent changed');}); }); </script> </head> <body> <div id="map"></div> </body> </html>
... View more
02-27-2014
09:12 AM
|
0
|
7
|
4374
|
|
POST
|
Thanks Derek - I was able to get it to work by copying the format of your example. There were a couple differences with my code (but not much). Following the example's layout solved the problem for me. The next challenge is to get paging to work with the popups....
... View more
01-09-2014
07:50 AM
|
0
|
0
|
836
|
|
POST
|
I have created a custom GraphicsLayer (based on a query to an external web service that isn't ArcGIS based). I would like to implement paging for popups for the GraphicsLayer. When using map-service based FeatureLayers, I would generally add the feature layer in SELECTIONMODE and also add a DynamicMapServiceLayer from the map service URL. A spatial query based on mouse clicks can return the features, which I load into the popup for paging. However, I don't know how to perform this same type spatial query on the GraphicsLayer. Can anyone provide any assistance?
... View more
01-08-2014
08:27 AM
|
0
|
0
|
520
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 02-23-2026 11:00 AM | |
| 1 | 07-08-2025 11:33 AM | |
| 1 | 11-07-2023 08:32 AM | |
| 2 | 10-01-2025 06:52 AM | |
| 5 | 09-08-2025 07:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
Thursday
|