<?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: Fetching Location Data added in MMPK File in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/fetching-location-data-added-in-mmpk-file/m-p/1384207#M350</link>
    <description>&lt;P&gt;In order to fetch the table and location data from the MMPK file, you will first have to create and instance of &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.mapping/-mobile-map-package/index.html?query=class%20MobileMapPackage%20:%20Loadable" target="_self"&gt;MobileMapPackage&lt;/A&gt;&amp;nbsp;and load it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a &lt;A href="https://developers.arcgis.com/kotlin/sample-code/display-map-from-mobile-map-package/" target="_self"&gt;sample&lt;/A&gt; which shows how create a map from a mobile map package and displays it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Once you have the map created from the MobileMapPackage, you can iterate over its &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.mapping/-arc-g-i-s-map/index.html?query=class%20ArcGISMap%20:%20GeoModel,%20JsonSerializable#-1320008140%2FProperties%2F-1844196645" target="_self"&gt;operationalLayers&lt;/A&gt;&lt;BR /&gt;to find the FeatureTable that has all your location data and can even perform a query operation on it to filter data based on a query string.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;val featureLayer = mmpk.maps[0].operationalLayers.filterIsInstance&amp;lt;FeatureLayer&amp;gt;().first() // gives the first FeatureLayer in the operationLayers of the map
// then you can get the feature table from the feature layer
val featureTable = featureLayer.featureTable &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Alternatively,&lt;BR /&gt;You can iterate over the &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.mapping/-arc-g-i-s-map/index.html?query=class%20ArcGISMap%20:%20GeoModel,%20JsonSerializable#-1095467475%2FProperties%2F-1844196645" target="_self"&gt;ArcGISMap's tables&lt;/A&gt;&amp;nbsp;and find the feature table there.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;val mapPackage = MobileMapPackage(filePath)

mapView.map = mapPackage.maps.first()

val featureTable = mapView.map.tables.first()// gives the first table in map's table list&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;To find out how to query the feature table you can refer to this &lt;A href="https://developers.arcgis.com/kotlin/sample-code/query-feature-table/#sample-code" target="_self"&gt;sample&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2024 02:42:37 GMT</pubDate>
    <dc:creator>PuneetPrakash</dc:creator>
    <dc:date>2024-02-20T02:42:37Z</dc:date>
    <item>
      <title>Fetching Location Data added in MMPK File</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/fetching-location-data-added-in-mmpk-file/m-p/1383518#M348</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have added a table in MMPK file with multiple locations and their details.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now in android application we need to fetch those locations and details.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can we fetch the table and location data from MMPK file? If yes, how we can do that?&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 17:33:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/fetching-location-data-added-in-mmpk-file/m-p/1383518#M348</guid>
      <dc:creator>DarshanPopat</dc:creator>
      <dc:date>2024-02-16T17:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching Location Data added in MMPK File</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/fetching-location-data-added-in-mmpk-file/m-p/1384207#M350</link>
      <description>&lt;P&gt;In order to fetch the table and location data from the MMPK file, you will first have to create and instance of &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.mapping/-mobile-map-package/index.html?query=class%20MobileMapPackage%20:%20Loadable" target="_self"&gt;MobileMapPackage&lt;/A&gt;&amp;nbsp;and load it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a &lt;A href="https://developers.arcgis.com/kotlin/sample-code/display-map-from-mobile-map-package/" target="_self"&gt;sample&lt;/A&gt; which shows how create a map from a mobile map package and displays it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Once you have the map created from the MobileMapPackage, you can iterate over its &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.mapping/-arc-g-i-s-map/index.html?query=class%20ArcGISMap%20:%20GeoModel,%20JsonSerializable#-1320008140%2FProperties%2F-1844196645" target="_self"&gt;operationalLayers&lt;/A&gt;&lt;BR /&gt;to find the FeatureTable that has all your location data and can even perform a query operation on it to filter data based on a query string.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;val featureLayer = mmpk.maps[0].operationalLayers.filterIsInstance&amp;lt;FeatureLayer&amp;gt;().first() // gives the first FeatureLayer in the operationLayers of the map
// then you can get the feature table from the feature layer
val featureTable = featureLayer.featureTable &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Alternatively,&lt;BR /&gt;You can iterate over the &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.mapping/-arc-g-i-s-map/index.html?query=class%20ArcGISMap%20:%20GeoModel,%20JsonSerializable#-1095467475%2FProperties%2F-1844196645" target="_self"&gt;ArcGISMap's tables&lt;/A&gt;&amp;nbsp;and find the feature table there.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;val mapPackage = MobileMapPackage(filePath)

mapView.map = mapPackage.maps.first()

val featureTable = mapView.map.tables.first()// gives the first table in map's table list&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;To find out how to query the feature table you can refer to this &lt;A href="https://developers.arcgis.com/kotlin/sample-code/query-feature-table/#sample-code" target="_self"&gt;sample&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 02:42:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/fetching-location-data-added-in-mmpk-file/m-p/1384207#M350</guid>
      <dc:creator>PuneetPrakash</dc:creator>
      <dc:date>2024-02-20T02:42:37Z</dc:date>
    </item>
  </channel>
</rss>

