Using the samples I can utilize a FeatureLayer but haven't been able to figure out how to load a mobile map package. Any suggestions?
Thanks
Solved! Go to Solution.
I see what you are asking. It is a static method so it would be something more like this:
_mappackage = await MobileMapPackage.OpenAsync("D:\\Source code\\Data\\Test.mmpk");
_mappackage = await OpenAsync("D:\\Source code\\Data\\Test.mmpk"); var mapPackageUri = new Uri(_mappackage.Item.Url); var mapTable = new ServiceFeatureTable(mapPackageUri); var mapPackageFeatureLayer = new FeatureLayer(mapTable); myMap.OperationalLayers.Add(mapPackageFeatureLayer);
More specifically I'm not sure what to do for the OpenAsync method.
I don't understand your question. What do you mean you are not sure what to do?
This MSDN documentation may help better explain how await works:
I'll dig into that a bit more because I'm sure this stems from my lack of experience in c# and Xamarin. In my bit of code above I get the error that OpenAsync does not exist in the current context. I'm not sure if I need to import something else or if I need to define OpenAsync myself.
I see what you are asking. It is a static method so it would be something more like this:
_mappackage = await MobileMapPackage.OpenAsync("D:\\Source code\\Data\\Test.mmpk");
Thanks a lot Alexander. That's what I needed.
Awesome! Glad that helped! You may want to visit the Early Adopter community as well for more direct feedback with the development team.
I'm working off of the Xamarin.Forms api found at (MobileMapPackage.OpenAsync Method )