Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jason5ng32 committed Dec 27, 2023
1 parent 5f9b183 commit 5e53259
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion api/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ module.exports = (req, res) => {
const pp = `${latitude},${longitude};66`;
const fmt = 'jpeg';
const dpi = 'Large';
const apiKey = process.env.BING_MAP_API_KEY;

const apiKeys = (process.env.BING_MAP_API_KEY || '').split(',');
const apiKey = apiKeys[Math.floor(Math.random() * apiKeys.length)];

const url = `https://dev.virtualearth.net/REST/v1/Imagery/Map/${CanvasMode}/${latitude},${longitude}/5?mapSize=${mapSize}&pp=${pp}&key=${apiKey}&fmt=${fmt}&dpi=${dpi}&c=${language}`;


https.get(url, apiRes => {
apiRes.pipe(res);
}).on('error', (e) => {
Expand Down
7 changes: 5 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ <h2 id="IPInfo" class="col-4" :class="{'mobile-h2' : isMobile }">🕵️
:class="['btn', isDarkMode ? 'btn-dark dark-mode-refresh' : 'btn-light']">
<i class="bi bi-arrow-clockwise"></i></button>
</div>
<img v-if="isMapShown" :src="isDarkMode ? card.mapUrl_dark : card.mapUrl" class="card-img-top jn-map-image"
alt="Map">
<!-- 预加载地图 -->
<img v-if="isMapShown" :src="isDarkMode ? card.mapUrl_dark : card.mapUrl"
class="card-img-top jn-map-image" alt="Map">
<img v-if="isMapShown" :src="card.mapUrl" style="display: none;" alt="Preloaded Map">
<img v-if="isMapShown" :src="card.mapUrl_dark" style="display: none;" alt="Preloaded Dark Map">
<div class="card-body">
<ul class="list-group list-group-flush">
<li class="list-group-item jn-list-group-item" :class="{ 'dark-mode': isDarkMode }"><span
Expand Down
2 changes: 2 additions & 0 deletions public/res/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
justify-content: space-between;
align-items: center;
flex-direction: row;
border: 0;
background-color:unset;
}

.jn-alert {
Expand Down

0 comments on commit 5e53259

Please sign in to comment.