Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #458710

    on the google widget there is an option to choose which kind of maptype will be shown and frontend user has the oportunity to change it.
    (Satelite, Terrain etc)

    i found it in javascript and can change it for me:

    line 504 (newest Enfold) of shortcodes.js :

    			this.mapVars = {
    				mapMaker: false, //mapmaker tiles are user generated content maps. might hold more info but also be inaccurate
    				mapTypeControl: true,
    				backgroundColor:'transparent',
    				streetViewControl: false,
    				panControl: this.$data.pan_control,
    				zoomControl: this.$data.zoom_control,
    				draggable: mobile_drag,
    				scrollwheel: false,
    				zoom: zoomValue,
    				mapTypeId:google.maps.MapTypeId.ROADMAP,
    				center: new google.maps.LatLng(this.$data.marker[0].lat, this.$data.marker[0].long),
    				styles:[{featureType: "poi", elementType: "labels", stylers: [ { visibility: "off" }] }]
    			};

    setting mapTypeControl to true will do the trick.
    it will be nice to have similar to zoomControl and panContol for the google map on pages/post to have the choice to set it or get rid of it.

    or to get here something like this:
    mapTypeControl: this.$data.maptype_control,

    is there a way to get mapTypeControl: true
    via child theme functions.php ?

    i don’t want to change it everytime i’m updating the theme

    • This topic was modified 9 years, 5 months ago by Guenni007.
    #459781

    Hey!

    As of right now it’s not possible, unless you enqueue a child js/shortcode.js:

    function change_shortcodesjs() {
       wp_dequeue_script( 'avia-shortcodes' );
       wp_enqueue_script( 'avia-shortcodes-child', get_stylesheet_directory_uri().'/js/shortcodes.js', array('jquery'), 2, true );
    }
    add_action( 'wp_enqueue_scripts', 'change_shortcodesjs', 100 );
    

    Nevertheless you could request that as a new option for the widget here.

    Best regards, 
    Josue

    #459881

    thanks Josue – can you please have a look to this:

    https://kriesi.at/support/topic/adding-on-google-maps-a-select-box-for-maptypeid/

    the selectbox is working and i managed that only if the checkbox of maptype-control is checked the selectbox is seen.
    but i don’t know how to set this value of the select box to the MapTypeID. definitly i have to change something in shortcodes.js but i really don’t know what. Perhaps i can not see the wood for the trees.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘mapTypeControl too on pages/posts’ is closed to new replies.