Skip to content

Instantly share code, notes, and snippets.

@JayWIlsonJr
Created June 28, 2017 13:36
Show Gist options
  • Save JayWIlsonJr/84b9fb67640248b8bf1b883a0719f531 to your computer and use it in GitHub Desktop.
Save JayWIlsonJr/84b9fb67640248b8bf1b883a0719f531 to your computer and use it in GitHub Desktop.
Shows where to call for a map refresh
<div id="map">
<!-- Make sure the slide element is a child of the #map element, not a sibling -->
<div id="infoSlidePane" class="slide-up-pane"></div>
</div>
map.one(GoogleMapsEvent.MAP_READY).then(
() => {
// Now you can add elements to the map like the marker
map.addMarker(markerOptions)
.then((marker: Marker) => {
marker.showInfoWindow();
});
map.addMarker(steeplechaseMarkerOptions)
.then((steeplechaseMarker: Marker) => {
let slider = document.getElementById('infoSlidePane');
steeplechaseMarker.on('click').subscribe(data => {
slider.classList.add('slide-up'); // Slider element is positioned in the view
setTimeout(function () {
map.refreshLayout(); // When this method is called the Map's touchable regions within the view are recalculated.
}, 500);
//debugger;
});
});
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment