I need help with code to add Multiple Map Pins onto a Google Map.
OnSelect will launch the Google Map outside of the PowerApps.
I am currently using the following code to launch Google Maps with the address of the selected item(Account) in BrowseGallery1 with the DataSource of AcctMain:
Launch("http://www.google.com/maps/search/?api=1&query="&Address1&City&State&PostalCode)
Now I need to launch Google Maps with the addresses of all items(Accounts) in BrowseGallery1 with the DataSource of AcctMain.
Any help would be greatly appreciated. Thanks, Marc...
Solved! Go to Solution.
Hi @BrianJ. Without getting into the code very deep...
Keep hackin' you'll get it 🙂
Ok I got this code working by clicking on the date in the List box. But I would like foe a marker to show for each address that is in the list box.
"https://maps.googleapis.com/maps/api/staticmap?center=formatpng&markers=color:red%7C" & EncodeUrl(ListBox1_1.Selected.Result) & "&size=" & txtImageWidth & "x" & txtImageHeight & "&key=" & txtGoogleMapsKey.Text
I'm not real sure if a list box is my best option. Attached is a screenshot of what I am working with.
Hi @BrianJ. Nice looking app!
Maybe try changing the ListBox out for a Gallery. Then try:
Filter( Inventory, Address exactin Gallery.AllItems.address ),
Where Gallery.AllItems.address is the text box in your gallery displaying the address. You might have to use Gallery.AllItems.address.Text (or it might not work at all!). I'm more of a hands-on PowerApper. Its difficult for me to recall solutions without trying various things.
Hope this helps!
@ericonline I changed to a Gallery and add your suggestion but I am now getting this error
"Invalid argument type (Table). Expecting a Text value instead."
Here is the code.
"https://maps.googleapis.com/maps/api/staticmap?center=formatpng&markers=color:red%7C" & EncodeUrl(Gallery1.AllItems.lblAddress) & "&size=" & txtImageWidth & "x" & txtImageHeight & "&key=" & txtGoogleMapsKey.Text
Hi @BrianJ. I had a few minutes to look at @luuminhvuong93's solution. His is different than what you're trying to do. He's filtering a Collection by something (say Agent Name in your case) and returning an array of Lat/Longs. I googled "multiple markers google maps by address". Of the two writeups I looked at, both are ALSO using Lat/Longs.
Example 1: https://nearplace.com/blog/how-to-add-multiple-markers-on-google-maps/
Example 2: https://www.taniarascia.com/google-maps-apis-for-multiple-locations/
You'll have to do some more research and see if its possible to pass Google Maps multiple Addresses at once or if you need to geocode them first (get Lat Longs) then supply the API those instead.
Good luck!
Hi,
I am looking for multiple pins with google o bing maps. I have find midle of a "solution" maybe you can help me.
I give you the solution for 1 pin with google maps and gallery
( i prefer google maps because the zoom work good. With bing the zoom in a static map its crazy)
My gallery have a item "Address" with a inputtext "Subtitle2_1 ".
I enter the Street, city .. like this : "7s9s Technology Way, Denver, co 80237"
In a picture :image: "https://maps.googleapis.com/maps/api/staticmap?center="
& Substitute(Subtitle2_1.Text; " "; "+") & "&zoom=5 &size=600x600 &key=MyKey &markers=color:red%7Clabel:A%7C" &(Subtitle2_1.Text)
This work.
For multiple pins:
If i use gallery.allitems.address not work
If i use this formula its ok :
"https://maps.googleapis.com/maps/api/staticmap?center="
& "Brooklyn+Bridge;New+York;NY"
& "&zoom=13 &size=600x600 &key=MyKez
&markers=color:red%7Clabel:A%7C" &"Brooklyn+Bridge
&markers=color:red%7Clabel:A%7C" &"New+York;NY"
We need to separate the markers.
Now i am looking for automate the multiple marker.
I try to make a collection and the idea is to select each ID, ID=1, ID=2 with a formula who auto create the line "&markers=color:red%7Clabel:A%7C" &" " and complete with the resulte of the ID=x
But when i test with one markers to call the ID this dont work.
Any idea?
I want to build the same that "mymaps" from google but with my own data directly in powerapps
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
179 | |
52 | |
41 | |
36 | |
29 |
User | Count |
---|---|
241 | |
82 | |
71 | |
69 | |
66 |