0

Is there any way to intercept the default behavior of the full screen control using the Here Maps API Javascript?

I want to prevent the custom full screen behavior when you press the control without eliminating the UI. If the user clicks on the control the map will increase in size inside a container instead as shown in below image.

enter image description here

Thanks in advance for your valuable advice.

4
  • @here-api Is there this feature available on Here Map Javascript API ? Commented Nov 17, 2022 at 4:49
  • are you sure that you asking about Here Map Javascript API? Because the screenshot that you provided of Google Maps. Commented Nov 25, 2022 at 6:48
  • @SAlex I am asking for Here Map JavaScript API, for the reference i have attached the screenshot of Google Map Commented Dec 6, 2022 at 5:53
  • maybe you want to achieve this behavior jsfiddle.net/ybj57ovc/1 ? - There you need to tap on the map - then the map will be opened in full screen mode. Commented Dec 12, 2022 at 15:07

1 Answer 1

1

I think this question is not related to HERE APIs but to Javascript itself.

I found the solution on https://www.w3schools.com/howto/howto_js_fullscreen.asp & Failed to execute 'requestFullScreen' on 'Element': API can only be initiated by a user gesture

Simple code for test:

function openFullscreen(elem) {
    if (elem.requestFullscreen) {
      elem.requestFullscreen();
    } else if (elem.webkitRequestFullscreen) { /* Safari */
      elem.webkitRequestFullscreen();
    } else if (elem.msRequestFullscreen) { /* IE11 */
      elem.msRequestFullscreen();
    }
  }

 //when you tap on screen then is opened in fullscreen mode
 map.addEventListener('tap', () => {
      openFullscreen(document.documentElement); //open in fullscreen mode whole HTML document
      //or
      //openFullscreen(document.getElementById('mapContainer')); //open in fullscreen mode only map
      
    });

The above example was implemented here: https://jsfiddle.net/ybj57ovc/1/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.