Yeh it is… ok I vaguely remember what you were doing now. I’ll run some tests today for you and see if I can see any issues.
Thanks for the WF images. If at all possible, the next time you spot it fail, do you think you could get the coordinates that make up the polygon and fire them over to me in a PM? If they’re awkward to get at, don’t worry.
Sure thing, they should be in my server logs so when I get back from work I’ll get them
Hi, I have bought this Plugin but need some help. I’ve imported a KML file with metadata in it, how could I use retrieve the data in it? I’d like to retrieve SAL_CODE21.
This is the metadata:
31807
Meridan Plains
3
Queensland
AUS
Australia
19.74600000000
http://linked.data.gov.au/dataset/asgsed3/SAL/31807
0.27974708628
0.00179175943
Hi @strategica
I don’t think I’ve added that functionality for KML files but you can do it with GeoJSON files. Are you able to work with that format?
I’ll take a look at what needs to be done to make it work with KML also.
Hi, yes, I think I can convert from KML to geojson. What is the property to get the value?
thank you!
I’ve just pushed an update with some updated documentation within the actions mentioned below.
There’s potentially 2 ways of loading the GeoJSON onto the map.
Use the action called “Load GeoJSON” then whenever you click on one of the features on the map, you should get the “GeoJSON feature” state populated with all the custom properties defined in that particular clicked feature.
Make sure you set this dropdown field for it to work.
If the dataset you’re working with is really large, you can also use the “Load Deck layer” action, but it’s a little more fiddly to set up. It’ll populate the state in the same way though.
On the demo page (it’s a little messy, sorry) are a few blue buttons at the top which should help you out.
Let us know if you run into any problems and I’ll try and help.
Amazing support, mate! I’ve managed to get the property that I wanted by getting the first property of the json.
Sorry about more questions, maybe even basic:
-
is it possible to change the color of the shape via geojson OR is it possible to change in any other way? In the geojson I added “FILLCOLOR”: “rgba(255,0,0,0)”, “STROKECOLOR”: “rgba(255,0,0,0)”, but the color continued gray.
-
In your dev editor, when you click to load the second KML file, if you click in any of the shapes, it shows a label on the point you clicked: “Edit this name” “Edit this description”. Do we have the same for geojson?
-
What would be the best option if I want to store the coordinates or geojson in a database by suburb? (any example?)
-
Ive also checked that you provided an example to store the polygon in the database and then create the shapes based on it. Any idea then how I could convert my KML or geojson to the same format as POLYGON() or MULTIPOLYGON coordinates? I think it will be easier If I keep it in the db instead of KML or GeoJson as I tried before…
thank you!
- is it possible to change the color of the shape via geojson OR is it possible to change in any other way? In the geojson I added “FILLCOLOR”: “rgba(255,0,0,0)”, “STROKECOLOR”: “rgba(255,0,0,0)”, but the color continued gray.
I’ve put the color changing properties into the action itself, so if you look at the Load GeoJSON action for example, you should see the fill and stroke colors in there. I have just realised though, this sets the properties for all. If you want to ignore these and use the properties from the file, I’ll need to tweak a few things to make that work!
- In your dev editor, when you click to load the second KML file, if you click in any of the shapes, it shows a label on the point you clicked: “Edit this name” “Edit this description”. Do we have the same for geojson?
No, these are unique to KML files unfortunately. To get any type of label to appear, you’d be better off extracting the coordinates for the shape and then using the Draw shape action to get the labels added (there’s an option for labels inside that action). I may have a look and see how tricky it is to get labels added for GeoJSON objects. I don’t know how to do that off the top of my head right now.
- What would be the best option if I want to store the coordinates or geojson in a database by suburb? (any example?)
Very difficult to do this, have you got the coordinates stored in the JSON file already?
If you do, then they can be extracted and probably run through the Draw shape action.
- I’ve also checked that you provided an example to store the polygon in the database and then create the shapes based on it. Any idea then how I could convert my KML or geojson to the same format as POLYGON() or MULTIPOLYGON coordinates? I think it will be easier If I keep it in the db instead of KML or GeoJson as I tried before
Yep good idea and that’s probably the way to go here, get the coordinates and store them. Once you have them stored in a format that works with the plugin, then you’ll be able to do all sorts of things. Personally, I find KML and GeoJSON files awkward to work with, although they are useful I always find I run into a brick wall at some stage in the process. Much better to just have the coordinates stored in your database.
What it is you’re designing? are you wanting to draw boundary polygons of some kind for specific regions, cities, states etc on the map from an address? or something similar.
thanks for all the responses!
I have the KML and geoJson file of all Australian territoty by suburb (15k). As I dont want to split them in 15k files or cities, I will actually try to find a way to import them into a table in SQL Server and then reimport to Bubble. My idea is to load the json to sql server, use sql functions to find a pattern in the file, them format the polygon based on the json coordinates. I think this should work as I managed to do it manually for 2 suburbs, now I just need to apply this logic to a SQL script.
Oh ok, I see… ok good thinking.
I have some experience with T-SQL so if you need a hand with that, or I can do using JavaScript also, then give us a shout. Let us know how you get on!
Hello @pork1977gm . Did you change something related to the Enable Drawing Tools action?
I had a button the flow was Enable Drawing Tools > Add a pause before next > Select Drawing mode.
Everything worked fine, but now the plugin is giving me an error.
Nothing has been changed in regards to how this part works, but check this out…
Instead of using that “pause” action, which isn’t a good practice because you’re “hoping” whatever that time interval is, will be a sufficient enough time for the drawing tools to be enable and Bubble doesn’t necessarily run workflow actions in the order you see them in each step… use the event called “Drawing tools have been enabled”.
When you set that event up, it will trigger after the drawing tools have fully loaded so you won’t need to use the pause action. Basically everything from step 3 onwards should be moved into that event.
Give that a go and if you still see that error popup afterwards, then let me know and I’ll dig a little deeper for you.
Paul
Thanks for the tip @pork1977gm ! The problem is the SearchBox on my page that is bugging the Enable Drawing Tools action. It happens when I create an action inside this SearchBox… In fact, this wasn’t happening before, and now it started to cause problems…
I tried to put a conditional in SearchBox to become visible ONLY WHEN THE LOADING MAP LIBRARIES IS “NO”, but the error still persists.
Would you mind sending me a link to your editor? (PM the URL to me) in view mode.
I can check the order of actions etc and probably figure it out.
Update 1.228.0
Here’s some updates made recently.
2 new actions included (as requested) for dealing with tile layers which typically load using URL’s such as: https://tile.openstreetmap.org/{z}/{x}/{y}.png
- Load tile layer
- Remove tile layer
The plugin has been finally upgraded to use Node v18 (plugin API version 4).
The “Clear map” action has also been updated, now includes tile layers.
@ramzizi
You’re drop marker feature has been added and I’ve created a new section for “Freehand drawing” as shown below. There was also a bug fixed I come across whilst doing this, which when a single tap of the map (without dragging and where no points were yet to be created) took the user out of drawing mode, so that’s fixed. Let me know how you get on with this.
I’m not sure if there’s a bug with the What3Words side of things, but the demo page seems to be showing an error whenever a marker would be converted to a What3Word address. I’ve checked it and currently have a support ticket open with them because it looks like something has changed within their API.
Can you install v1.229.0 and see if the problem goes away.
It worked @pork1977gm , thanks for the help!
Marvellous!