wip infowindow is centered
This commit is contained in:
@@ -26,13 +26,9 @@ function attach_info_window(map, marker, events, infowindow) {
|
||||
|
||||
marker.addListener('click', () => {
|
||||
|
||||
// test :
|
||||
//marker.setMap(null);
|
||||
|
||||
let view_center = map.getCenter();
|
||||
let marker_position = marker.getPosition();
|
||||
console.log("marker position: " + marker_position);
|
||||
let window_position = view_center;
|
||||
// height must be half css value (mp_info_windows.css -> '--size: XXXpx;')
|
||||
let window_offset = { width: 0, height: 150 };
|
||||
|
||||
infowindow.setOptions({
|
||||
//disableAutoPan: true,
|
||||
@@ -44,11 +40,8 @@ function attach_info_window(map, marker, events, infowindow) {
|
||||
//minWidth: 400,
|
||||
|
||||
/* center window */
|
||||
position: window_position,
|
||||
|
||||
/* center window */
|
||||
//position: (map.getCenter()),
|
||||
//pixelOffset: { width: 50, height: 50 },
|
||||
position: view_center,
|
||||
pixelOffset: window_offset,
|
||||
|
||||
//shouldFocus: false,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user