POST
|
Hi Leo, if you just want wo hide the intermediate waypoimt marker you can first replace their symbol with a PictureMarkerSymbol with 0 size: var symbol = new PictureMarkerSymbol({
"url":"anyPicture.png",
"height":0,
"width":0,
"type":"esriPMS"
});
var directions = new Directions({
map: map,
stopSymbol: symbol
},"dir"); But there are remaining labels. Esri API seems to add them as SVG elements. I wasn`t able to remove them yet. Maybe svg.js or d3.js are helpful here. Is this what you are looking for?
... View more
03-13-2018
11:22 AM
|
0
|
2
|
979
|
POST
|
Hi Leo, can you please describe a little bit more detailled what you need? Your description of Direction-Widgets behaviour is quiet as expected. In my understanding the stops are the waypoints. Following the sample at Directions | ArcGIS API for JavaScript 3.23 you can add stops to your route and as they are now part of your route, directions become recalculated to include them. With the addStops(stop, index?) Method you have a second parameter that allows you to define where to insert the waypoint into the existing route. If you already know all of your stops then you can also just pass them to the constructor as follows: var directions = new Directions({ stops: [ new Point(x1, y1, someSpatialReference), new Point(x2, y2, someSpatialReference)] }, 'myDirectionNodeId');
... View more
03-13-2018
01:39 AM
|
0
|
4
|
979
|
POST
|
Now I have a similar task at another part of my add-in. Again I want to create a feature layer based on an in-memory datastore. I want to add a couple of MapPoints to that in-memory datastore and my layer to update accordingly. So is it possible to create an instance of FeatureLayer on an in-memory data source? If it`s not passible: Can I create a collection/bag of MapPoints and add them as a standard Graphic Overlay at once? I have some code already but LayerFactory.Instance.CreateFeatureLayer() doesn't accept my CIMInMemoryDatasetDataConnection also I didn`t find some more detailled docs on how to use this type of connection CIMInMemoryDatasetDataConnection inMemoryDatastore = new CIMInMemoryDatasetDataConnection();
inMemoryDatastore.Dataset = "Wegpunkte";
FeatureLayer waypointLyr = LayerFactory.Instance.CreateFeatureLayer(
inMemoryDatastore,
MapView.Active.Map,
LayerPosition.AddToTop,
"Wegpunkte") as FeatureLayer;
var createWaypointsOperation = new EditOperation();
using (RowCursor shapefileCursor = shapefileData.Search(null, false))
{
while (shapefileCursor.MoveNext())
{
using (Feature feature = (Feature)shapefileCursor.Current)
{
ArcGIS.Core.Geometry.Geometry geom = feature.GetShape();
if (geomType == GeometryType.Point)
{
createWaypointsOperation.Create(waypointLyr, geom as MapPoint);
} else if (geomType == GeometryType.Polyline)
{
using (IEnumerator<MapPoint> enumPts = ((Polyline)geom).Points.GetEnumerator())
{
while (enumPts.MoveNext())
{
createWaypointsOperation.Create(waypointLyr, enumPts.Current);
}
}
}
}
}
}
... View more
03-07-2018
03:56 AM
|
0
|
0
|
921
|
POST
|
Hi, I have a new use case where I could need some help to get in the right direction. Actually I receive live data via events, measurements with coordinates and I want to add them dynamically to a map overlay. I have a separate *.lyrx file with a symbology / classification that I want to use for the overlay. So how can I realize that? Is it possible to create an overlay or map layer with an in memory data source to which I add points at runtime? Is there such a layer type and does it refresh automatically or by command? Any hints and help would be very appreciated.
... View more
03-06-2018
08:02 AM
|
0
|
1
|
1073
|
POST
|
Hello Tuba Kumbara, I think this behaviour is normal. There are natural bounds on your projection and basemap. What you can do is to set a minimum scale on your view to set a limit for the user to zoom out. You can do this in the View() object: var view = new MapView({
container: "viewDiv",
spatialReference: { wkid: 31463 },
map: map,
zoom: 8,
constraints: {
minScale: 100000
}
});
... View more
02-25-2018
11:19 PM
|
0
|
2
|
644
|
POST
|
Hello sean_jones-esristaff, I would like to reactivate that topic. In the meantime we migrated to 2.1. The overall behaviour of the App and Add-In is faster than before but the writing process into FGDB still seems to be a little bit slow. Is there any new pattern in version 2.1 how we can do this?
... View more
02-23-2018
02:59 AM
|
0
|
1
|
2274
|
POST
|
Thank you very much for your help. So I got rid of this flickering buttons. I`m still not 100% sure how the app will behave when I click the button while app is in busy state but we will see.
... View more
02-12-2018
06:05 AM
|
0
|
0
|
1536
|
POST
|
Thank you for your ideas. Steve Van Esch You`re right, the effect occurs in the last part of my process in HandleNewGPSValuesReceivedEvent(). Inside QueuedTask.Run I 1. Create a mapPoint and add it as overlay to show GPS position var mapPoint = MapPointBuilder.CreateMapPoint(e.GPSData.GPGGA.Longitude, e.GPSData.GPGGA.Latitude, _wgs84);
MapView.Active.AddOverlay(mapPoint, _gpsPositionSymbol); 2. Conditionally shift map extent if the GPS position moves out if (MapView.Active.Extent.XMax - mapPoint.X <= 0.003 || mapPoint.X - MapView.Active.Extent.XMin <= 0.003
|| mapPoint.Y - MapView.Active.Extent.YMin <= 0.003 || MapView.Active.Extent.YMax - mapPoint.Y <= 0.003)
{
newMapExtent = mapPoint.Extent.Expand(0.01, 0.01, false);
MapView.Active.ZoomToAsync(newMapExtent);
} I commented this code out and the disabling disappeared. So I`m glad it`s not because of my GpsReader Stuff. Anyway these actions are needed. I need to show an updated position on the map without blocking. Of course I can set these conditions to the AddIn ribbon button to make it always active but will it have a negative impact? What if someone would click it exact at the same time my ArcObject code is running? Additionally I also have UI button elements on my DockingPane. These UI-Elements are not part of my Config.daml? I just added them to my GpsPanel.xaml so they are basic WPF but they are also affected which is more complicate because my user should be able to start/stop GPS-Reading no matter if worker thread is adding 1 or 2 last points. How can I prevent these buttons or other elements on my pane from being disbaled?
... View more
02-09-2018
12:48 AM
|
0
|
2
|
1536
|
POST
|
Hi Everybody, I`ve a new question regarding a new Add-In I`m writing. It`s still for ArcGIS Pro 1.4 and SDK version 1.3.0.5861 because it extents another system on that state. Basically it monitors a local GPS device via serial port and shows the data in different ways. Everything works as desired at the moment but I`m experiencing the behaviour that my ArcGIS Pro buttons from time to time grey out /disable for a short moment. I know this may have something to do that my UI-thread is blocked somehow but I can`t imagine the reason. Because my Add-In has already some code in it I decided to attach the complete project as attachment. It will not run as stand-alone because it expects another add-in to be present but maybe the full code will be helpful. Additionally I`ll try to explain what I`m doing in simplified pseudo code here: protected GpsPanelViewModel()
{
_gpsReader = new GPSReader();
_gpsReader.RaiseGpsValuesReceivedEvent += HandleNewGPSValuesReceivedEvent;
}
private async void HandleNewGPSValuesReceivedEvent(object sender, GpsValueReceivedEventArgs e)
{
var disposable = await QueuedTask.Run(() =>
{
// Do something with received GPS-Data
// Add map point and update view model parameters for UI update
}
}
public void DoSomethingWhenGPSButtonIsClicked(object obj)
{
if (_gpsIsActive == false)
{
_gpsReader.StartReading();
}
else
{
_gpsReader.StopReading();
}
}
public class GPSReader
{
private Thread _readGpsThread;
private Thread _parseGpsThread;
private System.Threading.Timer _timerReader;
private System.Threading.Timer _timerParser;
private BlockingCollection<GpsRawData> _gpsDataBuffer;
}
public void StartReading()
{
_readGpsThread = new Thread(StartGpsReaderLoop);
_parseGpsThread = new Thread(StartGpsParserLoop);
_readGpsThread.Start();
_parseGpsThread.Start();
}
public void StopReading()
{
ClosePort();
_timerReader.Change(Timeout.Infinite, Timeout.Infinite);
_timerParser.Change(Timeout.Infinite, Timeout.Infinite);
_readGpsThread.Abort();
_parseGpsThread.Abort();
}
private void StartGpsReaderLoop()
{
_timerReader = new System.Threading.Timer((e) =>
{
GetData(); // GET data from GPS and store in _gpsDataBuffer
}, null, 0, 1000);
}
private void StartGpsParserLoop()
{
_timerParser = new System.Threading.Timer((e) =>
{
ParseData(); // Get raw data from _gpsDataBuffer and raise event when finished
}, null, 0, 500);
} The main question for me is, where does the probem occur? Is it because I`m running two additional threads in my GPS-Reader? Any help would be very appreciated. Best regards Richard
... View more
02-08-2018
02:53 AM
|
0
|
5
|
1724
|
POST
|
Hi Steve, thank you for the quick answer! It solved my problem.
... View more
01-23-2018
01:59 AM
|
0
|
0
|
1617
|
POST
|
Hi, we want to create an add-in that extends another add-in. To be precise we want to add a new button to an existing group defined in the first add-in. We still use SDK 1.3 and ArcGIS Pro 1.4 and don`t want to migrate at the moment. I found documentation for version 2+ so I`m not sure if this can be applied to our tool. Our first Add-Ins Config.daml: <modules>
<insertModule id="ArcGIS_Pro_AddIn_MaxHonsell_II_Module" className="Module1" autoLoad="false" caption="Module1">
<groups>
<group id="ArcGIS_Pro_AddIn_MaxHonsell_II_Group1" caption="Messschiff" appearsOnAddInTab="true">
<!-- host controls within groups -->
<button refID="ArcGIS_Pro_AddIn_MaxHonsell_II_MainPanel_ShowButton" size="large" />
</group>
</groups>
<controls>
<!-- add your controls here -->
<button id="ArcGIS_Pro_AddIn_MaxHonsell_II_MainPanel_ShowButton" caption="Hauptmodul" className="MainPanel_ShowButton" loadOnClick="true" smallImage="Images\MaxHonsell32.png" largeImage="Images\MaxHonsell64.png">
<tooltip heading="Starte Basis Add-In">Öffnet bei Klick das Steuerfenster des Max Honsell Basis Add-Ins<disabledText /></tooltip>
</button>
</controls>
<dockPanes>
<dockPane id="ArcGIS_Pro_AddIn_MaxHonsell_II_MainPanel" caption="Max Honsell Add-In" className="MainPanelViewModel" dock="group" dockWith="esri_core_contentsDockPane">
<content className="MainPanelView" />
</dockPane>
</dockPanes>
</insertModule>
</modules> And our second Add-In Config.daml: <modules>
<insertModule id="ArcGIS_Pro_AddIn_MaxHonsell_GPS_Module" className="GpsModule" autoLoad="false" caption="GPS Modul">
<controls>
<button id="ArcGIS_Pro_AddIn_MaxHonsell_GPS_ShowGpsPanelButton" caption="ShowGpsPanelButton" className="ShowGpsPanelButton" loadOnClick="true" smallImage="Images\MaxHonsellGps32.png" largeImage="Images\MaxHonsellGps64.png">
<tooltip heading="Starte GPS Add-In">
Öffnet bei Klick das Steuerfenster des Max Honsell GPS Add-Ins<disabledText />
</tooltip>
</button>
</controls>
</insertModule>
<updateModule refID="ArcGIS_Pro_AddIn_MaxHonsell_II_Module">
<groups>
<updateGroup refID="ArcGIS_Pro_AddIn_MaxHonsell_II_Group1">
<insertButton refID="ArcGIS_Pro_AddIn_MaxHonsell_GPS_ShowGpsPanelButton" insert="after" placeWith="ArcGIS_Pro_AddIn_MaxHonsell_II_MainPanel_ShowButton" size="large" />
</updateGroup>
</groups>
</updateModule>
</modules> Am I missing something? Any help would be very appreciated! Richard
... View more
01-22-2018
07:22 AM
|
1
|
2
|
1869
|
POST
|
Hi Bengi Geoca, the above mentioned answer should work fine. Just as an alternative if you don`t want to generate further web requests or you`re looking on a more client side solution then please have a look at this code: require([
"esri/map",
"esri/SpatialReference",
"esri/graphic",
"esri/layers/GraphicsLayer",
"esri/geometry/Point",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/geometry/webMercatorUtils",
"esri/geometry/geometryEngine",
"dojo/domReady!"
],
function(
Map,
SpatialReference,
Graphic,
GraphicsLayer,
Point,
SimpleMarkerSymbol,
SimpleFillSymbol,
WebMercatorUtils,
GeometryEngine
) {
var map = new Map("map", {
basemap: "streets",
center: [-122.4, 37.785],
zoom: 14
});
map.on("click", function(evt) {
var distances = [];
var graphicsLayer = this.getLayer('graphicsLayer1');
var highlightSymbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([255,0,0]));
for (var i = 0; i < graphicsLayer.graphics.length; i++) {
distances.push({
index: i,
distance: GeometryEngine.distance(
evt.mapPoint,
WebMercatorUtils.geographicToWebMercator(graphicsLayer.graphics[i].geometry),
"meters")
});
}
var sortedDistances = distances.sort(function(a, b) {
return a.distance - b.distance; });
graphicsLayer.graphics[sortedDistances[0].index].setSymbol(highlightSymbol);
});
var graphicsLayer = new GraphicsLayer();
var Symbol = new SimpleMarkerSymbol();
graphicsLayer.add(new Graphic(new Point(-122.4, 37.777, new SpatialReference({ wkid: 4326 })), Symbol));
graphicsLayer.add(new Graphic(new Point(-122.4, 37.785, new SpatialReference({ wkid: 4326 })), Symbol));
graphicsLayer.add(new Graphic(new Point(-122.39,37.785, new SpatialReference({ wkid: 4326 })), Symbol));
graphicsLayer.add(new Graphic(new Point(-122.41,37.785, new SpatialReference({ wkid: 4326 })), Symbol));
graphicsLayer.add(new Graphic(new Point(-122.4, 37.793, new SpatialReference({ wkid: 4326 })), Symbol));
map.addLayer(graphicsLayer);
});
... View more
09-29-2017
02:26 AM
|
1
|
0
|
1221
|
POST
|
Hello Thomas Solow, thank you again for your help. I`m following your recommendation. Now I 1. add the working not exaggerated ElevationLayer with an event handler added elevLayer.on("layerview-create", function(event){
tileInfo = event.target.tileInfo;
var secondElevLyr = new ExaggeratedElevationLayer();
map.ground.layers.add(secondElevLyr);
}.bind(this)); I`m storing the tileInfo in a global variable cause I don`t know any other way to get in into the constructor load function. Not beautiful but it works for now. 2. In the load function of my second elevation layer I set the tileInfo as you suggested load: function() {
const customSR = new SpatialReference({ wkid: 31463 });
this._elevation = new ElevationLayer({
spatialReference: customSR,
url: "http://rips-rasterdaten.lubw.bwl.de/arcgis/rest/services/Imageservices/DGM025_cache_3D/ImageServer"
});
this.spatialReference = customSR;
this.tileInfo = tileInfo;
this._elevation.tileInfo = tileInfo;
this.addResolvingPromise(this._elevation.load());
} Now in Chrome Dev Tools beside some other errors I get another strange message. It tells me that the root scale leve of our tiling scheme which is 1:2.048.000 is to large for layers extent oO. Sure my SceneView is clipped but I expect the layer to choose the appropriate tile level !? Furthermore it suggests me an even bigger root scale of 1:600.000.000 which makes even less sense to me. So is there something wrong with our tiling scheme? It`s our common tiling scheme and we use it for all services of our environmental agency. It`s the same like in the base layer which should be public and visible to you.
... View more
09-29-2017
12:56 AM
|
0
|
1
|
1943
|
POST
|
I`ve a question regarding using Custom Elevation Layers with exaggeration in local scenes. I`m generally following the following Esri example: Custom ElevationLayer - Exaggerating elevation | ArcGIS API for JavaScript 4.4 I`ve a working scene with an elevation layer and the elevation layer and scene seems to work fine. Check out the code on Plunker If I try to replace the not exaggerated elevation layer 'elevLayer' with the exaggerated one 'secondElevLyr', then I get an error: I`m not totally sure if our elevation service is already visible to the internet but maybe someone has a few hints for me how to check the tiling scheme mismatch? TSolow-esristaff, do you maybe have an idea? You already helped me with a previous problem
... View more
09-27-2017
01:57 AM
|
0
|
4
|
2548
|
POST
|
Hello Thomas, thank you very much for your examples and effort. Your solution worked perfectly for me. I had to make a slight change because it seems to triangulate the side polygons to the lower corner which in case of a relatively flat block results in some artifacts on top. So I wrote the triangles on my own as rings inside the sidePolygon. Using your code I add a second loop over the topRing vertices and add two triangles for each pair to fill the space to the bottom. The result looks as follows: Thank you very much for your help. I'll close the question and mark your answer as solution . I'll publish a new question related to the example. Maybe you can help me there again.
... View more
09-12-2017
06:26 AM
|
0
|
1
|
1758
|
Title | Kudos | Posted |
---|---|---|
1 | 01-23-2020 06:28 AM | |
1 | 06-04-2018 11:48 PM | |
1 | 06-04-2018 06:16 AM | |
2 | 10-29-2021 01:41 AM | |
1 | 01-22-2018 07:22 AM |
Online Status |
Offline
|
Date Last Visited |
08-15-2022
08:13 AM
|