Leafy Maps šŸŒæ (new free plugin)

I havenā€™t tried it. Perhaps Vini can jump in :slight_smile:

Seems like itā€™s the olā€™ plug in needs to be visible to be initialized shenanigans. What do you think? @vini_brito

I can work around it by having one workflow to show the pop up and a separate workflow to initialize the map with a button click inside the pop up. The issue here is that you canā€™t have the map group hidden when loading the page. So if you want to swap between say a listing image and a mapview, you would have to stack the groups in Z and hide/show the listing image on top of the map. (I personally donā€™t like to stack groups in Z in bubble because it can create all kinds of issues.) Oh, and make sure you disable the button when the map is in view or remove the map when clicked a second time, if the button is clicked twice, it will throw the same error.

Orā€¦ go with google maps and snazzy maps styling, and pay more if you go big.

edit: I take that back, that is a not a satisfactory solution. Since the map will be shown when you open the pop up a second time, so it would have to be removed on closing of the pop up, or the plug in will throw the same error when the map button is clicked in the re-opened pop up. (since the map already exists). And removing the map will require you to close the pop up with a workflow in order to run remove leafy map. Itā€™s getting a bit too hacky hacky for my taste here, I will go with gmaps instead, all I really need is a marker on map anyway. Donā€™t get me wrong, this is a great plug in if you donā€™t need pop ups and multiple viewing options :wink:

Isnā€™t that working for you? Yeah, the map element must be visible for it to be initialized and loaded.

Hey vini,

Nope, running a workflow

Step 1. Show pop up - Step 2. Show map on leafymap

Throws the _initContainer error. Only way I can get it to work is with two separate workflows or adding a paus between step 1 and step 2 (to give it time to complete opening of the pop up before it runs the leafymap plugin. One of those times were bubble is actually too fast :wink: )

But as detailed in the post above, itā€™s getting a bit hacky with showing/removing map when closing and opening pop ups. Great plug in tho. more of a bubble limitation.

Yeah indeed itā€™s a race condition.
Have you tried using the ā€œDo when a condition is trueā€ workflow event? Thatā€™s the go-to solution for race conditions.
For example:
Do when condition is true -> Leafy Maps X is visible
[ Show map on Leafy Maps X ]

Yeah, tremble beneath my text drawing skills :yum:

haha nice.

Yeah, the problem is that ā€œDo when condition is trueā€ workflow events doesnā€™t have access to the parent group. So I canā€™t pull parent groupā€™s lat/long that way. My initial work around idea was to load the map on page load, then simply hide the ā€œcoverā€ group when the button is clicked, but since I donā€™t have access to parent groupā€™s lat/long this was a no go.

You can write it to a custom state.

Thatā€™s true. I was toying with the idea of writing lat/long to a custom state when opening the pop up and pull it from there. But I had to move on, I ended up using google maps and a snazzy map that looks like mapbox, itā€™s plug and play and all I need is a map with a marker. Had to move on to other things, but if I run into runaway costs with gmaps Iā€™ll revisit this and set up mapbox.

But to be fair, I think gmaps comes with 25,000 api requests per month. It would mean thousands of users, if that happens, I will probably be paying more just to have the bubble servers keeping up :wink:

Oh, thatā€™s good too!

ParabƩns Vini.
Ɠtimo plugin, agradecemos por sua contribuiĆ§Ć£o.
Por gentileza, o LOCALIZE, no caso de ser um celular, e ser um webapps, se o usuĆ”rio fechar a tela, ele pegarĆ” a localizaĆ§Ć£o mesmo assim ?

Obrigado

Ainda nĆ£o testei, mas na forma que funciona outras coisas como por exemplo notificaĆ§Ć£o, se apagar a tela do celular ele nĆ£o rastreia mais.
NotificaĆ§Ć£o via navegador Ć© assim, apagou, parou de receber.

@vini_brito Very cool plugin, indeed. Amazing work.

Would your plugin also allow me to change data by moving the pin?

Letā€™s say my data type ā€œGrocery Storeā€ has the coordinates X and Y, based on an address I put in. I can see it on the map in that spot, where the address is. But sometimes, the pin isnā€™t exactly where I want it. So can I move it to a different location? (Say, if the entrance is at a different part of the building). And if so, would I be able to then set the new location as the actual address?

Not currently, but yes, that new feature can be implemented.
The feature needed would be the ability to drag a marker and read a dragged markerā€™s new coordinates, then you set the new address to that coordinate and optionally use geocoding to get a human readable address based on that coordinate.
Everything else is in place already.

If it makes sense for your current context, you can sponsor the development of that new feature (: Iā€™d send you a private message if interested.

Hey Vini,

I am trying to populate the weather details in the app for the polygon created. Is there any option that i can show the weather details of the polygon? I am thinking of dropping a marker in the middle of polygon created by the user or if there is any way to get weather details for the polygon created by the user, let me know how to do that. Basically, when a polygon is created, I am saving geojson but i donā€™t know how to extract lat longs from that or create a marker in the middle of the polygon for which i can get the weather details.

hey @vini_brito! this plugin is awesome. canā€™t tell you how much i appreciate it!

Two questions about potential feature upgrades:

custom icon - is there a plan to improve its accuracy in the future? I saw your note about how using a custom icon can result in misplacement on the map (I tested this and confirmed as well). Itā€™d be great to serve different markers based on certain characteristics in my database.

Popups - is there a possibility to make this more customizable? Ideally, it would be helpful to be able to create this popup with multiple dynamic fields (text and images). I hacked together a solution in google maps (screenshot below) by centering the map every time a marker is clicked and sending data to a group, but the UX isnā€™t great. Itā€™d also be helpful it the popup could be clickable and send data to another page in the URL. @boston85719 i saw you created a thread about funding for HTML updates to the popup. Any update there?

Iā€™d be willing to contribute funds to improving this in the near future if itā€™s on your roadmap. Would love to discuss.

Thanks again!

Jack

3 Likes

Hello folks!

@tishant61191
Weā€™d need to expose the coordinate of the polygonā€™s center (or centroid for the geometry lovers), and then you can get the weather data for that coordinate, for example a city. Itā€™s currently not implemented, but if it makes sense for you or someone else to sponsor this, then it can be built.
Send me a private message if you want to see it built :slightly_smiling_face:

@jack4
I can expose some fields to allow for tinkering to increase the accuracy of the marker, it is possible, yes, but itā€™s not straightforward and this is why I left it out at first and only designed the recolored markers, these fields will require some tinkering and testing until your custom icon gets accurate.
Once you hit it fine with the custom icon, they work forever tho. And you can simply reuse other images with similar proportions and size with each ā€œcalibration settingsā€ (I donā€™t have a better name yet :yum:), the same way I reuse the recolored standard marker images.

About the custom popup, yeah, you could theoretically place an entire website, even more, a literal app in there, for example an iframe (a window) to a bubble app page and the user interact with it.

So yeah, it can be done, hasnā€™t been sponsored so far, so feel free to send me a private message if it makes sense for you to sponsor it :blush:

Hi @vini_brito I am wondering if there has been any workaround found for the issue regarding two maps being unable to be placed on the same page even if they have different unique IDs?

Right now I am experiencing an issue that I didnā€™t think Iā€™d encounter as I am actually putting the two different maps into two different reusable elements, which are on the same page, however, they are contained in groups that are visible at different timesā€¦but still get the issues faced when having two different maps on the same page.

These are the set ups for the two different maps in the separate reusable elements

The main issue I am facing is that after my page is loaded and the main map has been displayed, I click on a text element that changes the URLā€¦this change in URL hides the group that contains the reusable element that holds the main map and then shows a group that contains another reusable element that holds a second mapā€¦when this new group is shown, the map errors occurr:

It seems like the second action of Add marker has the error simply because of the first action of Show map has itā€™s error, which seems to be based on the map container being initialized alreadyā€¦my assumption here is that the plugin recognizes the map container as being initialized when my first main map was shown on page.

One thing I donā€™t understand though is that it doesnā€™t occur in the opposite direction. When my second group is shown on page load based on a user navigating through a URL that would show the second group on page load, and then they navigate to the main map, it loads correctly without issue, however, when they navigate back to the second map, it doesnā€™t load, but there is no error message in the debugger.

Here is a GIF of a video showing the issues I am seeing

leafy new

I also get this error

which occurs after I have made an edit to the event location and the main map is displayed again after the edit has taken place.

Any ideas of how to workaround this?

1 Like

In up to a few weeks Iā€™ll have news on this, this issue isnā€™t gone from my tracker :wink:

2 Likes

@vini_brito love your plugins! This one will be so awesome once I get it working in my app.

I canā€™t seem to get this drawing a polygon working on the map. See GIF to show you what is going on. I would really like to get this working since it is going to be the main functionality of my app. Let me know if this helps:

I tried this on my Mac on Chrome and Safari as well as on my Boot-camped Windows 10 on Edge. Same issue. Am I missing something?

Thanks for your help! This plugin will be vital for my project. :blush:

Also, is there a way to save the polygons into my project after they create one? Or is that not available? Let me know. Thanks!

1 Like

Yeah, thatā€™s available (:

And about the bug, itā€™s the third report about this issue on Mac (ah, Appleā€¦) and itā€™s on the list to be debugged, so fear not, whenever I have news Iā€™ll be sharing about it (: