google maps custom service.

zorzis

Member
hello,
my plan is this:
i have a table calling it Locations.
In that table i have 3 columns/elements:

  • Location_Name
  • Latitude
  • Longitude
to inform you if someone knows how to achieve this:
Latitude and Longitude are recorded in that format:

  • Latitude: N 37? 33' 39.4"
  • Longitude: E 026? 30' 22.7"
First is how can i achieve that? what i have to do in MySQL?
Second and important is this:
i want someone to enter these informations when enter that data in the form and after somehow to make the location to be viewable in the google map when clicking in the Location Name in the list view as a pop up.

how can i do that? is this possible?
and after that i want to clusster all these locations in one map.


can anyone give some help here?
thanx in advance.
 
I haven't tried such a thing but here are some ideas that might get you started.

The GoogleMap element
http://fabrikar.com/wiki/index.php/Google_map

and GoogleMap viz
http://fabrikar.com/wiki/index.php/Google_maps

does most of what you are looking for. So you just need to translate your coordinates into the format the GoogleMap element needs and enter that into your database table. You could probably do that with custom JS, a calc element, or the Form PHP plugin.

The only thing I am not sure about is displaying the map as a popup from the list. You can set it up to display in list view if that works for you.
 
thnx rackem for your help.
but can you be a bit more specific?
what methodology i need to follow so my two elements lat and long to take the coordinates as needed in my situtation?
i need to make them calc elements?
i don't get it..if have some time please give me some more help.
anyway i appreciate your time..
 
Is it an existing table or do you want to create the entries in fabrik?
Latitude and Longitude are recorded in that format:

  • Latitude: N 37? 33' 39.4"
  • Longitude: E 026? 30' 22.7"
Do you need this format?
You can configure the googlemap element to do the geocoding via coord or address info
 
yes mate i need that format (DMS).
Hugh is trying to help but as he said
" having nightmares with the regex expressions for matching DMS"
My point is that i have a table call it Location.
That table has a FK in another table that is used as my form, with a dbjoin element call it Location, that references to table Location.
People when using the Observation form, choose Locations from the dbjoin element.
But when a Location is not already recorded in the database table Location, then they need to add, using the fabrik "Add" button next to dbjoinelement.
The pop up is showing, and the Location Form is showing.
There they need to provide us with Location_Name, Latitude and Longitude in the format i told you in the other post.
Then we need that DMS input in Lat and Long to be showing in a google map.
that's my goal.
as i told hugh i don't know how to start doing this.
it's a mess for me right now...


so if you can help him or anyone else to find a solution on that issue i'll be gratefull.
thanx again.
 
It would be easy with decimal lat/long fields:

add a googlemap element to your "Location" form, set "Show Decimal lat/lng fields"=yes, "enable geocode"=no ("List settings/use static map"=yes to show the little map in list view).
When adding a new location the user will see the map and two fields for lat and long, he can drag/drop the map marker or he can type lat and long into the fields.

It should be the same with DMS lat/lng but on my site these fields are shown correctly if dragging the marker but not working correctly if used for lat/lng input.

So if you could convince your user to use decimal...
 
no mate i have to do with "hipsters' that cannot do anything else than the standard they already know.
So if the GPS machine shows :

  • Latitude: N 37? 33' 39.4"
  • Longitude: E 026? 30' 22.7"
    they have to put the same on the form.
    So i have to go with the flow.
    Biologists are people of nature as i can understand.
    I'am too. but not in the point they are ;)
    so i have to make it as better as i can to make us all happy that new year :)
    happy new year troaster.
    by the way are you man or woman?
    anyway have a nice year eve.
 
So if it has to be a "foolproof" input I would split it into 2 x 4 fields:
Dropdown N/S (E/W), integer/decimal for ?,',"; maybe some validations for min/max

+ a calculation element creating the googlemap format (lat, lng):zoom from these elements.

A happy new year, too
(BTW: woman)
 
[Thinking out loud]

I think I would tend to use a form plugin on both the main data table, and the Locations table, rather than a calc element.

This is kind of a nasty workaround for something I would like to eventually code up support for. The problem we're having here is something I've seen before. Where you want to store "fixed" (but potentially changeable) location data in one table (usually with separate lat/lon fields) and reference it through a join element on your main data table. Then use that (join related) location data in read-only map context (detail or viz view) from the main data list.

Currently we dont support that out of the box. We require a 'map' element on the main table, with the data in our proprietary format of (lat,lon):zoom, in order to display the data in any of our map plugins.

So we can't use the expected benefits of the join from main table to the location table you are using for location selection, by grabbing the the map data we need from the location table. Which is the part I'd like to modify. I'd like the map element itself to be dual purpose - either a simple map element (as it is now), or a join to a row in some other table, and some prior knowledge of how to extract the lat/lon/zoom info from that table. So we provide the options for you to specify what format the data is in (DMS, Dec, etc), and which field on the location table corespond to lat, lon, and (optionally) zoom.

However, that's not something I'm going to do overnight. So we have to work round it. And instead we have to maintain a corresponding map element on the main table, duplicating the data.

And part of the problem there is, we need to keep that duplicate data up to date. If someone edits a row in the location table, say to fix a typo in a lat/lon value, we need to find and update all the rows on the main table that use that location data.

Usually a calc might address this problem, if set with "Calc on save only" to No, so the main table calc fetches the location table data every time it is rendered, so never goes "stale". But that won't work in this case, because it HAS to be a map element, otherwise it won't be "understood" by our map plugins.

So, we're stuck with having to hack our way round this, with two form plugins. One on the main data form, which runs a query to grab the location data from the selected Location, converts the data from DMS to DD, and pokes the (lat,lon):zoom data into the (hidden) map element, on either new or edit. And one on the Location form, which (on edit only) rebuilds the map element data for any existing row on the main data table which reference the Location being edited.

-- hugh
 
That was more for Hugh and me as in we have to approve the change in the code that Troester submitted before you can get at it.
I've now approved it - so if you update from github as per instructions in the wiki that change will be available to you

-Rob
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top