[Plugin Update 11 Mar 2020] Google Maps (bdk)

Also,

I am getting this error :
The plugin Google Maps (bdk) / element google map (bdk) threw the following error: OwnerError Recursion when evaluating property AAq on element “googlemap(bdk) A”
at new t (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/115a25798806be43e3f91269206657a6bbfa622ab88195f4b5d27cf9c20b8480/xfalse/x10:15:517394)
at e.evaluate_property (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/115a25798806be43e3f91269206657a6bbfa622ab88195f4b5d27cf9c20b8480/xfalse/x10:15:112041) (please report this to the plugin author)

Hello,
How can i use Directions api with the help of this plugin?
I have created an app, It is necessary there to show the ride directions and real time position of the driver.Could anyone help me with the directions api.

Thanks for this awesome plugin - especially the clustering function is great! Two questions:

Is there a way to format the cluster icon/colour?
Is there a way to specify icon for clicked pin?

Can’t seem to find those two in the plugin, but might be missing something. Otherwise, a big wish to add them to the wish-list :slight_smile:

Hi @humanalpha,
When a marker is clicked, the element’s corresponding ‘selected marker’ output is populated with that marker. So you can just refer the google maps’ selected marker and use that to do anything as usual with bubble e.g. create your url with params, display data in a group, send emails etc.

Nope actually the first time someone’s asked for this feature. Adding it to list of requests

Sorry nope… the assumption is that the user’s browser width isn’t gonna change

Sure. So most apps would basically show a repeating group beside / below the map listing all the markers that are currently visible to the user on the map (like a table beside the map). The google maps (bdk) element outputs the ‘list of visible markers’. You simply use this as the source data of that repeating group :slight_smile:

Thanks @dylan6!

You can change the marker data source list conditionally. So to show / hide markers simply add/remove them from the data source list of the markers

This is already possible no? I believe one of the fields is the marker label which is this

Right now you can specify the link on click. Maybe that solves the issue?

Actually if you download a lot of large size images it will take time to load. The general expectation is that the marker files are light (like 40 x 40 icons). If you take a larger image like user profile and display the resized one, bubble will still fetch the file and the resizing is done on client side / via imgix. So 20 profile photos resized would still be quite a bit of page asset load size for the bubble app.

This means you’re using the some output of the map element as input to itself causing a circular loop

Hi @ronaldtara,
Directions api isn’t supported by the plugin

Thank you @maja-overgaard!

Those features aren’t there yet but noted! :slight_smile:

Hi @gaurav

Thanks for the amazing plugin.

Have 2 simple questions that I would love your assistance with.

  1. Right now I have about 600+ marker locations on different marker sets that I am trying to load on the map - I have set custom marker images for each set, however I’ve noticed it takes quite some time (approx 10-15 secs) for the icons to fully load, can you guide me on a way to speed this process up?

  2. Is there a way to display like a “Loading Map Data” text on the map while the icons are being populated?

Thanks

Hi @anon73358276

Actually I don’t think that time can be reduced since its the amount of time your bubble app’s takes to download the data to your browser. I recommend reducing the number of locations since this is a amount of data loaded problem vs. speed of rendering problem

Hmm if you’re sure that there will be atleast one visible marker, then maybe you can show the loading text by default, and hide when the bdk map element’s list of visible markers: count > 0

Best,
Gaurav
thebdk.com

Thanks for the reply @gaurav. Have you ever found a way to optimize the rendering time by any sort? But I see your point that the main issue with the data load is likely the amount of data being loading, unfortunately our numbers will likely continue to grow more. Would a batch style load be more optimal you think?

@gaurav Is there any way to set the’Current Marker’ to no value (i.e. reset it) once it has been selected?

I am using ‘Current Marker’ to filter a repeating group, but I can’t find a way to clear the current marker which would allow the RG to be unfiltered again.

Thanks

hi @gaurav,

I just bought this plugin. Awesome job you have done here.

I might missed this out in the thread, but how do I show “route” between two addresses using this map plugin? Example image below, from Uber app. I would like to show route between two addresses (markers) that I have in the map.

route map

Cheers.

1 Like

Hi @gaurav ,

Fantastic plugin - and I am only using a fraction of what it can do - but I have hit a snag. Basically I want to create a data-driven list of markers based on InfoPoints which contain a Name (Text) and address (Address). The problem is the order of these will vary according to the data/usage - the specific list of InfoPoints being referenced - but I want to have numbered pins (i.e. I have pin images for 1,2, 3 etc) on that map to represent them.

At the moment I am having to create whole new data type (Tour Pins) which copies over a list of Pin images and the addresses and names for of these to be able to render the points I want. When I make small changes it needs to delete all Tour Pins related to the tour in question and recreate them again. But it is a process-heavy step and thus very slow when I have even 20-30 pins. Is there any way that rather than just use an image in the database related to the pin it could reference a PIN somewhere else using its ID say or a text field pointing to a URL to render these?

I imagine the ability to use numbered pins would be something others would be able to use. Under the map there would be a key linking the numbers to the items they relate to.

Thanks for your help,
David

Hi,
I am trying the plugin, how can I add lat/long instead of an address?
Thanks

Hi @gaurav

I keep running into this error while using the plugin.

Screenshot 2021-02-20 at 9.38.31 AM

It doesn’t come always. Comes up sometimes. And I just keep refreshing the page etc. Sometimes it disappears after sometime. Sometimes it persists.

I understand that it could be because bdk map object doesn’t get loaded. But what could I do to prevent it?

Hi @gaurav

I have recorded videos to show my issues.

Video1

This video shows few things:

  1. BDK Map plugin throws error sometimes, sometimes not. You can see that I just refresh the same page a few times and different behaviours are observed.

  2. When the error is not thrown, sometimes Map is zoomed at the level I want, sometimes at some other level

  3. When the zoom level is right, the map’s centre pin doesn’t show up. It is marked at some different place even though map is centred at right place.

The error looks like this:

Video2

This is continuation of previous video. It shows following things:

  1. As mentioned in previous video’s point#3, it shows that even though map is marked at correct place, the pin is at a different place. Initially centre pin is not even visible, but shows up on zooming out.

  2. When I change the location via the Searchbox, the map centre goes abruptly to some random location. In this scenario I have also seen that the pin location doesn’t change.

Map Setup
Here’s how map is setup. (Basically the centre of the map and the centre pin is to point to the location selected in search box. When the searchbox is empty, it is supposed to centre to a place in Bangalore).

Screenshot 2021-03-01 at 11.29.34 PM

You can also try the page out yourself at Beezy

Another issue that I am facing is this “UnexpectedError cannot dehydrate a function” error. I have no idea why is this coming :slightly_frowning_face:

Would be great if you could look into these sometime soon and help. These issues are affecting our team’s productivity significantly.

Thanks,
Mukesh

Managed to solve “Cannot dehydrate” error. Not sure why it happens, but I got a pointer on when it happens via this post (Why are Google API keys required? - #7 by shot).

Basically it happens if you select the marker data type as geographical address and put the list of geographical addresses in the source. I was having a custom state with a list of addresses. I changed it to a field in a new data entity in the db. And then gave the data type as the entity instead of geographical address. This solved it.

However, of course this is still a bug. Don’t know whether it is at Bubble’s end or at plugin’s end.

And other issues remain.

1 Like

Hi Gaurav,

We are currently building a marketplace for coworking spaces and would be interested to integrate your plugin (we are doing full no code).

We want to extract different data related to the marker, in that case the coworking space (such as Picture, Address…) directly from our DB and display them on the Map in order for every user to access relevant information when he/she clicks.

Please refer to the picture from AirBnb as an example.

Also, we want to make sure that when we click on this popup, users will be redirected towards the specific page of this coworking space.

Thanks a lot,
Fayçal

1 Like

Were you able to build this functionality? I am looking for exactly the same, but doesn’t seem to be possible.

Hey @gaurav - Am I missing something obvious… Is there a simple way to change the marker for the currently selected marker?

Ah no worries. Realized I can do it using a second marker set. FYI if anyone else doing this notices some jumpiness when switching to the second marker set, it’s due to the “zoom to fit markers when loaded” option. I disabled this with a conditional one the initial set had loaded.

Hi @gaurav

Been using your plugin for sometime, its been amazing. I wanted to know something however. I have a list of over 1000 markers that need to be loaded on the map constantly, is there a way to optimize the loading to improve performance? My list of markers / locations will continue to grow and I’m unsure of the best optimization techniques we should use to ensure that our app is performant. Currently with 1000 locations, the map takes somewhere between 15-20 secs to load on the personal plan on Bubble.

Your assistance is much appreciated.

Thanks

Lavatori

Who can really use 1000 markers at once? I’m not saying nobody could, just that it’s hard on most screens to see 1000 of anything

15 seconds is a long time. Is it that long each time the map updates?

It probably has not much to do with the bubble speed as it does the time to render on the given device. I’ve loaded 400 markers before in a flight tracker and it took about. 1 second. And that I clouded the time to determine and draw direct flight paths.