javascript - Google Maps hide controls on small screens -


i want hide google maps controls on small screens. default google maps hides them @ 320px width think, need them hide on bigger width, around 400px. here 1 working example, using different code not working, syntax errors. here code:

var map = new google.maps.map(document.getelementbyid('map-canvas'), {      center: {        lat: 52.00,        lng: 10.00      },      zoom: 4,       zoomcontroloptions: {               position: google.maps.controlposition.left_top           },         maptypecontrol: true,         maptypecontroloptions: {               position: google.maps.controlposition.top_right           }    }); 

this code captures width , disables controls, , works google maps codes, not my...

$(window).width()        var width = window.innerwidth;  if(width < 400){             mapoptions.maptypecontrol = false;             maptypecontrol: false             disabledefaultui: true             delete mapoptions.maptypecontroloptions;         } 

please show me how combine these 2 codes work, tryed doing on own, im getting syntax errors.

simply hide media queries when screen gets small ;).

@media screen , (max-width: 400px) {     .gm-style-mtc {         display:none;     }     } 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -