Determine the Center of the Map by Customer Location in Mapply

Mapply allows you to customize the look and feel of your map. Here, you can determine the center of the map's display by your customer's location.

 Caution

At this time, Mapply is unavailable for new installations. If you are currently using Mapply, you will be able to continue using the app as your account will now be grandfathered.

 


 

Adjusting The Map

  1. Visit the Mapply Account Page. Log in if necessary.

    log in

  2. Select Display Settings.

    select display settings

  3. Copy and paste this code into the Page Footer HTML section of the Display Settings:
    <script>
    jQuery(document).ready(function(){
    var infoWindow = new google.maps.InfoWindow({map: map});
     navigator.geolocation.getCurrentPosition(function(position) {
     var pos = {
     lat: position.coords.latitude,
     lng: position.coords.longitude
     };
    
     infoWindow.setPosition(pos);
     infoWindow.setContent('Location found.');
     map.setCenter(pos);
     jQuery('.search_bar button').click();
     }, function() {
     handleLocationError(true, infoWindow, map.getCenter());
     });
    
     function handleLocationError(browserHasGeolocation, infoWindow, pos) {
     infoWindow.setPosition(pos);
     infoWindow.setContent(browserHasGeolocation ?
     'Error: The Geolocation service failed.' :
     'Error: Your browser doesn\'t support geolocation.');
     }
    });
    </script>

    copy and paste this code

  4. Select Save.

    select save

Was this article helpful?
0 out of 0 found this helpful