在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ayastreb/jekyll-maps开源软件地址:https://github.com/ayastreb/jekyll-maps开源编程语言:Ruby 86.7%开源软件介绍:Jekyll MapsJekyll Maps is a plugin that allows you to easily create different maps on your Jekyll site pages. It allows you to select which points to display on the map with different filters. GoogleMaps Marker Clusterer can be used if you have many points within close proximity. Installation
gem 'jekyll-maps'
plugins:
- jekyll-maps UsageConfigure Google API KeyTo be able to use Google Maps you need to obtain API Key. Once you have your API Key you need to add it to Jekyll's maps:
google:
api_key: <YOUR_KEY> Data SourceFirst, add location information to your posts YAML front-matter: location:
latitude: 51.5285582
longitude: -0.2416807 You can specify multiple locations per post: location:
- latitude: 51.5285582
longitude: -0.2416807
- latitude: 52.5285582
longitude: -2.2416807
- title: custom marker title
image: custom marker image
url: custom marker url
latitude: 51.5285582
longitude: -0.2416807 Alternatively, you can add location info to your custom collection's documents or even in data files: - title: Paris
url: http://google.fr
location:
latitude: 48.8587741
longitude: 2.2074741
- title: Madrid
url: http://google.es
location:
latitude: 40.4378698
longitude: -3.8196204 By default this plugin will display location from the page it's placed on:
But you can use src attribute to load locations from other places, like posts, collections or data files! For example, this map will show locations from all posts from 2016:
This map will show locations from a collection called 'my_collection':
This map will show locations from all data files located in 'my_points' sub-folder:
You can configure map's dimensions and assign custom CSS class to the element:
You can also just set marker coordinates directly in tag attributes:
This will create a map with single marker in given location. FiltersYou can also filter which locations to display on the map!
Marker ClusterBy default Marker Clusterer is enabled. If you have many markers on the map, it will group them and show icon with the count of markers in each cluster - see example. If you don't want to use marker cluster, you can disable it globally in maps:
google:
marker_cluster:
enabled: false Or you can disable it per single map tag:
If you have any questions or proposals - open up an issue! ExamplesWant to see it in action? Check out Demo Page! Contributing
LicenseMIT. Feel free to use, copy or distribute it. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论