惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
LINUX DO - 热门话题
S
Secure Thoughts
TaoSecurity Blog
TaoSecurity Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threat Research - Cisco Blogs
AI
AI
B
Blog RSS Feed
S
Schneier on Security
雷峰网
雷峰网
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
Cloudbric
Cloudbric
L
LINUX DO - 最新话题
罗磊的独立博客
有赞技术团队
有赞技术团队
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
The Hacker News
The Hacker News
博客园 - Franky
Attack and Defense Labs
Attack and Defense Labs
The Cloudflare Blog
Webroot Blog
Webroot Blog
Last Week in AI
Last Week in AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 叶小钗
美团技术团队
L
Lohrmann on Cybersecurity
T
The Blog of Author Tim Ferriss
The Last Watchdog
The Last Watchdog
T
Troy Hunt's Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
Know Your Adversary
Know Your Adversary
O
OpenAI News
博客园 - 【当耐特】
Hacker News - Newest:
Hacker News - Newest: "LLM"
C
Cybersecurity and Infrastructure Security Agency CISA
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
www.infosecurity-magazine.com
www.infosecurity-magazine.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
PCI Perspectives
PCI Perspectives
H
Heimdal Security Blog
I
InfoQ
GbyAI
GbyAI
T
Threatpost
C
Cisco Blogs

🛫Qifei's Blog

Python的模块构建和调用方式 - 🛫Qifei's Blog 如何选择搭建梯子用的VPS? - 🛫Qifei's Blog 机器学习和scikit-learn库基础学习笔记 - 🛫Qifei's Blog 利用国内服务器加速v2ray访问速度和规避检查 - 🛫Qifei's Blog Matplotlib_Bar3d绘制彩色带颜色标尺的3D柱形图 - 🛫Qifei's Blog Linux后台运行nostr虚荣公钥的挖掘 - 🛫Qifei's Blog Hexo博客添加Nostr_NIP-05认证 - 🛫Qifei's Blog Nostr_NIP-05认证服务简介和配置 - 🛫Qifei's Blog Onedrive_API大文件上传记录 - 🛫Qifei's Blog 反爬虫-如何检测有没有使用Puppeteer - 🛫Qifei's Blog Vuejs学习笔记 - 🛫Qifei's Blog OpenOffice连接Mysql数据库 - 🛫Qifei's Blog 安卓ToyVPN服务端从零开始读 - 🛫Qifei's Blog 在控制器中用JS验证CSS_Selector和Xpath - 🛫Qifei's Blog RWTH自习室自动预定程序(RWTH_Lernraum) - 🛫Qifei's Blog RWTH自习室自动预定程序(RWTH_Lernraum) - 🛫Qifei's Blog 如何利用Selenium实现更加高效的爬虫 - 🛫Qifei's Blog Python如何准确的计算Http请求中的Content_Length - 🛫Qifei's Blog 破解图片等资源跨域和防盗链阻拦 - 🛫Qifei's Blog Selenium-Webdriver接口 - 🛫Qifei's Blog
Hexo博客页面引入足迹地图 - 🛫Qifei's Blog
Qifei · 2023-12-02 · via 🛫Qifei's Blog

0. 先看效果

这个地图是基于jvectormap.com制作的。地图制作,需要在hexo博客目录source路径下新建footprint文件夹。

1. 依赖下载

将jvectormap的依赖js代码和css代码下载到文件根目录。

文件路径结构形如:

1
2
3
4
5
6
7
8
9
- source
- _post
- _data
- footprint
- index.html
- jquery-jvectormap-2.0.5.css
- jquery-jvectormap-2.0.5.min.js
- jquery-jvectormap-europe-mill.js
- jquery.min.js

jquery-jvectormap下载地址在:https://jvectormap.com/download/

jquery可到jsdeliver搜索下载。

矢量地图下载地址:https://jvectormap.com/maps/world/europe/

本文以欧洲地图jquery-jvectormap-europe-mill.js 为例。

2. 地图制作

在index.html中编辑地图

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html>

<head>
<title>jVectorMap demo</title>

</head>

<body>
<div id="map" style="width: 600px; height: 400px"></div>
<script src="footprint/jquery.min.js"></script>
<link rel="stylesheet" href="footprint/jquery-jvectormap-2.0.5.css" />
<script src="footprint/jquery-jvectormap-2.0.5.min.js"></script>
<script type="text/javascript" src="footprint/jquery-jvectormap-europe-mill.js"></script>
<script>
$(function () {
$('#map').vectorMap({
map: 'europe_mill',
markerStyle: {
initial: {
fill: '#F8E23B',
stroke: '#383f47'
}
},
backgroundColor: '#383f47',
markers: [
{ latLng: [68.350273, 18.830460], name: 'Abisko, Sweden' },
{ latLng: [35.1746503, 33.3638783], name: 'Nicosia, Nicosia District, Cyprus' },
]
});
});
</script>
</body>

</html>

latLng变量是经纬度,可在网上搜索地址转经纬度的办法。

3. 博客配置

制作好地图之后,需要修改地图配置文件,来防止html代码被渲染。

打开博客根目录下的_config.yml文件,

修改skip_render的内容:

1
2
skip_render: 
- 'footprint/**/*'

4. 引用足迹地图

在配置好步骤三之后,部署的博客,应当可以使用https://yourblogsite.com/footprint的形式网址访问到地图了。

此时可以在任意post或者page直接通过添加html iframe代码嵌入地图到markdown文本中,例如,在我的about.md,关于页面的文件里,我在我想要嵌入的位置添加代码:

1
<iframe style="max-width: 100%" frameborder="no" border="0" marginwidth="0" marginheight="0" width="100%" height="400px"src="/footprint"></iframe>

部署后的页面如下:https://blog.sci.ci/about

5. 参考

Getting started

Hexo添加jVectorMap足迹地图