1

How to reset the mapView if there is a dynamic content to be showed in the snazzy window popup?

When we open the snazzywindow modal on click of the marker it populates with details, for the first time the map view doesn't set properly to the complete view of the modal but when we open for the second time the map view adjusts to the full view of the popup

stackblitz URL of the problem: https://angular-tst926.stackblitz.io/

stackblitz code: https://stackblitz.com/edit/angular-tst926

Upon launching of the stackblitz url, click on one of the marker which is closer to the top of the browser, the intial popup will not have the content but after second based on the mock response the Modal populates with the right content but the full view of the modal is blocked, but when click once again on the marker to open the window it readjusts to the full view

based on the response of the API, the calculated content would be pasted on to the modal popup and subsequently the map view should readjust to show the full modal content at first time itself instead of clicking on the marker once again

**refer to the stackblitz: https://stackblitz.com/edit/angular-tst926 for the angular version and dependent versions **

BVS
  • 421
  • 1
  • 9
  • 17

1 Answers1

0

Here's the working stackblitz: https://stackblitz.com/edit/angular-grmaew

What was needed was the following:

  1. You needed to use panOnOpen for the agm-snazzy-info-window
  2. usePanning on the agm-map
  3. call triggerResize(true) after updating the lat and lng on the map
dockleryxk
  • 407
  • 2
  • 11
  • Thanks for the reply, I've gone through the working stackblitz but it doesn't solve my problem, As per my observation it just re-center the map but doesn't show the full snazzy model content. Could you please revisit the fix once again and suggest? – BVS Aug 07 '19 at 10:00
  • I've tried above stackblitz link on Laptop hence the resolution of the screen differs, try and let me know if above link works for on laptop screen. – BVS Aug 07 '19 at 10:18
  • @BVS, there is no functionality to center on the modal content. You may be better off displaying the content to the left or the right of the marker. – dockleryxk Aug 07 '19 at 14:05