Snapping while measuring
Hi. I'm liking the ability to snap to vertices when measuring. However, snapping doesn't seem to work on my parcel layer. I've made sure snapping is allowed and enabled. I've confirmed that snapping works using a Silverlight 2.4 viewer. It just doesn't work in HTML5 2.5 though, although other layers snap as expected.
Could it be failing due to the size/complexity of the dataset? The only thing I've noticed that's different about the taxlots service is that the AGS rest endpoint says that Supports Advanced Queries = false, although I'm not sure why that would have any effect.
Any ideas?
Chris
-
Hi Chris,
What happens when we snap to non-feature layers is we pull down a copy of the features to an invisible graphics layer. The maximum amount usually supported is 1000 features. Depending on the current scale, it can be pretty easy to max this out so only a partial area will be snappable.
Are you zoomed out fairly far while trying to snap? Could the 1000 limit be getting hit?
Thanks,
Kevinn
0 -
Hi Kevin. No, that doesn't seem to be it. I've tried several different zoom levels, but no luck so far.
BTW, the service is https://webmaps.orcity.org/arcgis/rest/services/TaxlotsDark/MapServer
Chris
0 -
Hi Chris,
The layer worked fine for me. Perhaps you can send over a site.xml for me to inspect.
Cheers,
Kevin
0 -
<?xml version="1.0" encoding="utf-8"?>
<Site xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" DisplayName="Junk" ID="Junk" Version="4.4.0">
<Map InitialExtent="7660082.02180591,623866.660703702,7667355.9781941,629751.794869804">
<MapServices>
<MapService ConnectionString="url=https://webmaps.orcity.org/arcgis/rest/services/TaxlotsDark/MapServer" DefaultAllowSymbolization="true" DisplayName="TaxlotsDark" Function="Operational" ID="0" ImpersonateWithActor="false" IncludeCopyright="false" IncludeInLayerList="true" InstantSearch="false" InstantSearchAttachments="false" IsExpanded="true" Opacity="1" OverrideTemporalSettings="false" PasswordEncrypted="false" ProviderInvariantName="Geocortex.Gis.Services.ArcGisServer.Rest" SearchNonTextFields="true" SupportedImageHeight="0" SupportedImageWidth="0" UseHttpAuthentication="false" Visible="true">
<CachedServiceData />
<Layers>
<Layer AllowSymbolization="true" CanCopyFeature="true" Identifiable="true" IncludeInLayerList="true" IncludeInLegend="true" IsCatalogLayer="false" IsExpanded="false" Name="Taxlots" NativeID="0" Queryable="true" Searchable="true" ShowFeatureHyperlinks="ShowAll" ShowLabels="true" ShowMapTips="false" Snappable="true" SnappingEnabled="true" UnconfiguredFieldsCanSymbolizeClassBreaks="true" UnconfiguredFieldsCanSymbolizeUniqueValue="true" UnconfiguredFieldsSearchable="true" UnconfiguredFieldsVisible="true" UnconfiguredRelationshipsVisible="true" Visible="true" />
</Layers>
</MapService>
</MapServices>
</Map>
<OverviewMap />
<Viewers>
<Viewer DisplayName="junk" Hidden="false" ID="junk" Path="{SitePath}\Viewers\junk" Tags="gvh gvh2.5" TemplateID="Html5Viewer_2_5" />
</Viewers>
</Site>0 -
It seems that the query endpoint for the layer is not working as expected.
I noticed the viewer console was getting 'Failed to execute query' errors when fetching snapping points. I loaded up the query endpoint, hit it manually and it seems to not be working.
-Kevin
0 -
Thanks Kevin. Since it only happens with the Html5 viewer, and the AGS rest endpoint seems to be fine, I'll submit a ticket for it.
Chris
0 -
Hi Chris,
I was able to find a specific reason why snapping fails when the Taxlots layer is added to the site. When added as a feature layer snapping works as the query is done by the product to bring all visible features into the viewer. The request to the query endpoint contains an outFields value of "*" to get all the fields as these features are meant for presentation. We get the snapping features for free in this case as the viewer already has them.
When added as a map service (as demo'd in the above si te.xml) the snapping module does the query for us and stores the visible graphics for snapping. This query lacks the outFields argument as it is designed to return the least amount of data as the geometries are all we are interested in . This is the query that fails with the ' Failed to execute query' message . I don't exactly know why it is failing and a ccording to the 10.3 (https://webmaps.orcity.org/arcgis/sdk/rest/index.html#/Query_Map_Service_Layer/02ss0000000r000000/) REST API the outFields argument appears to be optional.
I did find a workaround however. If you add the layer as a feature layer in REST Manager, it will work as the additional snapping location query is bypassed.
Hope this helps.
Kevin
0 -
Thanks for the info Kevin. I'm curious though, why do my other map services work? They are not set up as feature layers. I added our city limits service as a map service, and snapping works just fine. Here's the site.xml
<?xml version="1.0" encoding="utf-8"?>
<Site xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" DisplayName="Junk" ID="Junk" Version="4.4.0">
<Map InitialExtent="7660082.02180591,623866.660703702,7667355.9781941,629751.794869804">
<MapServices>
<MapService ConnectionString="url=https://webmaps.orcity.org/arcgis/rest/services/CityLimits/MapServer" DefaultAllowSymbolization="true" DisplayName="CityLimits" Function="Operational" ID="1" ImpersonateWithActor="false" IncludeCopyright="false" IncludeInLayerList="true" InstantSearch="false" InstantSearchAttachments="false" IsExpanded="true" Opacity="1" OverrideTemporalSettings="false" PasswordEncrypted="false" ProviderInvariantName="Geocortex.Gis.Services.ArcGisServer.Rest" SearchNonTextFields="true" SupportedImageHeight="0" SupportedImageWidth="0" UseHttpAuthentication="false" Visible="true">
<CachedServiceData />
<Layers>
<Layer CanCopyFeature="true" Identifiable="true" IncludeInLayerList="true" IncludeInLegend="true" IsCatalogLayer="false" IsExpanded="false" Name="City Limits" NativeID="0" Queryable="true" Searchable="false" ShowFeatureHyperlinks="ShowAll" ShowLabels="true" ShowMapTips="false" Snappable="true" SnappingEnabled="false" UnconfiguredFieldsCanSymbolizeClassBreaks="true" UnconfiguredFieldsCanSymbolizeUniqueValue="true" UnconfiguredFieldsSearchable="true" UnconfiguredFieldsVisible="true" UnconfiguredRelationshipsVisible="true" Visible="true" />
</Layers>
</MapService>
<MapService ConnectionString="url=https://webmaps.orcity.org/arcgis/rest/services/TaxlotsDark/MapServer" DefaultAllowSymbolization="true" DisplayName="TaxlotsDark" Function="Operational" ID="0" ImpersonateWithActor="false" IncludeCopyright="false" IncludeInLayerList="true" InstantSearch="false" InstantSearchAttachments="false" IsExpanded="true" Opacity="1" OverrideTemporalSettings="false" PasswordEncrypted="false" ProviderInvariantName="Geocortex.Gis.Services.ArcGisServer.Rest" SearchNonTextFields="true" SupportedImageHeight="0" SupportedImageWidth="0" UseHttpAuthentication="false" Visible="true">
<CachedServiceData />
<Layers>
<Layer AllowSymbolization="true" CanCopyFeature="true" Identifiable="true" IncludeInLayerList="true" IncludeInLegend="true" IsCatalogLayer="false" IsExpanded="false" Name="Taxlots" NativeID="0" Queryable="true" Searchable="true" ShowFeatureHyperlinks="ShowAll" ShowLabels="true" ShowMapTips="false" Snappable="true" SnappingEnabled="true" UnconfiguredFieldsCanSymbolizeClassBreaks="true" UnconfiguredFieldsCanSymbolizeUniqueValue="true" UnconfiguredFieldsSearchable="true" UnconfiguredFieldsVisible="true" UnconfiguredRelationshipsVisible="true" Visible="true" />
</Layers>
</MapService>
</MapServices>
</Map>
<OverviewMap />
<Viewers>
<Viewer DisplayName="junk" Hidden="false" ID="junk" Path="{SitePath}\Viewers\junk" Tags="gvh gvh2.5" TemplateID="Html5Viewer_2_5" />
<Viewer DisplayName="junkSL" Hidden="false" ID="junkSL" Path="{SitePath}\Viewers\junkSL" Tags="" TemplateID="SilverlightViewer_2_4" />
</Viewers>
</Site>BTW, it's support case 00067129.
Thanks,
Chris
0 -
Hi Chris,
The one other layer we've been able to reproduce this with has a couple of things in common with your parcel layer. My suspicion is that it's the fact that both layers' Display Field is actually not a field that's published with the layer. I can see ArcGIS needing that to be a valid field if outFields is to be omitted.
The other thing we're looking at (another similarity) is that in both cases the field names are fully qualified, which may suggest a join in the MXD.
If you can, I'd try first changing the map service so that the Display Field of your parcels layer points to a field that's published. If that still doesn't work, there may be something with MXD joins that ArcGIS Server doesn't like.
I think that in either case, GVH should send at least the OBJECTID in the outFields parameter to avoid this issue - but if you can work around it easily with the Display Field change then it could be an easy win for now.
John
0 -
Ding ding ding, John Fletcher gets the prize! I changed the display field to Objectid, which is published. Bingo, snapping now works!
Thanks for John and Kevin's help on this.
Chris
0 -
Cheers Chris, glad we could get to the bottom of that!
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
11 Kommentare