From 531d4627daffbce252c63b580f5e8fa2c922c983 Mon Sep 17 00:00:00 2001 From: Corban-Lee <77944149+Corban-Lee@users.noreply.github.com> Date: Wed, 22 Nov 2023 00:24:25 +0000 Subject: [PATCH] google places api --- src/mainapp/templates/index.html | 10 ++++---- src/static/js/mainapp/venues.js | 39 ++++++++++++++++++++++++++++++++ src/static/scss/base.scss | 4 ++++ 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/mainapp/templates/index.html b/src/mainapp/templates/index.html index 8f228ff..e201a44 100644 --- a/src/mainapp/templates/index.html +++ b/src/mainapp/templates/index.html @@ -218,12 +218,12 @@
- -
+
@@ -392,8 +392,8 @@ const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl, {trigger : 'hover'})) diff --git a/src/static/js/mainapp/venues.js b/src/static/js/mainapp/venues.js index 2b54b48..98f6366 100644 --- a/src/static/js/mainapp/venues.js +++ b/src/static/js/mainapp/venues.js @@ -61,13 +61,52 @@ async function initMap() { disableDefaultUI: true, }); + window.initAutocomplete(); + // const marker = new AdvancedMarkerElement({ // map: map, // position: position, // title: "Test" // }); + + + + // const infoWindow = new google.maps.InfoWindow(); + // const infoWindowContent = $("#venueSearchResults")[0] + // infoWindow.setContent(infoWindowContent); + + // autoComplete.addListener("place_changed", () => { + // // infoWindow.close(); + + // const place = autoComplete.getPlace(); + // alert(JSON.stringify(place, null, 4)); + + + // if (!place.geometry || !place.geometry.location) { + // alert("Couldn't find place"); + // return; + // } + + + // }); } +let autocomplete; + +function initAutocomplete() { + + autocomplete = new google.maps.places.Autocomplete( + $("#venueSearch")[0], + { + fields: ["address_components", "geometry"], + types: ["address"], + strictBounds: false + } + ) +} + +window.initAutocomplete = initAutocomplete; + $(document).ready(function() { initMap(); }); \ No newline at end of file diff --git a/src/static/scss/base.scss b/src/static/scss/base.scss index 586ce6a..92de54a 100644 --- a/src/static/scss/base.scss +++ b/src/static/scss/base.scss @@ -266,6 +266,10 @@ $body-bg :#000; } +.pac-container { + z-index: 9999 !important; +} + // .card-badge-container { // position: relative;