I have a GeoSpatial Map in my power app and it is really great! I am not using the default location; rather I am using a table filled with addresses in the map's item property. When a user interacts with the map (zoom, skew or reposition) the map reacts and displays what it should (which is good). What I would like to know is if anyone has figured out how to reset or re-center the map on the original items list. I have tried setting the items to Table(Blank()), then back to the original values with no change in the map. I also tried setting the default Location to true then to false but also no change in the map.
I would like to offer a "Reset" button to show the map as it was originally drawn (zoom and centered on list addresses). The only way I see for the map to redraw itself is by leaving the map control's screen and returning to that map screen. Any other ideas or tricks to get the map to redraw itself with its original zoom level?
Hi @PauloRech ,
Unfortunately I did not find a solution to recenter the map. My hope is that as more of us implement this control a solution will be found or the control will be updated to offer this feature.
DefaultLatitude (use a variable, for example varMapLat)
DefaultLongtiude (use a variable, for example varMapLong)
Add a Gallery
and set data items (Pretty much hardcode 1 item)
Inside Gallery, add an icon or button. And put the following code to "OnSelect" (What this does is to tell the map to go to 0,0 location
Set(varMapLat,"0"); Set(varMapLong,"0"); Select(Parent);
For Gallery "OnSelect", set varMapLat, varMapLong to where you like the map to center.
This just a cheaphack I found which it will trigger the map to go to lat 0, long 0 (From Gallay Icon onselect), and short after, the Gallery Icon's parent, which is Gallery onselect will set the lat and long to where you like.
The Map reset to that location if you do that.
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!