POST
|
Is it possible to display a WPF UIElement as a graphic overlay onto an Arcgis basemap?
... View more
08-03-2021
01:50 PM
|
0
|
1
|
1006
|
POST
|
@PreetiMaske Thank you for the information. I have read through the links that you provided and think im still a little confused. A simplified idea of what I'm wanting to do is that i have a map and if i were to click on that map then it would call a method and add one of those mil2525d symbols to that point of the map. To do this would I use the dictionary renderer? Cause to me it seemed that the dictionary renderer already contained the data of what symbols would be used and where they go on the map. My desktop app needs to be more dynamic. Allowing individual symbols to be displayed and removed during runtime.
... View more
07-29-2021
02:44 PM
|
0
|
1
|
4028
|
POST
|
Hello, I'm trying to learn more about style files. I'm using the mil2525d.stylx that arcgis provides. In my program, I have a method that gets called when a user right clicks and then clicks on a specific menu bar item. When that item is clicked i want to display one of the graphics from the style sheet. There are a few things that I do not understand and would appreciate any help with. The first being that I have tried but am unable to see what the style sheet looks like. Since I did not create it I do not know the entirety of its contents. I'm not sure how to open the file and view the different symbols. Secondly, since I want to display a specific graphic at a specific location I'm unsure how to access the specific symbol that I want (I'm sure this stems back to me not knowing what the file looks like). Lastly, once I access the symbol I need how do I display that to the map as a graphic. Allowing this to be repeated. Thank you in advance for all and any help.
... View more
07-28-2021
04:29 PM
|
0
|
3
|
4077
|
POST
|
I have an application that previously used GMap, therefore I used many of the gmap features. One of those features that i used was GMapMarker. This marker has a shape property and I was able to create my own class that pulled a svg file from and would give the marker a few other properties, then it displayed this marker on the map. I'm now trying to convert over to arcgis and am having a hard time converting this part. 1. Is there a way to display a svg file onto a map? It seems that arcgis has a limited amount of symbolmarkers tha can be used. 2. I know this is most likely not possible, but is there a way to keep the gmapmarker and display it onto the map? I'm sure it would have to be a work around not using a graphics overlay.
... View more
07-22-2021
04:35 PM
|
0
|
1
|
1294
|
POST
|
Hello, I have been working with various ways to Export map tiles from a base map. I have used the Export Tile Cache Example that is provided and as well I have used the Tile Package Kreator by Esri Labs. The Tile Package Kreator is a great and simple utility to use. However, most of these Export options have a limitation on the size of file that can be created/exported (1GB, for Kreator). That is fine until one also needs a high zoom availability... I have not used ArcGIS Pro, but is there any way to Export a map without the size limitations? I understand that the file can be quite large. Just need to know if it is doable.
... View more
07-07-2021
01:18 PM
|
0
|
1
|
1660
|
POST
|
@JayantaPoddar That is what I assumed. Is it possible to install previous versions of ArcGIS, say V.100.7? I saw that if you link your account with your organization than it will allow you to install previous versions. However, I'm not with any organization and just need access to version 100.7
... View more
07-06-2021
02:36 PM
|
0
|
3
|
1877
|
POST
|
Hello, I have a project I am trying to run with Qt 5.12.8 and I have ArcGIS for Qt 100.11 installed. When I try to run my project I get the message " plugin cannot be loaded for module "Esri.ArcGISRuntime": The plugin 'C:/Program Files (x86)/ArcGIS SDKs/Qt100.11/sdk/windows/x64/qml/Esri/ArcGISRuntime/ArcGISRuntimePlugind.dll' uses incompatible Qt library. (5.15.0) [debug] " I'm not quite sure why the plugin is using version 5.15 or how to change it. Is it that ArcGIS for Qt V.100.11 requires at least V.5.15 for Qt?
... View more
07-06-2021
01:55 PM
|
0
|
5
|
1913
|
POST
|
@LukeSmallwood So I'm occasionally getting an error with my ExportVectorTiles. Depending one where I try to export from I will get an error like this... namespace ArcGISRuntime.WPF.Samples.ExportTiles
{
public partial class ExportTiles
{
// URL to the service tiles will be exported from.
private Uri _serviceUri = new Uri("https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_Export_v2/VectorTileServer");
public ExportTiles()
{
InitializeComponent();
// Call a function to set up the map.
Initialize();
}
private async void Initialize()
{
try
{
// Create the tile layer.
ArcGISVectorTiledLayer myLayer = new ArcGISVectorTiledLayer(_serviceUri);
// Load the layer.
await myLayer.LoadAsync();
// Create the basemap with the layer.
Map myMap = new Map(new Basemap(myLayer))
{
// Set the min and max scale - export task fails if the scale is too big or small.
MaxScale = 5000000,
MinScale = 10000000
};
// Assign the map to the mapview.
MyMapView.Map = myMap;
// Create a new symbol for the extent graphic.
// This is the red box that visualizes the extent for which tiles will be exported.
SimpleLineSymbol myExtentSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Red, 2);
// Create graphics overlay for the extent graphic and apply a renderer.
GraphicsOverlay extentOverlay = new GraphicsOverlay
{
Renderer = new SimpleRenderer(myExtentSymbol)
};
// Add the overlay to the view.
MyMapView.GraphicsOverlays.Add(extentOverlay);
// Subscribe to changes in the mapview's viewpoint so the preview box can be kept in position.
MyMapView.ViewpointChanged += MyMapView_ViewpointChanged;
// Update the graphic - needed in case the user decides not to interact before pressing the button.
UpdateMapExtentGraphic();
// Enable the export button.
MyExportButton.IsEnabled = true;
// Set viewpoint of the map.
MyMapView.SetViewpoint(new Viewpoint(-4.853791, 140.983598, myMap.MinScale));
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void MyMapView_ViewpointChanged(object sender, EventArgs e)
{
UpdateMapExtentGraphic();
}
private void UpdateMapExtentGraphic()
{
// Return if mapview is null.
if (MyMapView == null) { return; }
// Get the new viewpoint.
Viewpoint myViewPoint = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry);
// Return if viewpoint is null.
if (myViewPoint == null) { return; }
// Get the updated extent for the new viewpoint.
Envelope extent = myViewPoint.TargetGeometry as Envelope;
// Return if extent is null.
if (extent == null) { return; }
// Create an envelope that is a bit smaller than the extent.
EnvelopeBuilder envelopeBldr = new EnvelopeBuilder(extent);
envelopeBldr.Expand(0.80);
// Get the (only) graphics overlay in the map view.
GraphicsOverlay extentOverlay = MyMapView.GraphicsOverlays.FirstOrDefault();
// Return if the extent overlay is null.
if (extentOverlay == null) { return; }
// Get the extent graphic.
Graphic extentGraphic = extentOverlay.Graphics.FirstOrDefault();
// Create the extent graphic and add it to the overlay if it doesn't exist.
if (extentGraphic == null)
{
extentGraphic = new Graphic(envelopeBldr.ToGeometry());
extentOverlay.Graphics.Add(extentGraphic);
}
else
{
// Otherwise, simply update the graphic's geometry.
extentGraphic.Geometry = envelopeBldr.ToGeometry();
}
}
private async Task StartExport()
{
// Get the (only) graphics overlay in the map view.
GraphicsOverlay extentOverlay = MyMapView.GraphicsOverlays.First();
// Get the area selection graphic's extent.
Graphic extentGraphic = extentOverlay.Graphics.First();
// Create the task.
ExportVectorTilesTask exportTask = await ExportVectorTilesTask.CreateAsync(_serviceUri);
ExportVectorTilesParameters parameters = await exportTask.CreateDefaultExportVectorTilesParametersAsync(extentGraphic.Geometry, 100);
// Get the tile cache path.
string tilePath = Path.Combine(Environment.ExpandEnvironmentVariables("%TEMP%"), Path.GetTempFileName() + ".vtpk");
//string tilePath = Path.Combine("C:/Development/Map_Tiles", fileName.Text + ".vtpk");
// Create the export job.
ExportVectorTilesJob job = exportTask.ExportVectorTiles(parameters, tilePath);
// Start the export job.
job.Start();
// Wait for the job to complete.
ExportVectorTilesResult resultTileCache = await job.GetResultAsync();
// Do the rest of the work.
await HandleExportCompleted(job, resultTileCache);
}
private async Task HandleExportCompleted(ExportVectorTilesJob job, ExportVectorTilesResult cache)
{
if (job.Status == Esri.ArcGISRuntime.Tasks.JobStatus.Succeeded)
{
// Show the exported tiles on the preview map.
await UpdatePreviewMap(cache);
// Show the preview window.
MyPreviewMapView.Visibility = Visibility.Visible;
// Show the 'close preview' button.
MyClosePreviewButton.Visibility = Visibility.Visible;
// Hide the 'export tiles' button.
MyExportButton.Visibility = Visibility.Collapsed;
// Hide the progress bar.
MyProgressBar.Visibility = Visibility.Collapsed;
}
else if (job.Status == Esri.ArcGISRuntime.Tasks.JobStatus.Failed)
{
// Notify the user.
MessageBox.Show("Job failed");
// Hide the progress bar.
MyProgressBar.Visibility = Visibility.Collapsed;
}
}
private async Task UpdatePreviewMap(ExportVectorTilesResult cache)
{
VectorTileCache vc = cache.VectorTileCache;
// Load the cache.
await vc.LoadAsync();
// Create a tile layer from the tile cache.
ArcGISVectorTiledLayer myLayer = new ArcGISVectorTiledLayer(vc);
// Show the layer in a new map.
MyPreviewMapView.Map = new Map(new Basemap(myLayer));
}
private async void MyExportButton_Click(object sender, RoutedEventArgs e)
{
try
{
// Show the progress bar.
MyProgressBar.Visibility = Visibility.Visible;
// Hide the preview window.
MyPreviewMapView.Visibility = Visibility.Collapsed;
// Hide the 'close preview' button.
MyClosePreviewButton.Visibility = Visibility.Collapsed;
// Show the 'export tiles' button.
MyExportButton.Visibility = Visibility.Visible;
// Disable the 'export tiles' button.
MyExportButton.IsEnabled = false;
// Start the export.
await StartExport();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void ClosePreview_Click(object sender, RoutedEventArgs e)
{
// Hide the preview map.
MyPreviewMapView.Visibility = Visibility.Collapsed;
// Hide the close preview button.
MyClosePreviewButton.Visibility = Visibility.Collapsed;
// Show the 'export tiles' button.
MyExportButton.Visibility = Visibility.Visible;
// Re-enable the export button.
MyExportButton.IsEnabled = true;
}
}
}
... View more
07-02-2021
01:19 PM
|
0
|
1
|
12060
|
POST
|
@LukeSmallwood okay that makes a lot more sense. Thanks for all of your explanations. I know it is probably very similar, but is there an example provided for using the ExportVectorTiles?
... View more
07-01-2021
03:52 PM
|
0
|
3
|
12075
|
POST
|
@LukeSmallwood I used that sample you shared a link to for ExportTileCache. It uses the default World_Street_Map and contains a link to it. I have tread looking around and different URL's, but I'm not sure hw to export different maps (like world topographic). The AGOL link shows me a bunch of different maps available for export but I'm not sure where to go/what URL to use for those maps in the program in order to export them.
... View more
07-01-2021
09:22 AM
|
0
|
5
|
12083
|
POST
|
@LukeSmallwood Thanks for sharing that info. It looks like they offer a lot of ways to download a basemap for use offline, but as i have been looking around it looks like that most the time these offline maps remain on the local server. Is there a way to possibly download the basemap directly to the local file system of the computer? The AGOL group link you attached had many maps available for export but it seemed they were for export to other Esri/ArcGIS products like ArcGIS pro rather than being able to download them as a tile or raster file. Is it possible to do this?
... View more
06-29-2021
02:15 PM
|
0
|
7
|
12099
|
POST
|
In congruence to a another question I have recently posted, I'm trying to find the best way to save a map to my local system ad be able to use it in an application. I know that a tile package would offer more benefits, but all I'm needing is to save a map offline (locally) and use it in an app. Would a tile cache be sufficient or is it recommended to use tile package?
... View more
06-28-2021
11:43 AM
|
0
|
1
|
1370
|
POST
|
Hello, Is it possible to take just a base map, like the topographic map, offline? There do not need to be any other custom layers. This should eliminate having to create a full tile package hopefully. Is there any resource that has a list of downloadable base maps for offline use?
... View more
06-28-2021
11:02 AM
|
0
|
9
|
12156
|
POST
|
@JoeHershman That is what my MainWindow.xaml looks like. <Window x:Class="map_display.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:map_display"
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.Resources>
<local:MapViewModel x:Key="MapViewModel" />
</Window.Resources>
<Grid>
<esri:MapView x:Name="MainMapView"
Map="{Binding Map, Source={StaticResource MapViewModel}}"
GraphicsOverlays="{Binding GraphicsOverlays, Source={StaticResource MapViewModel}}"
MouseLeftButtonUp ="MainMapView_MouseLeftButtonUp" />
</Grid>
</Window>
... View more
06-24-2021
01:54 PM
|
0
|
0
|
5163
|
Title | Kudos | Posted |
---|---|---|
1 | 07-22-2020 03:01 PM | |
1 | 07-13-2020 10:11 AM |