Greetings,
i am trying to build a networking website for small and medium enterprises and i saw an example of a hotel booking site at www.wix.com/code/home. It is actually the first one on the page. I totally love the design and the small map in the corner showing the location of the different hotels. I am pretty sure i need such a tool for my site! I know that WIX currently doesnt have any Apps that support geolocation through database info (except "Store Locator" but i am looking for a free solution. Is it possible to code a map which reacts on database entries? Or any other ideas? I am looking forward to your replies!
Hi Tal - The original links to the code on github are now broken - page not found. Any chance you can repost them, please? Specifically steps 2 & 4 in your post of 12/31/2017. I'd love to try this solution. Thank you!
Ok, but still doesnt work :( ... Pls can you write me message on https://www.facebook.com/LukeCJ ...
I'll just pay, but I need it to work
It should be your database name.
Yes permissions and dataset on read I set correctly ... I think I will have a bug in the code ....
long = obj ["items"] map ((item) => {// Items is my dataset name "dataset1" or my database name "
You got your permissions right? I think the mode of your dataset connection to that page has to be "Read Only". Furthermore, this thing seems to work only in the Preview Mode. I tried to change that several times but it didnt work out for me. But i think Clara could help you with that. :)
Greetings
Hi, pls please what am I doing wrong?
I have a dataset Cesta, where i have field latitude and longitude
My backend file Markers.jsw
My code on page, where is map
I have "dataset1" and maps "html1" , but only the text My Google maps is displayed....
Any help, pls???
Hello again :D
i was wondering if i made something wrong with the permissions because my map is only shown within the preview but not on the published site. Anyone should be able to see it and the mode is "Read Only".
Some point i missed?
Greetings,
Dawd
Great this works, thanks a lot! :-)
I am now trying to display the labels of the markers from the database on the map.
I tried the following code without success, any thoughts?
Thanks a lot! :-)
Clara
I recommend trying to create a new page, copy the code from the instructions I gave on the previous page, make sure that the dataset mode is Read Only . Don't use user inputs on this page, just an HTML component and the code.
It seems like there's an issue with it because you use the same dataset for updating and reading.
Hello Tal
No unfortunately it still doesn't work on the live website, only on the preview.
The permissions of my table are fine since I opened them to anyone.
I also set my Maps dataset to "Read & Write".
Also my live database is synchronised with my sandbox.
However while synchronising I've got the following message.
I originally linked my dropdown list feeding the column "type" to another database called "type".
But I noticed that I actually don't need it, and removed the connections.
The type database is moreover empty (currently not possible to delete database that are not needed anymore).
https://www.sustainabilitytransition.com/map
So there shouldn't be any problem on this side.
However I might have found another possible source of problem.
While inspecting my live page, I can read the following messages:
- The SSL certificate used to load resources from https://static.parastorage.com will be distrusted in M70. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.
- The resource https://static.wixstatic.com/sites/1299fa_143eaaea4377dadbfb72c0cad0239260_202.json.z?v=3 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.
- The resource https://static.wixstatic.com/sites/1299fa_646005743a932c589ff51ba3f2a5a049_248.json.z?v=3 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.
What do you think, is it possible that the problem comes from there?
The problematic page: https://www.sustainabilitytransition.com/map
Thanks
Clara
Hey Tal,
i managed the last issues with the map now! It was actually simple; you were right about the permissions. Your code worked perfectly! Thank you so much!! I think i can handle the next few steps. I will let you know if there is something out of my league again. Haha
Greetings,
Dawda
Hi,
Clara, have you managed to resolve the issue?
Dawd, I recommend using the console.log function inside the iFrame to check whether the postMessage works properly to the iFrame. Moreover, I recommend checking out Google's documentation regarding the code within the iFrame to create multiple markers. As clarified above, it's important to make sure that the permissions are set correctly and that the data is synced to the live site.
Best,
Tal.
Hey Clara and Tal,
thank you for this input! I implemented the code into the proper places and didnt get any errors. That is good so far! But for some reason there arent any markers on my map.
The data type within the database has to be "number" or am i wrong?
Hello Dawd,
Thanks a lot.
I actually only copied the code she gave from the screenshot, but in the right place this time :-).
Look the picture below, you have to put the code down, where "map page code" is written.
backend/markers (markers should be the name of your file in backend.
latitude and longitude the value/name of your fields in your database.
Best
Clara
Hey Clara,
your site looks interesting! Since you were asking how the the things are progressing: I actually couldnt continue working on my site because of some exams but it seems you already managed to build something up.
Which points did you actually edit that Tal posted for step 4?
Greetings,
Dawd
I also did that. Everything should be open to everyone already.
The URL is https://www.sustainabilitytransition.com/map
Thanks a lot!!
Clara
Another option is changing the database permissions. Should the issue persists, please send the site URL. I'll have a look.
Tal.
Hi Tal,
Thanks!
I did that, so the live database is not empty.
Then I even added new data through my online user form in the live database.
So there is data in it, not exactly the same one though, but it shouldn't be a problem as long as there is some data in it, right?
Hi Clara,
You should sync the sandbox database to the live site as explained here.
I'm glad it worked :)
Tal.
Hello Tal,
Thanks a lot for your help, it was really useful.
The connection between my map and the database seems to work now! Great! :-)
1-Though, I was still struggling with the type of the fields longitude and latitude in the database as well as in the form field the user is submitting the information from.
=>
I solved it like this:
In the user form, I set the type of the latitude and the longitude to Text. While adding a pattern validation.
- Latitude: ^-?[0-9]{1,2}(?:\.[0-9]{1,10})?$
- Longitude: ^-?[0-9]{1,3}(?:\.[0-9]{1,10})?$
In my database, I however set the type to number (with decimal representated by a "." not a ",").
I don't know if this is the best way to solve this, but it seems to work (in the preview/sandbox version)!
2-I however now have the problem that the map is still not displayed on the live website.
By right-clicking on the page, and selecting "inspect", I get the following messages:
- The SSL certificate used to load resources from https://static.parastorage.com will be distrusted in M70. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.
- The resource https://static.wixstatic.com/sites/1299fa_143eaaea4377dadbfb72c0cad0239260_202.json.z?v=3 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.
- The resource https://static.wixstatic.com/sites/1299fa_646005743a932c589ff51ba3f2a5a049_248.json.z?v=3 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.
Any idea if I can do something about it?
The problematic page is here: https://www.sustainabilitytransition.com/map
Thanks again!
Clara