• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Change Google map location by drop down

Change Google map location by drop down 7 years 1 month ago #36720

I'm Trying to change location map by selecting dropdown with following code:
<script type="text/javascript">
function initialize() {
 var map = new google.maps.Map(document.getElementById('rsform-map1213'));
  var geocoder = new google.maps.Geocoder();
  $('#Building').change(function() {
    var address = $('#Building').find(':selected').text();
    geocodeAddress(address, geocoder, map);
  });
  var address = $('#Building').find(':selected').text();
  geocodeAddress(address, geocoder, map);
}
 
function geocodeAddress(address, geocoder, resultsMap) {
 
  geocoder.geocode({
    'address': address
  }, function(results, status) {
    if (status === google.maps.GeocoderStatus.OK) {
      resultsMap.fitBounds(results[0].geometry.viewport);
 
    } else {
      alert('Geocode was not successful for the following reason: ' + status);
    }
  });
}
</script>

but the location is not changing!
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!