Control Position

Home Forums MapPress Support Control Position

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13571
    factory44
    Participant

    Hi,

    We need to change the position of the Google Map controls (zoom controls, in particular), as described here: https://developers.google.com/maps/documentation/javascript/controls#ControlPositioning

    How can this be done via MapPress plugin?

    Thanks,

    #13575
    Chris
    Keymaster

    Hi,

    Unfortunately, those are one of the few API options the plugin doesn’t provide.

    You could probably set them using javascript, though. This will get the Google Map object from the first map on the screen (mapp0), or you can use the name=”xyz” parameter in the shortcode to set your own map name:

    mapp0.getMap();

    Once you have the map, use its setOptions method to set the control options as described here:

    https://developers.google.com/maps/documentation/javascript/reference

    For example:

    jQuery(document).ready(function() {
      var map = mapp0.getMap();
      map.setOptions({ panControlOptions : { position : google.maps.ControlPosition.BOTTOM_RIGHT } });
    });
    #13587
    factory44
    Participant

    Perfect – thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.