Skip to content

Commit

Permalink
fix #172
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Aug 8, 2024
1 parent 12521ed commit 6ffd964
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions auctions/templates/auction.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@

{% if not auction.no_location %}
<script
src="https://maps.googleapis.com/maps/api/js?key={{google_maps_api_key}}&callback=initMap&libraries=&v=weekly"
src="https://maps.googleapis.com/maps/api/js?key={{google_maps_api_key}}&callback=initMap&libraries=&v=weekly&libraries=marker"
async
></script>
<script>

function initMap() {
var map;
var bounds = new google.maps.LatLngBounds();
var mapOptions = {};
var mapOptions = {mapId:"location_map"};
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
var markers = [
{% for location in pickup_locations %}
Expand All @@ -97,14 +97,14 @@
];

var infoWindow = new google.maps.InfoWindow(), marker, i;

for( i = 0; i < markers.length; i++ ) {
var position = new google.maps.LatLng(markers[i][1], markers[i][2]);
bounds.extend(position);
marker = new google.maps.Marker({
marker = new google.maps.marker.AdvancedMarkerElement({
position: position,
map: map,
title: markers[i][0]
title: markers[i][0],
});

// Allow each marker to have an info window
Expand Down
7 changes: 4 additions & 3 deletions auctions/templates/clubs.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{% block extra_js %}
<script
src="https://maps.googleapis.com/maps/api/js?key={{google_maps_api_key}}&callback=initMap&libraries=&v=weekly"
src="https://maps.googleapis.com/maps/api/js?key={{google_maps_api_key}}&callback=initMap&libraries=&v=weekly&libraries=marker"
async
></script>
<script type='text/javascript'>pageView();</script>
Expand All @@ -21,7 +21,8 @@
function initMap() {
var map;
var bounds = new google.maps.LatLngBounds();
map = new google.maps.Map(document.getElementById("map_canvas"));
var mapOptions = {mapId:"club_map"};
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
{% if has_user_location %}
map.setZoom(8);
map.setCenter({lat:{{ latitude }}, lng:{{ longitude }}});
Expand Down Expand Up @@ -51,7 +52,7 @@
for( i = 0; i < markers.length; i++ ) {
var position = new google.maps.LatLng(markers[i][1], markers[i][2]);
bounds.extend(position);
marker = new google.maps.Marker({
marker = new google.maps.marker.AdvancedMarkerElement({
position: position,
map: map,
title: markers[i][0]
Expand Down
7 changes: 4 additions & 3 deletions auctions/templates/user_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block extra_js %}
<script
src="https://maps.googleapis.com/maps/api/js?key={{google_maps_api_key}}&callback=initMap&libraries=&v=weekly"
src="https://maps.googleapis.com/maps/api/js?key={{google_maps_api_key}}&callback=initMap&libraries=&v=weekly&libraries=marker"
async
></script>
<script type='text/javascript'>pageView();</script>
Expand All @@ -13,7 +13,8 @@
function initMap() {
var map;
var bounds = new google.maps.LatLngBounds();
map = new google.maps.Map(document.getElementById("map_canvas"));
var mapOptions = {mapId:"user_map"};
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
map.setZoom(4);
map.setCenter({lat:39, lng:-97});
// Multiple Markers
Expand All @@ -38,7 +39,7 @@
for( i = 0; i < markers.length; i++ ) {
var position = new google.maps.LatLng(markers[i][1], markers[i][2]);
bounds.extend(position);
marker = new google.maps.Marker({
marker = new google.maps.marker.AdvancedMarkerElement({
position: position,
map: map,
title: markers[i][0]
Expand Down

0 comments on commit 6ffd964

Please sign in to comment.