POST
|
Sean, Thanks for the info. It all sounded too familiar when Rich Ruh contacted me yesterday to see if that would work. It does actually work. Now, my custom IEnumLayer implementation does work. However, my first experiments are not looking too promising the IFeatureCache2 respecting layers. It seems that it goes straight to the FeatureClass, ignoring the definition query.
... View more
11-11-2014
09:00 AM
|
0
|
2
|
693
|
POST
|
Hi, I am trying to filter an IEnumLayer to only contain visible layers. I want to pass this to IFeatureCache2.AddLayers(...). I could not find any public implementations of IEnumLayer. Since we are in C# I wrote a couple of extension methods that convert IEnumLayer to IEnumerable<ILayer> and vice-versa. But passing my custom implementation of IEnumLayer did not seem to make AddLayers(...) happy. Here is my extensions class:
public static class EnumLayerExtensions
{
public static IEnumerable<ILayer> AsEnumerable(this IEnumLayer layers)
{
layers.Reset();
var layer = layers.Next();
while (layer != null)
{
yield return layer;
layer = layers.Next();
}
}
public static IEnumLayer ToEnumLayer(this IEnumerable<ILayer> layers)
{
return new EnumLayerWrapper(layers);
}
private class EnumLayerWrapper : IEnumLayer
{
private readonly ILayer[] _layers;
private int _index;
public EnumLayerWrapper(IEnumerable<ILayer> layers)
{
_layers = layers.ToArray();
_index = 0;
}
public ILayer Next()
{
return _index < _layers.Length ? _layers[_index++] : null;
}
public void Reset()
{
_index = 0;
}
}
}
using this I can then write the following code:
var visibleLayers = Map.Layers.AsEnumerable().Where(l=>l.Visible);
var cache = new FeatureCacheClass() as IFeatureCache2;
cache.Initialize(point,radius);
cache.AddLayers(visibleLayers.ToEnumLayer(), null);
In the above code, line 04 will just run for ever as-is. If I use the layers straight from the Map, it comes back fairly fast. I have written a handful of unit tests to validate my implementation of ToEnumLayer() and they all seem to pass. Based on all this, I have a couple of questions: Is there an out of the box implementation of IEnumLayer that I can use to filter visible layers only to pass to IFeatureCache2.AddLayers()? What's wrong with my implementation of IEnumLayer? Thanks in advance for any help, Eric.
... View more
11-03-2014
06:24 PM
|
0
|
6
|
3590
|
POST
|
Erin, Thanks for the reply. From the HitTest() call, only the return value (Boolean) and distance are actually used. So, I am fairly confident that's the only information we care about. I have a feeling someone had an idea to use some of the other information for something else but never got around to doing it.
... View more
11-03-2014
03:53 PM
|
0
|
1
|
383
|
POST
|
I came across some old code in our code base that first looks if a geometry/shape implements IHitTest. If it does, it uses HitTest(...) to determine the distance between the two geometries. If it does not implement IHitTest, it uses IProximityOperator.ReturnDistance(...). Knowing that we are only interested in the distance between the two features/geometries, is there a recommendation as to which to use IHitTest or IProximityOperator ?
... View more
11-03-2014
01:35 PM
|
0
|
3
|
1878
|
POST
|
Hi, We are an ISV, building ArcGIS extensions. I recently implemented a lot of automated tests for our solution. All our tests are passing. However, some tests do fail with the following error:
System.Runtime.InteropServices.COMException : Table 'DELTA_xxxx' does not exist
Where xxxx is the name of a table in our geodatabase. Those failing tests do pass if executed one at a time. While we could just do it, we would like to make sure that the issue is just in our test environment (database, setup code, etc.) and not in our runtime code. From recent testing, that error does not seem to pop up in manual testing. It is impossible to post any code since our solution is quite large (millions of lines of code, VB6, C++ and C#). However, what I am looking for here is a pointer. We have heard that it could be related to an ICursor not COM released properly. Given the fact that those failing tests only fail if executing after another test, this seems plausible. Have others seen such issues in the past? Any idea what can be causing this? Our setup: ArcGIS Desktop 10.2.1 C# (that's where the error occurs - calling ITable.Search()) .NET 3.5 Personal GDB (Access) anything else relevant?
... View more
07-17-2014
09:24 AM
|
0
|
1
|
1852
|
POST
|
Hi, In our .NET (C#) ArcMap extension, we are successfully listening to Create/Change/Delete events on a feature class (well, a Table). However, we just realized that an Undo does not trigger the corresponding event. So basically, if a user edits a row, we get the changed information properly. But then, if they undo their change (Ctrl+Z), we don't get a second event with the appropriate record. This causes our data to be out-of-sync. What are we missing? Regards, Eric.
... View more
02-04-2014
01:47 PM
|
0
|
1
|
655
|
POST
|
Thanks for the help. I had done some more digging this weekend and came across the "Standardized Queries" thing as a good compromise. You just confirmed it. Thanks, Eric.
... View more
11-11-2013
08:31 AM
|
0
|
0
|
489
|
POST
|
Hi, We are an ISV and recently built an application that, among other things, allows you to search your features, using the simple MapServer/Query option (documented here). All we do is pass in the text parameter and let Esri do the work. It works great on SQL Server as it performs a case insensitive search of the display field (we haven't verified, but we assume this follows the SQL Server configuration of collation). However, I am at a loss to try to get it to query an Oracle backend and ignore the case of the search text. Yes, we might have to convert to using the WHERE clause instead, but as an ISV, this seems to be wrong choice as we might have to build different WHERE clauses depending on the RDBMS backend (or is UPPER('field name') LIKE UPPER('%term%') truly universal - at least SQL Server and Oracle?) So, is there a simple way to have this MapServer/Query with text be case insensitive in Oracle? I have tried setting environment variables NLS_COMP and NLS_SORT to LINGUISTIC on the ArcGIS Server (Windows) but even after a full restart, it doesn't seem to have taken them. I also tried setting NLS_COMP and NLS_SORT values in the registry key HKLM\SOFTWARE\ORACLE\KEY_OraClient11g_home1, but no luck there either. Our environments would be: ArcGIS 10.2 - Windows Oracle 11g - Windows or SQL Server 2012 and up Thanks in advance for any help.
... View more
11-08-2013
11:53 AM
|
0
|
2
|
1363
|
POST
|
Hi, We are using the out-of-the-box BasemapGallery. We are displaying both AGOL and Bing maps (we specify our own key). However, starting in the last day or so, only the AGOL basemaps are showing-up. No Bing Maps in the basemap gallery. I tried with both v3.1 and v3.2 of the JavaScript API and same result. We have not yet upgraded to v3.3 Any ideas what we missed? (our beta website had been up for a couple of weeks prior to this, without any problems). Regards, Eric.
... View more
03-22-2013
12:06 PM
|
0
|
5
|
908
|
POST
|
Rahul, Thanks for the info, but I must be missing how this would help? Is the IdentityManager used to determine if the request should be proxied? Even at 3.3, there is still no sample that uses IdentityManagerBase to show how it can/should be used. We would like to avoid having to pass the token down to the client. The example you provided for my previous post shows client-side provided credentials. Users of the app will log into the WebApp, not ArcGIS Server. Furthermore, the proxy approach allows us to leave the ArcGIS server out-of-sight and only open 1 port/IP address in the firewall. Any code sample for 3.1 or up that could get me started? Regards, Eric
... View more
03-06-2013
08:34 AM
|
0
|
0
|
204
|
POST
|
Hi, We have implemented the proxy approach to provide token-based authentication without passing tokens down to the client. This works great. However, the approach seems to have a major flaw: it requires that ALL traffic be routed to the proxy (using esri.config.defaults.io.alwaysUseProxy = true). This ends up having a pretty bad impact on the performance of tile services from ArcGIS.com (to the point where we will likely not recommend using them as it is). This seems to be a simple question, but is there a way to tell the esri client javascript which services/layers should be proxy-ed? I'd rather have a white-list vs. black-list approach for now. Thanks for the help, Eric.
... View more
03-05-2013
06:56 PM
|
0
|
2
|
703
|
POST
|
FYI, I am unable to prevent the map from rendering with the first basemap in the BasemapGallery. Even if I do not call the startup() method, a layer is added to the map and it starts loading. In the end, I ended up suspending the first layer that gets assigned to the map and then, I select the basemap I want. This seems to stop the rendering before it begins and giving a much better user experience. In the end, here is the code I have:
var basemapGallery = new esri.dijit.BasemapGallery({
showArcGISBasemaps: true,
bingMapsKey: bingKey,
map: map
}, "basemapGalleryDiv");
basemapGallery.startup();
var selectionHandler = function() {
dojo.connect(basemapGallery, "onSelectionChange", function() {
$('#basemapGalleryModal').modal('hide');
var selected = basemapGallery.getSelected();
dojo.cookie("selectedBasemapId", selected.id, { path: "/" });
});
};
var savedBaseMapId = dojo.cookie("selectedBasemapId");
if (savedBaseMapId != null) {
// we are going to changed the basemap, maybe, so prevent original drawing
var initialLayerHandler = dojo.connect(map, "onLayerAdd", function(layer) {
dojo.disconnect(initialLayerHandler);
layer.suspend();
basemapGallery.select(savedBaseMapId);
map.addLayers(layers);
});
} else {
selectionHandler();
}
... View more
03-05-2013
06:48 PM
|
0
|
0
|
187
|
POST
|
Kelly, Thanks for the Bing Maps stuff... I meant to do it and something went wrong... anyway, done now. As for your code, how is it different from what I am doing? I too am listening to the "onLoad" event and setting the basemap. Ok, I read it from a cookie using dojo, but otherwise, this seems to be the same code. Am I missing something? Is it worth mentioning that we are still using v3.1? The issue is that, from my experiments, the gallery always selects the first basemap when it loads. So, in my code, since I want to persist the basemap selection for subsequent pages, it overwrites the cookie with that first basemap. I am tempted to just "skip" the first selection. However, it will start loading the first basemap (whatever that is) and then will switch to the basemap our customer actually wants to use. IS there a way to have the gallery load but not select a basemap? Regards, Eric.
... View more
03-05-2013
10:56 AM
|
0
|
0
|
187
|
POST
|
Hi, We are building an app in which our users would like to select a particular basemap from the gallery. Our application consists of many pages showing various assets. We would like to persist the basemap for the user's current session. This seems to be pretty simple if we can store the basemap id the user last selected. This works fine using the "onSelectionChange" event of the BasemapGallery. However, we are having a terrible trying to set the basemap programmatically when the new page loads. We read the cookie properly, but we can't seem to figure out the right time to call select(id) on the BasemapGallery. It seems that the BasemapGallery always fires once with the first map selection. Yes, we can handle this, but the result is very hacky in our mind. Is there a way to specify which basemap to use after startup()? Here is our latest attempt:
dojo.require("esri.map");
dojo.require("esri.dijit.BasemapGallery");
dojo.require("dojo/cookie");
var map;
function init() {
map = new esri.Map("mapDiv", {
center: [19.461, 53.914],
zoom: 5
});
var basemapGallery = new esri.dijit.BasemapGallery({
showArcGISBasemaps: true,
bingMapsKey: 'afdafadsfdsafsdfasdfdsfdsf_afdfafdasfdsaf',
map: map
}, "basemapGallery");
basemapGallery.startup();
dojo.connect(basemapGallery, "onError", function (msg) { console.log(msg); });
dojo.connect(basemapGallery, "onLoad", function() {
var basemapId = dojo.cookie("userSelectedBaseMap");
if (basemapId != null) {
basemapGallery.select(basemapId);
}
dojo.connect(basemapGallery, "onSelectionChange", function () {
var selected = basemapGallery.getSelected();
dojo.cookie("userSelectedBaseMap", selected.id);
});
});
}
dojo.ready(init);
Is there a recommended way to achieve what we are trying to do? how about a recommendation on when to programmatically set the basemap selection? Thanks for any help, Eric
... View more
03-04-2013
07:54 PM
|
0
|
3
|
2023
|
POST
|
Rahul, Thanks for the info. Yes, I had read your post already. I guess I am still not understanding what all is happening in there (I am a .NET guy, not js). After further digging, it turns out that the best solution for our design will be to use the proxy approach. At least that's what the esri doc explicitly states. We'll see. I am working on that right now and will make sure to share what we found. Regards, Eric.
... View more
02-22-2013
03:44 AM
|
0
|
0
|
179
|
Title | Kudos | Posted |
---|---|---|
1 | 04-10-2015 09:22 AM | |
1 | 08-05-2011 07:33 AM | |
1 | 05-08-2015 12:28 PM | |
1 | 05-08-2015 12:17 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|