Skip to content

Commit 8b4e7f5

Browse files
Merge pull request MicrosoftDocs#3078 from MicrosoftDocs/iawilt-geo-map-excel
Iawilt geo map excel
2 parents ac423ff + 30c1322 commit 8b4e7f5

File tree

9 files changed

+112
-5
lines changed

9 files changed

+112
-5
lines changed

powerapps-docs/maker/canvas-apps/geospatial-component-input-address.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: powerapps
77
ms.topic: conceptual
88
ms.custom: canvas
99
ms.reviewer: tapanm
10-
ms.date: 6/12/2020
10+
ms.date: 7/7/2020
1111
ms.author: iawilt
1212
search.audienceType:
1313
- maker
@@ -46,7 +46,43 @@ With an app open for editing in [Power Apps Studio](https://create.powerapps.com
4646

4747
![Allow highlighted in the window that asks to know your ___location](./media/geospatial/address-allow.png "Allow highlighted in the window that asks to know your ___location")
4848

49-
You can modify the component by using a number of properties.
49+
You can modify the component by using a number of [properties](#properties).
50+
51+
### Set a default search radius
52+
53+
By default, the component will search around the user's ___location (providing the user has consented for the app to access their ___location). However, you can refine the default search area to help narrow or change initial results when users input an address.
54+
55+
1. On the **Properties** pane, set the **Search within radius** switch to **On**.
56+
57+
1. Enter a longitude, latitude, and radius (in meters).
58+
59+
The component will start searching at the latitude and longitude, out to the distance specified in the radius field.
60+
61+
### Use the map component with the input address component
62+
63+
You can save addresses that a user inputs into the address component as a data collection. You can then retrieve these addresses and display them in [the map component](geospatial-component-map.md).
64+
65+
1. App the map component and the input address component to your app.
66+
2. On the **Insert** menu, select **Button** and move it into your app.
67+
3. Go to the **Advanced** tab on the **Properties** pane. Under **OnSelect**, enter the following:
68+
69+
```json
70+
If(IsBlank(AddressInput1.SearchResultJson), "", Collect(locations, {Latitude: AddressInput1.SelectedLatitude, Longitude: AddressInput1.SelectedLongitude}))
71+
```
72+
73+
This causes the button to save the current latitude and longitude to a collection named *locations*, as long as the search results are not blank
74+
75+
![](./media/geospatial/input-code.png)
76+
77+
4. Select the map component, and go to the **Advanced** tab on the **Properties** pane.
78+
79+
5. Set the following properties:
80+
81+
- **ItemsLabels** as *locations*
82+
- **ItemLatitudes** as *locations.Latitude*
83+
- **ItemsLongitudes** as *locations.Longitude*
84+
85+
Each time a user selects the button, the result from the address input component will be added to the map as a new pin.
5086

5187
### Properties
5288

powerapps-docs/maker/canvas-apps/geospatial-component-map.md

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: powerapps
77
ms.topic: conceptual
88
ms.custom: canvas
99
ms.reviewer: tapanm
10-
ms.date: 6/12/2020
10+
ms.date: 7/7/2020
1111
ms.author: iawilt
1212
search.audienceType:
1313
- maker
@@ -48,15 +48,86 @@ With an app open for editing in the [Power Apps studio](https://create.powerapps
4848

4949
![Allow highlighted in the window that asks to know your ___location](./media/geospatial/address-allow.png "Allow highlighted in the window that asks to know your ___location")
5050

51-
You can modify the component by using a number of properties.
51+
You can modify the component by using a number of [properties](#properties).
52+
53+
### Use the map component with data from Excel
54+
55+
You can load a table that contains existing data from an Excel workbook into the map component. The component will then plot each row in your table as a map pin.
56+
57+
Your workbook needs to contain a named table with the following columns that should then be mapped to the associated property in the component's **Advanced** pane.
58+
59+
Column description | Maps to property
60+
-- | --
61+
Label for the pin | ItemsLabels
62+
Longitude of the pin | ItemsLongitudes
63+
Latitude of the pin | ItemsLattitudes
64+
65+
You can also use a string to denote the address, in which case ItemsLongitudes and ItemsLatitudes won't work.
66+
67+
68+
The following is an example of an Excel table with the required columns:
69+
70+
![Sample excel file with a table named TestData and containing Name, Longitude, and Latitude columns](./media/geospatial/sample-excel.png)
71+
72+
You can copy the following sample data to test this functionality:
73+
74+
Name | Longitude | Latitude
75+
-- | -- | --
76+
Fourth Coffee (sample) | -98.29277 | 26.2774
77+
Litware, Inc. (sample) | -96.85572 | 32.55253
78+
Adventure Works (sample) | -96.99952 | 32.72058
79+
Fabrikam, Inc. (sample) | -118.30746 | 34.86543
80+
Blue Yonder Airlines (sample) | -118.66184 | 34.17553
81+
City Power & Light (sample) | -113.46184 | 37.15363
82+
Contoso Pharmaceuticals (sample) | -80.26711 | 40.19918
83+
Alpine Ski House (sample) | -102.63908 | 35.20919
84+
A. Datum Corporation (sample) | -89.39433 | 40.71025
85+
Coho Winery (sample) | -116.97751 | 32.87466
86+
87+
88+
89+
90+
1. Copy and paste the table into a new Excel workbook.
91+
92+
1. Select one of the cells, and then on the Home tab in the ribbon, select **Format as Table** and choose any style, and then **OK**.
93+
94+
![](./media/geospatial/convert-table.png)
95+
96+
1. Select the table, and then go to the **Table Design** tab on the ribbon. Enter a name for the table under **Table Name:**, for example *TestData*.
97+
98+
![](./media/geospatial/table-name.png)
99+
100+
1. Save the workbook.
101+
102+
1. Open or create a new app in Power Apps, and insert the map component.
103+
104+
1. On the **Properties** pane, select the **Data source(Items)** field and then search for *excel* and select **Import from Excel**.
105+
106+
![](./media/geospatial/select-excel.png)
107+
108+
1. Locate the Excel workbook and then select **Open**. Select the table that contains the information, **TestData**, and then **Connect**.
109+
110+
![](./media/geospatial/select-table.png)
111+
112+
1. On the **Properties** pane, go to the **Advanced** tab, and select **More options**.
113+
114+
1. Set the following properties:
115+
116+
- **ItemsLabels** as *TestData.Name*
117+
- **ItemLatitudes** as *TestData.Latitude*
118+
- **ItemsLongitudes** as *TestData.Longitude*
119+
120+
1. The map component will now show each row in the table as a pin, labeled with its *Name* as defined in the Excel table.
121+
122+
![](./media/geospatial/map-expanded.png)
52123

53124
### Properties
54125

55126
The following properties can be defined and configured in the component's **Properties** pane.
56127

57128
![Map component displayed next to its Properties pane](./media/augmented-geospatial/geospatial-controls.png "Map component displayed next to its Properties pane")
58129

59-
Note that some properties are only available on the **Advanced** tab in the **Properties** pane, in the **More options** section.
130+
Some properties are only available on the **Advanced** tab in the **Properties** pane, in the **More options** section.
60131

61132
| Property | Description | Type | Location |
62133
| - | - | - | - |
25.2 KB
Loading
46.7 KB
Loading
162 KB
Loading
39.8 KB
Loading
13.3 KB
Loading
8.26 KB
Loading
22 KB
Loading

0 commit comments

Comments
 (0)