|
POST
|
I'm having the exact same problem. I have a custom GraphicsLayer where I need to transform the geometry of the Graphic objects to the same srs as the map. Creating a constructor or other ways of accessing the extent/spatialReference of the map for the layer is not really a preferred way of doing this. As the Map property of Layer is internal, I do not have access to it. There are a lot of classes and properties that are internal, which makes it hard to find workarounds. Any suggestions for getting the GraphicsLayer to display the features at the correct location? Bjørnar
... View more
11-25-2010
09:23 AM
|
0
|
0
|
1083
|
|
POST
|
Not really. I'm not sure how to get that approach working with FeatureLayer (get the features), as this layer already has the required functionality for everything else I currently need. I would like to use the same layers and leave the client code unchanged if the customer gets an ArcGIS server. Only change the url.
... View more
11-09-2010
02:03 AM
|
0
|
0
|
269
|
|
POST
|
Hi Have you considered exposing the reader and writer classes as public? I've been tinkering with simulating a REST service so I can use FeatureLayer to get features from MXD documents where ArcGIS server is not available. Writing code to read and write json from and to the ESRI.ArcGIS.Client classes used by the featurelayer is quite time consuming. Considering the WPF Api already do the job, it would be nice to be able to use the classes.
... View more
11-06-2010
11:38 AM
|
0
|
2
|
602
|
|
POST
|
Sorry for the duplicate of previous thread. I can't edit the original post to contain more up to date details (the information seems to drown in the original post for new readers). I use IMapDocument and its ActiveView.Output to export a bitmap from an MXD documen to a bitmap. This works just fine with an MXD with local data. However, when exporting from an MXD with a WMS or ArcGIS Server Map Service layer, the layer is not exported to the hdc. When exporting the WMS or AGS MS layer, a PNG for the requested area is created in the temp folder for my user (with the correct content). The output method fails in other words to draw that layer onto the hdc passed into the Output method. I am able to work around the issue with Mas Server layer by setting the output type to MIME instead of MIME + URL, however, the same thing can't be done with the WMS service as it is not ours. Why is the Output method not rendering the WMS and ArcGIS Map layers to the hdc when it is obviously retrieving the image and should be able to do so? And how can I fix this? Here is the code used for exporting the map (ArcGIS Engine 9.3.1):
private void Export(IEnvelope extent)
{
_mapDocument= new MapDocument();
//...
_mapDocument.Open("path", null);
// ..
_mapDocument.ActiveView.Extent = extent;
var image = GetImageFromJpegExporter(rect, null);
// ...
}
private Bitmap GetImageFromJpegExporter(tagRECT rect, CancelTracker trackCancel) {
string filename = Guid.NewGuid().ToString();
try
{
tagRECT exportRECT = _mapDocument.ActiveView.ExportFrame;
//Create a new envelope object and populate it with the values from exportRECT.
// We need to do this because the exporter object requires an envelope object
// instead of a tagRECT structure.
IEnvelope pPixelBoundsEnv = new EnvelopeClass();
pPixelBoundsEnv.PutCoords(exportRECT.left, exportRECT.top, exportRECT.right, exportRECT.bottom);
IExport export = new ExportPNGClass
{
Resolution = 96,
ExportFileName = filename,
PixelBounds = pPixelBoundsEnv
};
int hwnd = export.StartExporting();
_mapDocument.ActiveView.Output(hwnd, 96, ref rect, _mapDocument.ActiveView.Extent, trackCancel);
export.FinishExporting();
export.Cleanup();
Bitmap fromFileBitmap = new Bitmap(filename);
// Copy fromFileBitmap because it keeps a lock on the file
Bitmap returnBitmap = new Bitmap(fromFileBitmap);
fromFileBitmap.Dispose();
return returnBitmap;
}
finally
{
if(File.Exists(filename))
{
try
{
File.Delete(filename);
}
catch (Exception)
{
}
}
}
}
Regards, Bjørnar Sundsbø
... View more
11-01-2010
01:21 AM
|
0
|
0
|
1984
|
|
POST
|
I just noticed something interesting; when having an MXD with a reference to a WMS layer, the export operation returns an empty image. However, a PNG for the requested area is created in the temp folder for my user. The output method fails in other words to draw that layer onto the hdc passed into the Output method. The case is the same with the ArcGIS Map Server request where I get an empty image the first time I export an image, and get it the next time. This was, as described in an earlier post, resolved by changing from MIME + URL to MIME for output type for the service. This temp file is also created when output is MIME only. Why is the Output method not rendering the WMS and ArcGIS Map layers to the hdc when it is obviously retrieving the image and should be able to do so? Bjørnar
... View more
10-27-2010
04:27 AM
|
0
|
0
|
481
|
|
POST
|
That would be great. One possible downside might be "heavy" objects as they would derive from FrameworkElement instead of DependencyObject. My initial reason for wanting this, in addition to "doing it the WPF way", was that I could have a wrapper class inheriting from Graphic, and have a dependencyproperty containing my ViewModel. I could then use style triggers to change the appearance. Of course, I would then have to create additional objects to get this working. Any plans for better support for MVVM patterns?
... View more
10-21-2010
10:14 AM
|
0
|
0
|
481
|
|
POST
|
So far I haven't found anything, though I've just started looking into rotation. The reason I asked was just to style items the same way as I'm used to with other WPF components.
... View more
10-21-2010
09:44 AM
|
0
|
0
|
481
|
|
POST
|
No issues with proxy. I checked the virtual path setup, and tested it. So did Toni, so it seems to be working as it should. I think the WMS issue is the most pressing matter at the moment.
... View more
10-21-2010
03:06 AM
|
0
|
0
|
481
|
|
POST
|
Thanks, Ottar. Any luck/time finding out what is really going on, and why it doesn't work when using MIME + URL? Also, we have pretty much the same problem when using a WMS layer in the mxd used by the client. We get the map image, but WMS layer is absent from the image. Bjørnar
... View more
10-21-2010
01:20 AM
|
0
|
0
|
481
|
|
POST
|
Thanks. It's pretty much where I'm headed. Though I do not have ArcGIS server for most of my customers, and the features to display are not there for users who do, I've started to implement my own REST FeatureService to return the data. This seems ideal as then I do not have to maintain ViewModel to feature data integrity, and can just transform the data directly to information the featurelayer can handle (and hope updates to existing features is handeled, not just removing everything, and forgetting the previous state/selection). My concern is updating the features, and selection. I was thinking of using TimeExtent, and hope I can use it to update the features every second, or whatever is required. I will not have historic data, and it will be real-time (within the configured time delay). And if I can update the features every second, will selection in the map be maintained when an existing object gets a different position or symbol?
... View more
10-19-2010
11:01 AM
|
0
|
0
|
1183
|
|
POST
|
I have an application where I will display dynamic features moving in the map. There might be quite many of them for an area ( <2000, I think). They should move when their position is update. I'm wondering if I should create my own "fake" FeatureService to return the features, or if I should use GraphicsLayer for displaying them. Any reccomendations? Bjørnar Sundsbø
... View more
10-18-2010
12:55 PM
|
0
|
11
|
1989
|
|
POST
|
Hi I would very much like to be able to style a Graphic in XAML, but since alot of the properties are not DependencyProperties (and Graphic is not a FrameworkElement), I am unable to affect these changes, and the style is useless. I want to be able to style it and use templates/triggers to be able to change appearance of the graphic based on changes to the object being displayed as I would any other WPF control. Also support for binding attributes, such as rotation and other details. I suppose IRenderer is the interface to use here, but a renderer able to get symbols and geometries from a Graphic would be more in the WPF style of defining appearance than the "old" renderer approach used in arcobjects. Also binding the geometry to my viewmodel. Any immediate plans for extending the API to support this kind of functionallity? Bjørnar Sundsbø
... View more
10-18-2010
11:21 AM
|
0
|
4
|
1111
|
|
POST
|
I changed the Output type of the service to MIME only instead of MIME + URL, and that did the trick. I get the image on the first attempt. What kind of consequences will this have on performance? From what I can see, the images generated to the argcisoutput directory has a very limited time of life, so the will not really serve as a proper cache.
... View more
10-18-2010
01:31 AM
|
0
|
0
|
1295
|
|
POST
|
Hi How do I get MyGraphics to contain the data from my ViewModels Graphics collection without monitoring changes to my viewmodel and adding them to the resource?
... View more
10-15-2010
10:49 AM
|
0
|
0
|
403
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 05-09-2015 09:20 AM | |
| 1 | 05-09-2015 01:36 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|