POST
|
Anne, Thank you for the reply. I did notice that worked, and I forgot to add that detail to my post. The JSON will be describing a point or an extent so I was hoping that Geomery.fromJSON() would be able to create a Point from point JSON and an Extent from extent JSON. Am I using Geometry.fromJSON() incorrectly?
... View more
05-11-2020
07:17 AM
|
0
|
0
|
520
|
POST
|
I am trying to use Geometry.fromJSON() in the ArcGIS JSAPI 4.x to return a Point or an Extent geometry and I am getting some unexpected results. Here is what I have tried. const point = Geometry.fromJSON({x: 10, y: 10, spatialReference: {wkid: 4326}})
const point = Geometry.fromJSON({type: "point", x: 10, y: 10, spatialReference: {wkid: 4326}})
const point = Geometry.fromJSON(JSON.stringify({x: 10, y: 10, spatialReference: {wkid: 4326}}))
const point = Geometry.fromJSON({"x": 10, "y": 10, "spatialReference": {"wkid": 4326}})
const point = Geometry.fromJSON('{"x": 10, "y": 10, "spatialReference": {"wkid": 4326}}')
...
console.log(JSON.stringify(point.toJSON())) Here is the result in the console. {"spatialReference":{"wkid":4326}} Should I be able to get a Point geometry with the JSON I am using with Geometry.fromJSON()? My goal would be to do the following... mapView.goTo(Geometry.fromJSON({....}); ...using valid JSON for a Point or an Extent.
... View more
05-07-2020
07:42 AM
|
0
|
2
|
610
|
POST
|
From what I have seen this is not a 100% solution either. I really do not understand why getMap() would not return a valid map object when called from within the load event. I have it mostly working now but I am not happy with the approach.
... View more
06-13-2017
11:43 AM
|
0
|
0
|
1106
|
POST
|
Thanks for your reply Andy. We are familiar with how to load the ArcGIS JS API for an Angular 2 project and we are familiar with most of the posts from Tom Wayson about the topic. My question is about the live-cycle of the objects in the ArcGIS JS API, specifically the Map and Layer objects.
... View more
06-13-2017
11:41 AM
|
0
|
1
|
1106
|
POST
|
Thanks for your reply. I am extending the ArcGISDynamicMapServiceLayer class so I can add several properties and objects to support a custom map contents (i.e. legend) control for our Angular 2 application. We would like to show sublayers, visibility, renderer, symbols, visible at scale for sublayers, etc.
... View more
05-26-2017
11:24 AM
|
0
|
0
|
1106
|
POST
|
I agree that this appears to be the correct way (and time) to access the map. I am adding my layer to the map before I try to call getMap(). While I was trying to understand what was going wrong I would write out the event object to the console from the load event. It would show in the debug window that _map was set but when I tried to access it with something like getMap() it was always null. That to me looks like an odd timing issue so I tired the following. export class MyDynamicMapServiceLayer extends ArcGISDynamicMapServiceLayer {
constructor(url: string, options? ArcGISDynamicMapServiceLayerOptions) {
super(url, options);
this.on('load', (event) => {
setTimeout(() => {
console.log(super.getMap());
}, 0);
});
}
} It might be strange to use a setTimeout this way, especially since the wait time is 0 milliseconds, but this appears to let the layer finish initializing and set the _map variable, which I think is what getMap() returns. Oddly enough this worked.
... View more
05-26-2017
11:22 AM
|
0
|
1
|
1106
|
POST
|
Thank you for the reply but super.getMap() also seems to return null. export class MyDynamicMapServiceLayer extends ArcGISDynamicMapServiceLayer {
constructor(url: string, options? ArcGISDynamicMapServiceLayerOptions) {
super(url, options);
this.on('load', (event) => {
console.log(super.getMap();
});
}
}
... View more
05-26-2017
10:00 AM
|
0
|
3
|
1106
|
POST
|
I am using the JavaScript SDK 3.18 and I am relatively new to the SDK. I am using Angular 2 and TypeScript and I am trying to create my own layer that extends the ArcGISDynamicMapServiceLayer and I need access to that map so I can listen to the extent-changed event. I have tried the following in my TypeScript. export class MyDynamicMapServiceLayer extends ArcGISDynamicMapServiceLayer {
constructor(url: string, options? ArcGISDynamicMapServiceLayerOptions) {
super(url, options);
this.on('load', (event) => {
//Check this.getMap() here
this.getMap();
this._map;
this['_map']
event.target.getMap();
event.layer.getMap();
});
}
} I have tried to get a reference to the map from the load event several different ways without success. What is the correct way to either get a reference to the map or to listen to the extent changed (so I can get access to the current LOD) from within a custom layer? Any suggestions would be appreciated. Thanks, -eric
... View more
05-26-2017
09:17 AM
|
0
|
10
|
2016
|
POST
|
I have an ArcGISDynamicMapServiceLayer with one DynamicLayerInfo that has its MinScale set. When I zoom the MapView to the same exact scale as the DynamicLayerInfo.MinScale I do not see the layer draw. If I zoom the MapView to a number a little smaller than the DynamicLayerInfo.MinScale then the layer draws. I have attached a sample project that contains an ArcGISDynamicMapServiceLayer with oneDynamicLayerInfo that has its MinScale set to 5,000,000. There are two buttons at the top of the Window where one button zooms to exactly 1:5,000,000 and a second button that zooms the map to 1:4,979,000. The layer will not draw unless the map scale is a little smaller that 1:5,000,000. I did a little more digging and from what I can tell the map scale that is calculated internally by the ArcGISDynamicMapServiceLayer does not seem to be accurate enough. The map scale value that is calculated by the internal/private method GetScale (I think that is what its called) is a little larger than the true MapView.Scale. Thus you have to zoom in at least that much under the DynamicMapLayerInfo.MinScale before the layer will draw. Can someone please confirm my findings and offer a solution? Thanks, -eric
... View more
12-13-2016
06:12 PM
|
0
|
0
|
1058
|
POST
|
Is it possible to define the display field for a dynamic layer? We rely on defining our dynamic layers using a table or query source like the following. { "source": { "type": "dataLayer", "dataSource" : { "type": "table", "workspaceId": "<workspace_id>", "datSourceName: "<data_source_name>" } } } Server seems to automatically set the Display Field to the first string field it finds. Is it possible to define the name of the display field when defining the dynamic layer? Thanks, -eric
... View more
10-18-2016
08:13 AM
|
0
|
0
|
626
|
POST
|
Mike, Thanks for the reply. So as it stands now there does not seem to be a way to add a halo effect when labeling a DynamicLayerInfo. Using the BorderLineColor and BackGroundColor on TextSymbol instructs ArcGIS Server to put a square background and border behind each label. This is not the halo effect. ArcGIS Server seems to be able to support both the square background and halo background for a Text Symbol but the ArcGIS Runtime for .NET does not seem to support a halo for labels. Symbol Objects (ArcGIS Server REST API) http://resources.arcgis.com/en/help/rest/apiref/symbol.html According to this page: New in 10.1 Four new properties were added - text, borderLineSize, haloColor and haloSize. When we set the BorderLineColor and BackGroundColor on TextSymbol the JSON that gets sent to the server correctly has “borderLineSize" and “borderlineColor” and a square background appears behind the labels. The TextSymbol in the ArcGIS Runtime for .NET does not have the HaloColor and HaloSize properties so there is no way the Runtime can produce JSON with “haloColor” and “haloSize” to send to ArcGIS Server. So we believe that the TextSymbol needs to have a HaloColor and HaloSize properties added so that the correct JSON can be generated for a halo background to be generated by ArcGIS Server. Now in a separate issue (not to complicate what was said above) I think there is a similar problem with the AttributeLabelClass, specifically how the TextSymbol is used to generate labels on the client. For example, when using the AttributeLabelClass with a local CSV file, if you use the BorderLineColor and BorderLineSize properties it will generate a halo effect around the labels (which we think is wrong). I believe in this scenario ArcGIS Server was not used and the layer was processed locally in the Runtime. Setting the BorderLineColor and BorderLineSize properties should produce a square background behind the labels (just like ArcGIS Server does) and thus we still need the Text Symbol to have the HaloColor and HaloSize added so the halo effect can be applied using a local CSV file and the AttributeLabelClass. Can you verify our findings? Thanks, -eric
... View more
07-11-2016
10:44 AM
|
0
|
0
|
619
|
POST
|
I am using the ArcGIS Runtime for .NET (10.2.7). Is it possible to define a halo color for a TextSymbol within a DynamicLabelingInfo that is used to display labels for a DynamicLayerInfo? There is an example found at (Label map features—ArcGIS Runtime SDK for .NET | ArcGIS for Developers ) under the "Define labels for a dynamic layer" section but it does not show how to define the halo color. This appears to work for an AttributeLabelClass but not for the DynamicLabelingInfo class? I know this is possible with the WPF Runtime thus I assume that the ArcGIS Server REST API can handle a halo color for a text label on a DynamicLayerInfo so I assume I am either missing something simple or this has not be implemented yet?
... View more
07-07-2016
12:14 PM
|
0
|
3
|
2777
|
POST
|
Recently I have noticed some odd behavior for the MapView.NavigationCompleted Event. I have the following XMAL and code-behind. <esri:MapView WrapAround=”False” NavigationCompleted=”MapView_NavigationCompleted” … /> private void MapView_NavigationCompleted(object sender, EventArgs e){ System.Diagnostics.Debug.WriteLine(“[{0}] {1}”, DateTime.Now.ToString(“hh:mm:ss.fff”),((MapView)sender).Extent.ToJson()); } When I look at the Output Window I can see that this event sometimes fires twice rapidly within less than a second. Most of the time it seems to only fire once as expected. I have seen this behavior with rolling the mouse wheel, panning, and using the shift key to zoom into a drawn envelope. The coordinates of the extent for the two that fired within half a second of each other are almost identical but actually differ at the 14th decimal place. Our Spatial Reference is WGS84. I am using these extents in a list and the extra extents are causing problems. Has anyone else seen this behavior? Does this seem like a minor bug? Thanks, -eric
... View more
02-24-2016
02:56 PM
|
0
|
1
|
1909
|
POST
|
Yes in our WPF Runtime application we did something similar. In our newer .NET Runtime application we have an AggregateEvent from Prism that handles all the Events. We have an event called AddLayerEvent that is managed by one ViewModel so anytime a layer needs to be added to the map it goes through this event. The order of the layers can be managed in this central place as they are added.
... View more
10-09-2015
10:14 AM
|
0
|
0
|
611
|
POST
|
We have a need to show several point, line, and polygon graphics layers on the map that are also visible in the legend. In the WPF API this was done with the GraphicsLayer. The issue is that we need these GraphicsLayers to always be on top of all other layers. Our application allows the user to add layers on the fly (like KML, SHP, MapServices, etc), thus after a user adds a layer we need these GraphicsLayers to be on top of the newly added layer. Now with the .NET API we were going to use the MapView.GraphicsOverlays with a GraphicsOverlay because the API will keep these layers on top of all other layers (which is perfect) but it says that these layers are not visible to the legend. Can someone offer a simple suggestion for keeping a GraphicsLayer always on top of all other layers during the lifetime of the application? As an enhancement request 1.) By default do not show a GraphicsOverlay in the legend but have a property that can be set that would allow it to be visible to the legend. 2.) (or) Add logic to the GraphicsLayer class that would keep it on top. Maybe a bool property like GraphicsLayer.IsAlwaysOnTop that is false by default. Thanks, -eric
... View more
10-07-2015
11:28 AM
|
0
|
2
|
3054
|
Title | Kudos | Posted |
---|---|---|
5 | 04-27-2010 02:55 PM | |
1 | 08-12-2015 08:06 AM | |
1 | 10-07-2015 10:54 AM | |
14 | 05-14-2010 12:59 PM | |
15 | 05-14-2010 12:59 PM |
Online Status |
Offline
|
Date Last Visited |
04-07-2021
08:13 AM
|