Googlemap element and visualisation - table column content

Kordian

Member
Hello once again,
It is possible that I am either mistaken or simply lack knowledge, but here is my point of view and my "problem".
I have databases containing gps position data. All of the databases of this type I have seen always contain 2 separate columns for both of the coordinates (latitude and longitude).
I wanted to visualise these databases. The best (if not "the only") solution for fabrik is the googlemap element and further the googlemap visualisation. However, this element contains the latitude and longitude data in one "column", so to say. Its format is "xx.xxxx, yy.yyyy". So, in order to use the googlemap element, the database needs to be reformatted. I would like to avoid reformatting.
And here comes my question: is there any way to keep the latitude and longitude columns separatelly in the database and point the googlemap visualisation to these columns as the coordinates for visualisation?
As I mentioned, to me the "separate columns" method is the most natural one and I do not know the reasons for putting these two together in the googlemap element.
If this is also natural to more of you, maybe the next version of googlemap element could give such an option? Maybe splitting the element into googlemap_lat and googlemap_long could be possible? Or simply add a new functionality to the googlemap visualisation, where after specifying the connection and the database to be used one could select the "latitude" and "longitude" column?
Many thanks in advance for the answer!
Oh, one more thing: this concerns both Fabrik 2.0 and 3.0.
Regards
Kordian
 
You don't need to reformat your database table.
Create a MySQL view concatenating your lat + long to the googlemap format, create a fabrik list pointing to this MySQL view and use this list in the googlemap viz.
 
Thank you Troester.
If I go this way:
OK, as I am not a SQL guru, it will be a stupid question, but:
If I create a concat view, I will only have the coordinates in that view (in the right syntax though). That is what I've managed so far.

SELECT Concat(RTrim(Latitude), ', ', RTrim(Longtitude), '')

The databases I use contain additional columns and when I point to a coordinate on the googlemap, I still would like to have info from these columns available.
So I simply lack knowledge on how to create a view, which:
1. Will contain all the columns from my database (let's say COLUMN1, COLUMN2)
2. Will contain "reformatted" coordinates as additional column in the new view.
And that is what I do not know how to do.
 
CREATE VIEW vw_with_googlemap AS SELECT id,col1,col2, concat('(',RTrim(Latitude), ', ', RTrim(Longtitude),'):9') googlemap from your-table

The fabrik list needs an id element, make sure to include it from your original table (and set it in the list settings)
The view is readonly, so your fabrik list linked to this view should have add,edit,delete access levels = nobody.
 
Works like a charm.
But... :)
When I click on a point, the standard googlemap popup comes out. Since I enabled the "edit" button in the table properties, also here the edit shortcut appears leading me to the form of the specified point. However, no data is being displayed in the form. (I have the admin rights).
Thanks a lot for the help so far!
Kordian
 
No, these data is for limited users only.
Actually I opened a very similar thread to this one under:
http://fabrikar.com/forums/showthread.php?t=27900
I thought that if I would be able to redirect the "edit" and "add" buttons to the real database instead of the view list, this cold solve my problem, but the redirection does not work as well.
Regards
Kordian
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top