googlemap pluging Element - Change Request

altnetwork

Member
I found that if I do the following: (googlemap plug-in element)

1. Replace the information in the , googlemap plug-in (Default location tab), [Default lat] field with the element that has the Latitude - {new_jersey_cemetery___latitude}.

2. Replace the information in the, googlemap plug-in element (Default location tab), [Default lon] field with the element that has the Longitude - {new_jersey_cemetery___longitude}

3. The data field for the googlemap plug-in element is set at NULL on the database

That when saving the record the googlemap plugin element will read the information from the element {new_jersey_cemetery___latitude} and the element {new_jersey_cemetery___longitude} and record in the googlemap plug-in element in the record.

What I am finding is that after saving the record once it will not save any changes made to the two elements, {new_jersey_cemetery___latitude} and {new_jersey_cemetery___longitude}, in the googlemap plug-in element.

I also found that if element if blank, not NULL, it will also not save any changes.

I found that it will only save the information to the googlemap plug-in element if the data field on the database is set to NULL.

Changes can be still made by hand if the [Show Decimal lat/log fields] is set to yes.

Changes requested:

I would like to be able to make changes in the latitude, [text element], and the longitude, [text element] and if the changes update the location information in the googlemap element.

1. Can the information on the, (googlemap Plug-in), Default location tab in the [Default lat] and [Default lon] fields be set to save the information on every save?
 
Element defaults are only applied on form load if you are adding a new record. You can't use placeholders.
On save it's saving whatever the user has set.

I assume you are looking for geocoding:
If you set Enable Geocode = yes you'll get a field above the map where the user can add lat/long or an address to set the marker position.
 
No, users will not be entering any data. The information is being pulled by other element fields. This is what I need. Can you add setting to set the default field to do what I am looking for as an option or add a section to be able to pull the two fields for other elements as described?
 
Last edited:
You can add a php form plugin and update your googlemap element on Save
http://fabrikar.com/forums/index.php?wiki/php-form-plugin/#updating-a-form-s-value-on-save

The format used for the Googlemap element is (lat,lon):zoom
so something like
Code:
$lat=$formModel->formData['tablename___your-lat'];
$lon=$formModel->formData['tablename___your-lon'];
$gmstring = '(' . $lat . ',' . $lon . '):10';
$formModel->updateFormData('tablename___your-gmelement',$gmstring,true);
 
Thanks, That worked!

NOW: Can the option be added under Default Location to select [None] along with [Users location] and [Coordinates] so it will not save any default information?

SECOND: In addition to the php form plugin, can there be a option if lat or lon are blank to not updateFormData?

Thank You!

You can add a php form plugin and update your googlemap element on Save
http://fabrikar.com/forums/index.php?wiki/php-form-plugin/#updating-a-form-s-value-on-save

The format used for the Googlemap element is (lat,lon):zoom
so something like
Code:
$lat=$formModel->formData['tablename___your-lat'];
$lon=$formModel->formData['tablename___your-lon'];
$gmstring = '(' . $lat . ',' . $lon . '):10';
$formModel->updateFormData('tablename___your-gmelement',$gmstring,true);
 
Can you post what you want to achieve with the Googlemap element?

It seems you don't need it in your form, where do you want to show/use it: in details view, in list view, in a visualisation?
What do you expect to see if it's empty/blank/NULL/whatever?
 
Sorry, Don't understand what you are asking.

I fill out the form which is where it gets its information (lat, lon). But when it is blank I would like it to stay as NULL. I see where I can set the option for the php form not to save the information. But again, the googlemap element will post the default location. This I would like an option to not post. This way the database field will stay NULL and the record when viewed will say [No destination selected].

How this helps explain what a I am looking for.

Can you post what you want to achieve with the Googlemap element?

It seems you don't need it in your form, where do you want to show/use it: in details view, in list view, in a visualisation?
What do you expect to see if it's empty/blank/NULL/whatever?
 
OK, then no, we can't set the coords to "nothing". If the map is being displayed, we have to set coords for the marker, and those will get submitted with the form and recorded in the table. Modifying the plugin so the coords could be not set, and no marker displayed on the map, would require quite a lot of coding, as there are lots of places in the code where the presence of a marker is assumed, which would break if there wasn't one.

If you are interested in funding the work, I can give you an estimate of the cost.

-- hugh
 
Then how would it work if the map did not show in the form? Can you do this?

OK, then no, we can't set the coords to "nothing". If the map is being displayed, we have to set coords for the marker, and those will get submitted with the form and recorded in the table. Modifying the plugin so the coords could be not set, and no marker displayed on the map, would require quite a lot of coding, as there are lots of places in the code where the presence of a marker is assumed, which would break if there wasn't one.

If you are interested in funding the work, I can give you an estimate of the cost.

-- hugh
 
Thinking about it, we can't even just display the map (in details or list views) without a location. It'll always create a marker, probably at lat/lon 0, 0 if there's no data.

The map element is built to set and show a location, there simply is no option to not show one.



Sent from my HTC6545LVW using Tapatalk
 
Thanks for the help. I was able to create a work around for what I was looking for.

Thinking about it, we can't even just display the map (in details or list views) without a location. It'll always create a marker, probably at lat/lon 0, 0 if there's no data.

The map element is built to set and show a location, there simply is no option to not show one.



Sent from my HTC6545LVW using Tapatalk
 
Every element has that, controls whether the element writes data to the db or not.

Sent from my HTC6545LVW using Tapatalk
 
How is this done? I saw this on the google maps element and selected it to no save to db. But when I used the php form to save in that field it would not save.

Every element has that, controls whether the element writes data to the db or not.

Sent from my HTC6545LVW using Tapatalk
 
Correct. If that option is selected, we don't store that element's value. You would have to write a value out by hand, in an onAfterProcess hook in the php firm plugin.

Sent from my HTC6545LVW using Tapatalk
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top