Skip to content

Commit 81d58be

Browse files
committed
Update map plugin
1 parent f7c3bfe commit 81d58be

File tree

4 files changed

+32
-17
lines changed

4 files changed

+32
-17
lines changed

Gemfile

-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ group :jekyll_plugins do
77
gem 'jekyll-feed'
88
gem 'jekyll-seo-tag'
99
gem 'jekyll-spaceship'
10-
gem 'jekyll-maps'
1110
end

_config.yaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,8 @@ exclude:
2424
- vendor/
2525
- readme.md
2626

27-
gems:
27+
plugins:
2828
- jekyll-feed
2929
- jekyll-sitemap
3030
- jekyll-seo-tag
3131
- jekyll-spaceship
32-
- jekyll-maps
33-
34-
maps:
35-
google:
36-
api_key: AIzaSyB6EQIam9lIzV6cPKGZAO2GrwTFkoKVOME

_includes/contact/0_map.html

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<div id="map" style="width:100%;height:60rem;"></div>
2+
<script>
3+
window.mapData = {"latitude": {{ include.latitude }},"longitude": {{ include.longitude }}, "zoom": {{ include.zoom}}};
4+
5+
function initMap() {
6+
var myOptions = {
7+
scrollwheel: false,
8+
draggable: false,
9+
panControl: false,
10+
disableDefaultUI: true,
11+
zoom: window.mapData.zoom,
12+
maxZoom: window.mapData.zoom,
13+
minZoom: window.mapData.zoom,
14+
center: new google.maps.LatLng(window.mapData.latitude, window.mapData.longitude),
15+
mapTypeId: google.maps.MapTypeId.ROADMAP
16+
};
17+
18+
var map = new google.maps.Map(document.getElementById('map'), myOptions);
19+
20+
var marker = new google.maps.Marker({
21+
map: map,
22+
position: new google.maps.LatLng(window.mapData.latitude, window.mapData.longitude)
23+
});
24+
25+
google.maps.event.addDomListener(window, 'resize', function() {
26+
map.setCenter(myOptions.center);
27+
});
28+
}
29+
</script>
30+
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB6EQIam9lIzV6cPKGZAO2GrwTFkoKVOME&amp;callback=initMap"></script>

_includes/contact/1_contact.html

+1-10
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,4 @@
5252
</div>
5353
</form>
5454
</div>
55-
56-
<div>
57-
{%
58-
google_map
59-
width="100%"
60-
latitude="37.28655579967086" longitude="127.0458858734021"
61-
marker_title="CILAB" marker_url="https://www.ajou.ac.kr/kr/index.do"
62-
zoom="15%"
63-
%}
64-
</div>
55+
{% include contact/0_map.html latitude=37.28655579967086 longitude=127.0458858734021 zoom=15 %}

0 commit comments

Comments
 (0)