Select to view content in your preferred language

MMPK: Bad Symbol Rotation

5614
23
Jump to solution
07-06-2017 09:45 AM
MarkCederholm
Frequent Contributor

Attached is a small MMPK, created in Pro 2.0, that demonstrates a bad symbol rotation in Runtime 100.1 [I don't recall seeing this issue in Pro 1.4.1/Runtime 100.0, but I may be wrong].

Here's how it appears imported into Pro:

And here's how it appears in Runtime:

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JenniferNery
Esri Regular Contributor

Thanks, Mark. I'm able to reproduce the issue in v100.1 and it looks like it did not render at all in v100.

Also, I find that when you opt-out advanced symbology, it renders just at it would in ArcGIS Pro. Do you mind trying the following workaround?

var mmpk = await MobileMapPackage.OpenAsync(path);
var map = mmpk.Maps.FirstOrDefault();
foreach(var layer in map.OperationalLayers.OfType<FeatureLayer>())
{
    var table = (ArcGISFeatureTable)layer.FeatureTable;
    table.UseAdvancedSymbology = false;
}
MyMapView.Map = map;

I have logged the issue so our team can investigate further.

Thanks.

Jennifer

View solution in original post

0 Kudos
23 Replies
JenniferNery
Esri Regular Contributor

Thanks, Mark. I'm able to reproduce the issue in v100.1 and it looks like it did not render at all in v100.

Also, I find that when you opt-out advanced symbology, it renders just at it would in ArcGIS Pro. Do you mind trying the following workaround?

var mmpk = await MobileMapPackage.OpenAsync(path);
var map = mmpk.Maps.FirstOrDefault();
foreach(var layer in map.OperationalLayers.OfType<FeatureLayer>())
{
    var table = (ArcGISFeatureTable)layer.FeatureTable;
    table.UseAdvancedSymbology = false;
}
MyMapView.Map = map;

I have logged the issue so our team can investigate further.

Thanks.

Jennifer

0 Kudos
MarkCederholm
Frequent Contributor

That works for me.  Thanks!

0 Kudos
JenniferNery
Esri Regular Contributor

No problem, I updated the workaround a bit - no need to load and clone.

0 Kudos
MarkCederholm
Frequent Contributor

Is there any way to determine the geometry of a feature layer without loading the table?  I would like to be able to apply the workaround only to point layers (I have polyline layers with advanced symbology).

0 Kudos
AnttiKajanus1
Deactivated User

Hi Mark, I'm not aware a way to that without loading the metadata for the table since the layer doesn't have any information about it's content before that is done. If you are using MMPKs the loading operation shouldn't be too expensive since no network calls are done at that point. 

0 Kudos
MarkCederholm
Frequent Contributor

Unfortunately, I can't change the UseAdvancedSymbology setting once the table is loaded.  I tried cloning the layers, closing the GDB, even opening the MMPK a second time, but in those cases I couldn't get the map to load.  

0 Kudos
AnttiKajanus1
Deactivated User

Does this work? it's not very pretty but after I go through UseAdvancedSymbology values on loaded event, i get thing set properly. I didn't have a service that clearly has different symbology so not sure if the correct symbols was used though.

offlineMapPackage = await MobileMapPackage.OpenAsync(offlineDataFolder);
offlineMap = offlineMapPackage.Maps.First();

var featureLayers = offlineMap.OperationalLayers.OfType<FeatureLayer>().ToList();
var featureLayer = featureLayers.First();
var gdbTable = featureLayer.FeatureTable as GeodatabaseFeatureTable;
var gdb = await Geodatabase.OpenAsync(gdbTable.Geodatabase.Path);

var pointLayers = new List<int>();
for (int i = 0; i < gdb.GeodatabaseFeatureTables.Count; i++)
{
    var table = gdb.GeodatabaseFeatureTables[i] as GeodatabaseFeatureTable;
    await table.LoadAsync();
    if (table.GeometryType == GeometryType.Point)
        pointLayers.Add(i);
}

foreach (var index in pointLayers)
{
    var table = gdbTable.Geodatabase.GeodatabaseFeatureTables[index];
    table.UseAdvancedSymbology = false;
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
MarkCederholm
Frequent Contributor

Nope.  Still can't get the map to load.  I'm using the same MMPK that I originally attached to this thread.

0 Kudos
MarkCederholm
Frequent Contributor

More info:  I'm getting a FileNotFound exception at the Geodatabase.OpenAsync step.

0 Kudos