Hello,
I'm using mosmap for displaying the google map. I have used the beforeRender plugin to display the map. Thats works fine. Now I want to know how I can transfer the current location (longitude and latitude) that the user entered to the map?
My beforeRender code:
$lat = $fields['latitude']->value;
$lon = $fields['longitude']->value;
$fields['test']->form = "{mosmap width='500'|height='300'|lat=$lat|lon=$lon|zoom='9'|text='Los Angeles'}";
That is working fine, but it is only loading after the first page load.
Now the user can enter a new location but the map still displayed the default location.
I have also add a JS for example to the latitude field which detects the change, but I can't transfer the current value to the map.
jQuery('#latitude').on('input', function() {
alert(document.getElementById("latitude").value);
});
How I can reload the before render plugin or how I can use the new values for displaying on the map? Any ideas? Thanks.