<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I add a network dataset to a mobile map package? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-add-a-network-dataset-to-a-mobile-map/m-p/696814#M30887</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I import the map package into Pro, the network exists just like it should. However, when I open it in WPF then the TransportationNetwork is null still. Am I loading the map wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;var mapPackage = await MobileMapPackage.OpenAsync("C:\\Program Files (x86)\\Common\\Maps\\NetworkPackage.mmpk");&lt;BR /&gt; if (mapPackage.Maps[0].TransportationNetworks != null)&lt;BR /&gt; {&lt;BR /&gt; this._routeTask = await RouteTask.CreateAsync(mapPackage.Maps[0].TransportationNetworks[0]);&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; // always null&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 May 2017 18:33:13 GMT</pubDate>
    <dc:creator>ClayGinn</dc:creator>
    <dc:date>2017-05-30T18:33:13Z</dc:date>
    <item>
      <title>How do I add a network dataset to a mobile map package?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-add-a-network-dataset-to-a-mobile-map/m-p/696812#M30885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still fairly new to ArcGIS Pro, so forgive me for anything obvious I'm overlooking.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attempting to add a network dataset to a map and then export it as a mobile map package. I've followed the instructions here (&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-mobile-map-package.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-mobile-map-package.htm"&gt;Create Mobile Map Package—Data Management toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;) and my network dataset follows all of the conventions described on this page. When I build it I receive no errors. However, when I open it in my WPF application, the TransportationNetworks object is always null.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to verify through ArcGIS Pro that the network dataset actually made it into the package? If that is the case then I can determine whether or not the problem is in my WPF application. If the network dataset isn't being included, then what am I failing to do?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure what other information might be needed, so please tell me what else I should provide.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 May 2017 01:55:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-add-a-network-dataset-to-a-mobile-map/m-p/696812#M30885</guid>
      <dc:creator>ClayGinn</dc:creator>
      <dc:date>2017-05-28T01:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a network dataset to a mobile map package?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-add-a-network-dataset-to-a-mobile-map/m-p/696813#M30886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can open the .mmpk you created in Pro, the network you originally added should be in the mmpk's map.&amp;nbsp; To open a .mmpk in Pro on the Insert tab select Import Map and point to .mmpk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your WPF app ... is the map loaded before you attempt to access the TransportationNetworks?&amp;nbsp; Since the transportation networks are part of the map it needs to be loaded before accessing the&amp;nbsp;TransportationNetworks array.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 17:21:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-add-a-network-dataset-to-a-mobile-map/m-p/696813#M30886</guid>
      <dc:creator>FrankKish</dc:creator>
      <dc:date>2017-05-30T17:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a network dataset to a mobile map package?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-add-a-network-dataset-to-a-mobile-map/m-p/696814#M30887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I import the map package into Pro, the network exists just like it should. However, when I open it in WPF then the TransportationNetwork is null still. Am I loading the map wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;var mapPackage = await MobileMapPackage.OpenAsync("C:\\Program Files (x86)\\Common\\Maps\\NetworkPackage.mmpk");&lt;BR /&gt; if (mapPackage.Maps[0].TransportationNetworks != null)&lt;BR /&gt; {&lt;BR /&gt; this._routeTask = await RouteTask.CreateAsync(mapPackage.Maps[0].TransportationNetworks[0]);&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; // always null&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 18:33:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-add-a-network-dataset-to-a-mobile-map/m-p/696814#M30887</guid>
      <dc:creator>ClayGinn</dc:creator>
      <dc:date>2017-05-30T18:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a network dataset to a mobile map package?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-add-a-network-dataset-to-a-mobile-map/m-p/696815#M30888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;var mapPackage = await MobileMapPackage.OpenAsync("C:\\Program Files (x86)\\Common\\Maps\\NetworkPackage.mmpk");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//add this line and the TransportationNetworks[] should no longer be null.&lt;/P&gt;&lt;P&gt;await mapPackage.Maps[0].LoadAsync();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (mapPackage.Maps[0].TransportationNetworks != null)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively .... you might want to display the map from the map package this will (auto) load the map [e.g.&amp;nbsp; myMapView.Map = mapPackage .Maps[0];]&amp;nbsp;&amp;nbsp; Then you could monitor the status of the map (whether is loaded or not) by hooking up the the map's loaded event (e.g. myMapView.Map.Loaded += Map_Loaded;), and in the 'Map_Loaded' method you could now use the TransportationNetworks[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the general structure would be something like this (note: this is just one possible way):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MobileMapPackage mapPackage = await MobileMapPackage.OpenAsync(mmpkPath);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyMapView.Map = mapPackage.Maps[0];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //connect up load event&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyMapView.Map.Loaded += Map_Loaded;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void Map_Loaded(object sender, EventArgs e)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Use dispatcher since dealing with different threads&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(CreateRouteTask));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void CreateRouteTask()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // check if trans networks not null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (MyMapView.Map.TransportationNetworks != null)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //if not do something with them&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(MyMapView.Map.TransportationNetworks.Count);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 19:13:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-add-a-network-dataset-to-a-mobile-map/m-p/696815#M30888</guid>
      <dc:creator>FrankKish</dc:creator>
      <dc:date>2017-05-30T19:13:44Z</dc:date>
    </item>
  </channel>
</rss>

