1<#include d3_macros/>
2
3<#assign google_maps_api_key = "AIzaSyANMZqJRJ-4Fbk-ye-y0jFaGJUx6cHF_Hs"/>
4
5<#assign articleId = .vars['reserved-article-id'].data />
6
7<#assign maps_link = {
8"button_text" : languageUtil.get(locale, "com.grifols.d3.see-on-google-maps"),
9"button_link" : "https://www.google.com/maps/dir/?api=1&destination=" + x_coordinate.getData() + "," + y_coordinate.getData(),
10"button_aspect": show_link.button_aspect.getData(),
11"button_icon": "ph-map-pin",
12"button_icon_position": "left",
13"button_target": "_blank"
14} >
15
16<div class="d3-google-maps" <@addAnchorLink />>
17 <div class="container">
18 <@showIntroductionContent />
19 <div class="d3-row">
20 <#if show_link?? && show_link.getData() == "true">
21 <@showButtonRow buttonElement=maps_link/>
22 </#if>
23 <div id="map_${articleId}" class="map_canvas"></div>
24 </div>
25 </div>
26</div>
27<span class="marker-color primary-300-bg hide"></span>
28<script>
29 function mapInitialize() {
30 var myCenter = new google.maps.LatLng(${x_coordinate.getData()}, ${y_coordinate.getData()});
31 var mapOptions = {
32 center: myCenter,
33 zoom: 15,
34 mapTypeControlOptions: {
35 mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.TERRAIN],
36 style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
37 },
38 mapTypeId: google.maps.MapTypeId.ROADMAP
39 };
40 var map = new google.maps.Map(document.getElementById("map_${articleId}"),
41 mapOptions);
42
43 var marker = new google.maps.Marker({
44 position: myCenter,
45 icon: {
46 path: "M16.0005519,0 L15.9994481,0 C7.1718238,0 0,7.02365894 0,15.6689107 C0,22.9639161 8.13881127,33.3648124 14.0687847,39.1722767 C15.1726517,40.2522575 16.9653317,40.2522575 18.0691987,39.3074094 C24.000276,33.7691295 32,22.4223042 32,15.6689107 C32,7.02365894 24.8281762,0 16.0005519,0",
47 fillColor: $('.marker-color').css('background-color'),
48 fillOpacity: 1,
49 strokeWeight: 0,
50 rotation: 0,
51 scale: 1,
52 anchor: new google.maps.Point(15, 30)
53 }
54 });
55 marker.setMap(map);
56 }
57
58 window.onload = Grifols.common.utils.addScriptToHead("https://maps.googleapis.com/maps/api/js?key=${google_maps_api_key}&callback=mapInitialize");
59</script>