|
POST
|
Using JS API #3.20, the smartmapping.createClassedColorRenderer() method is supposed to have a statistics output parameter on the promise object, which seems to be missing. When altering the smartmapping bycolor Sample in line 195, so that it says smartMapping.createClassedColorRenderer instead of smartMapping.createColorRenderer results in an error calculating the histogram, because something is undefined. Taking a closer look, the promise object of the classed color renderer doesn't have the "statistics" property, which is supposed to be there. Is this a Bug or am I missing something?
... View more
06-13-2017
05:55 AM
|
0
|
0
|
946
|
|
POST
|
Rene Rubalcava no opinion, or did I link the wrong profile of yours?
... View more
06-13-2017
05:32 AM
|
0
|
2
|
2241
|
|
POST
|
Although my issue is solved, I'd still like to point out that I see two problems in the JS API here: The RouteParameters class is missing the "overrides" property. (also in JS API 4.x) Some of the RouteParameters can be set via directionsWidgetObject.routeParams and implicitly passed through to RouteTask.solve(). But the selection of properties that is exposed here seems pretty odd to me: While some important ones are missing (in fact, most of the RouteParameters properties are missing), I can totally bamboozle the Directions widget by misusing some of the properties provided. Just add this to the simple Directions sample after instantiating Directions: directions.on("directions-start", function() {
directions.routeParams.returnDirections = false;
directions.routeParams.returnRoutes = true;
}); Because the route summary is taken from the directions header, there will be no summary with these settings. If you also set returnRoutes=false, you'll get an "route cannot be calculated" error. I would consider this a bug or at least awkward design. Rene Rubalcava, what do you think?
... View more
06-02-2017
02:30 AM
|
1
|
3
|
2241
|
|
POST
|
John, thanks for the hint! I'm now just calling esriRequest.setRequestPreCallback(lang.hitch(this, this.setRouteParams)); while esriRequest is not an instantiated object, but the class itself. I had no idea that I can use esriRequest in that static manner (if that's what you call it in JS). Thanks again! Nik #setRequestPreCallback
... View more
06-01-2017
11:53 PM
|
0
|
0
|
2241
|
|
POST
|
Hi all, hi Rene Rubalcava, hi mcrowder-esristaff, I'm using the Directions widget in JS API 3.x, and I'm setting some RouteParameters via
this.directions.on("directions-start", lang.hitch(this, function(evt) {
this.directions.routeParams.impedanceAttribute = <...>;
this.directions.routeParams.accumulateAttributes = <...>;
this.directions.routeParams.directionsTimeAttribute = <...>;
})); Those are working, I can see them being send in the GET request and they affect the results as expected. Now here's the thing: There is a new parameter in the 10.5 NAServer REST interface called "overrides", which I need to set. This parameter doesn't exist on the JS object RouteParameters, and if I just add it to directions.routeParams, it won't go through to the request. (I've tried just assigning this.directions.routeParams.overrides, but I've also tried ES6's Object.assign in the Chrome dev console: The property is added to the routeParams object, but it's still not transferred to the request.) Afaik, there is no later point for me to alter the request: The Directions widgets seems to implicitly call RouteTask.solve(routeParams), and there is no pre-solve event or anything on the RouteTask to intercept the call. Btw, the same goes for the 4.x API - no "overrides" parameter on RouteParameters. Testing via the plain REST API test form (NAServer/Route/solve), I can set the "overrides" parameter and it works. Can someone help? Thanks Nik
... View more
05-31-2017
08:44 AM
|
1
|
6
|
2885
|
|
POST
|
Rene, Yes! That was it. => set to false, works like a charm!
... View more
03-03-2017
03:57 AM
|
0
|
0
|
4063
|
|
POST
|
Yeah, an error message would be nice for a change.. But the styles are definitely loaded. I can see the cartographic differences when I load the different styles - it's just that they all are enhanced with those borders and labels.
... View more
03-02-2017
07:03 AM
|
0
|
0
|
4063
|
|
POST
|
thejus, good question.. how can I tell? The tiles are coming in those PBF packages. When I make a search in the binary text in the packages, I don't get any findings for the label. Is that what you meant?
... View more
03-02-2017
06:57 AM
|
0
|
0
|
4063
|
|
POST
|
Hi Robert, no I don't. No failing network traffic either. Apart from the strange symbology, the layer behaves correctly. Meaning that it loads, zooms and pans. Thanks Nik
... View more
03-02-2017
06:43 AM
|
0
|
2
|
4063
|
|
POST
|
I'm trying to use an Esri Basemap as VectorTileLayer in a custom JS application, built on the 3.19 API. I've adapted this sample for my application: layers_vector Sample in ArcGIS Sandbox In the sample, the layer looks fine as you would expect it. I've also downloaded the sample to host it from my local IIS, and everything's alright. As soon as I put the VectorTileLayer into my own application, the tiles appear with red boundaries and big labels with numbers (seems like the tile location or ID) on the top left corner of each tile. Here's a screenshot, with the sample (as expected) on the left and my custom app (with unwanted borders and labels) on the right side: I've also attached two animated GIFs so you can see how this behaves. This happens for all parts of the world and all zoom levels, down to one big ass earth tile when completely zoomed out: I would understand that this could probably be defined in a Vector Layer Style, but I've used the following 2 styles and also the direct reference to the VectorTileServer both in the sample and in my custom app - the effect is always the same! var vtlayer = new VectorTileLayer("https://www.arcgis.com/sharing/rest/content/items/bf79e422e9454565ae0cbe9553cf6471/resources/styles/root.json");
//"https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer");
//"https://www.arcgis.com/sharing/rest/content/items/5ad3948260a147a993ef4865e3fad476/resources/styles/root.json?f=pjson");
this.map.addLayer(vtlayer); I don't think that it's anything connected with CSS (I don't even see the single tiles as objects in the DOM tree), and I've stripped down the code of my custom app so that only the map and the VectorTileLayer are being used, as it is in the sample - no luck. Any ideas what this could be are highly appreciated! Thanks Nik
... View more
03-02-2017
06:14 AM
|
0
|
9
|
4709
|
|
IDEA
|
I know. We know that. We all know that. But it's convenient to keep a basemap in my MXD to have some orientation. Most people do that. Manually removing the Basemap Layer (as well as clearing the selected features 00021: Feature selections are not supported) is annoying and time-consuming, because it has to be done before every publish process, and to continue working with the local MXD, the Basemap will usually be added again. I would love the service editor to just throw out the Basemap Layer when publishing the service instead of returning "Error 00037: Basemap Layers cannot be published directly to a service". You might give back a warning, that the uploaded map document has been altered, but that should be it.
... View more
09-20-2016
05:27 AM
|
9
|
1
|
2113
|
|
POST
|
I have an NAServer with several travel modes defined on the Network Dataset and I'm using that service in a JS app with the Directions widget. Enabling the showTravelModesOption shows the travel modes menu, and everything works fine. Now I need to restrict the number of displayed modes: The JS app is fired up with a country code parameter, and it is always using the same NAServer. Not all travel modes apply for every country, so I need to filter out some of the travel modes before showing them in the Directions Widget. Here's what I tried: Find a setter to apply the filtered list. But there seems to be no setter: The Directions widget offers getSupportedTravelModeNames(), the RouteTask offers getServiceDescription(), which returns a Deferred object, that gives me supportedTravelModes. There is nothing for the complete list in the RouteParameters. => Getters only for the complete list. DOM manipulation. dojo.query(".esriTravelModesTypeName") gives me the node where the travel modes menu appears, but I only get the one that is visible at the beginning. The others only appear when the user opens the menu, and that it too late to hide some child elements (or would at least result in an ugly effect). Does someone have an idea?
... View more
05-19-2016
03:45 AM
|
0
|
0
|
2220
|
|
POST
|
Addition: As a workaround, I'm using the "prefix" parameter on Search.sources, but the results don't strike me as very convincing. Example: My SMP-Locator covers several European countries. Search string "edin" (no country restriction) gives back Edinburgh as 1st result, among other international results. Search string "GBR,edin" finds only results from Great Britain, but no Edinburgh. I get a lot of Edingthorpes and Edin Gate, which seem a lot less important. I can imagine that this is a matter of how the address locators are organized within the composite locator, but still: I would expect to get the "European results" in that particular order with all but the GBR findings filtered out, because the Locator obviously recognizes "GBR" as a country code..
... View more
05-18-2016
02:10 AM
|
0
|
0
|
732
|
|
POST
|
I'm using an SMP Locator service as source for the Directions Widget search fields. On text input, the widget fires a "suggest" request to the Locator Service. So far so good. Now, I need to restrict the results to a certain country code. From the Directions Widget, single line input is used. I tried adding the country code via the "Search.sources" parameters "suffix" (see Search | API Reference | ArcGIS API for JavaScript), but this gave me no results. Using the parameter "countryCode" on "Search.sources" doesn't restrict anything - probably because my Locator service doesn't support it. Here's an article about that problem, but it relates to the deprecated "Geocoder" widget, that was replaced by the "Search" widget: geocoding - Restrict suggestions from ESRI ArcGIS REST API to US addresses only - Geographic Information Systems Stack E… The "Locator" object has a "countryCode" parameter, which unfortunately only works with the World Geocoding Service: Locator | API Reference | ArcGIS API for JavaScript Is there a way to enable my local SMP Locator to work with the countryCode parameter? Or is there another way I can restrict my results via some JS parameter?
... View more
05-17-2016
08:43 AM
|
1
|
1
|
3413
|
|
BLOG
|
Die Großwetterlage beiden vergangenen Tage über Deutschland wurde beherrscht von Niklas, einem der stärksten Stürme der letzten Jahre. Und während das Land, und allen voran die Bahn, noch mit den Aufräumarbeiten beschäftigt sind, schauen wir uns auf einer Karte an, was eigentlich an diesen beiden Tagen los war: Mit Hilfe zweier CSV-Tabellen, heruntergeladen von der Homepage des Deutschen Wetterdienstes, ist recht fix eine Webmap auf ArcGIS Online erstellt. Jede Tabelle ergibt einen Layer für jeden der beiden Tage. Beide Kartenlayer wurden anschließend als Hosted Feature Service veröffentlicht und öffentlich freigegeben. Die Services können nun von überall konsumiert werden, und mit Hilfe der neuen Features in der ArcGIS API for JavaScript generiert die kleine Applikation "Sturm Niklas über Deutschland" schöne Ansichten des Wetters, das an den Messstationen ankam. Im Wesentlichen kommt dabei das neue "Smart Mapping"-Modul zum Einsatz, also "clevere Kartografie". Unter diesem Zauberwort wird es sowohl Neulingen als auch erfahrenen Nutzern einfach gemacht, nützliche und eindrucksvolle Karten zu gestalten: Das Modul hält eine Reihe von vorkonfigurierten Renderern bereit, die einfach auf Attribute angewendet werden können und Features nach Farbe, Größe oder Lage klassifizieren. Zunächst im März-Release von ArcGIS Online eingeführt, unterstützt die JS API seit Version 3.13 die neuen Möglichkeiten. Als weiteres Goodie wurde das neue "Search Widget" eingebaut, in dem nicht nur ein Locator Service, sondern auch ein einfacher beliebiger Feature Service durchsucht werden kann. Im Falle der "Sturm Niklas"-Applikation durchsuchen wir einfach das Feld mit den Namen der Wetterstationen in einem unserer beiden Feature Layer. Und was tut die Applikation, was ArcGIS Online nicht kann? Wie üblich hat man als Entwickler weiterführende Möglichkeiten als über die GUI. In diesem Fall werden die vordefinierten Smart-Mapping-Renderer im Code abgefangen und abhängig von den Daten geändert. Damit profitiert man weiterhin von den Voreinstellungen wie automatischen Class Breaks oder einer Color Range, kann aber einzelne Eigenschaften anpassen. Das Rendering passiert hierbei im Client, was sich bei großen Datenmengen natürlich performancemindernd auswirken kann. Bei solch einfachen Tabellen und zwei übereinandergelegten Layern ist die Anzeigegeschwindigkeit jedoch im Rahmen. Rendering in der Applikation Über ein Menü kann zwischen unterschiedlichen Wetterdaten umgeschaltet werden. Dabei wird nicht etwa ein Layer ein- oder ausgeblendet, sondern die Renderer für die beiden Tageslayer neu definiert. Die Menüauswahl definiert einfach nur ein neues Attributfeld, und über diverse Fallunterscheidungen werden die Einstellungen der Renderer gesetzt. Hier ein kurzer Ausschnitt, in dem deutlich wird, wie nach Feld- (Zeilen 2-6) oder Layernamen (Zeile 15) unterschieden wird und wie in bestimmten Fällen den Symbolen des smarten ClassBreakRenderers eine andere Farbe zugewiesen wird: else if (
field === "RR24" ||
field === "FX" ||
field === "SSS24" ||
field === "SGLB24" ||
field === "Höhe") {
//Hier beginnt das Smart Mapping
smartMapping.createClassedSizeRenderer({
layer: renderLayer,
field: field,
basemap: map.getBasemap(),
classificationMethod: "quantile"
}).then(function (response) {
// Folgetag in grau darstellen
if (renderLayer.name==="DWD_20150401" || field === "Höhe") {
array.forEach(response.renderer.infos, function (f) {
f.symbol.color = new Color.fromHex("#CCCCCC");
});
}
else {
// am 31.3. Unterscheidung nach Daten
if (
field === "SSS24" ||
field === "SGLB24") {
array.forEach(response.renderer.infos, function (f) {
f.symbol.color = new Color.fromHex("#EDD873");
});
} Über diese Fallunterscheidung werden für unterschiedliche Daten unterschiedliche Farben vergeben - Regen ist beispielsweise blau, Sonne ist gelb, während alle anderen "smarten" Eingeschaften des ClassedSizeRenderers unangetastet bleiben. Die Daten des 1.4., also des Sturm-Folgetags, werden in grau angezeigt. So sieht man auf einen Blick, welche Wetterstation an welchem Tag im "Ranking" vorne lag: Mehr Farbe bedeutet, diese Station war am Sturmtag "besser". Ist der graue Kreis größer, liegt die Station im Ranking des 1.4. weiter vorne. Über eine andere Fallunterscheidung werden keine Farbwerte, aber ein Offset gesetzt. So erscheinen die Werte der beiden Tage nebeneinander auf der Karte. So lassen sich mit wenig Code und wenig Aufwand viele schöne aussagekräftige Kartenansichten generieren. Code Die Datei "sturmniklas.html" mit dem kompletten Spaghetticode (ja, es ist einfach nur ein längeres Sample - keine Applikation mit empfehlenswerter Architektur!) ist ebenfalls auf Github zu finden: esride-nik/esride-nik.github.io
... View more
04-02-2015
10:08 AM
|
7
|
0
|
4609
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-24-2025 03:06 AM | |
| 1 | 11-09-2023 02:10 AM | |
| 2 | 11-09-2023 01:47 AM | |
| 1 | 07-13-2022 01:28 AM | |
| 2 | 07-12-2022 01:23 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-28-2025
04:07 AM
|