/
ce_dlh_googlemaps_default.html5
176 lines (136 loc) · 6.15 KB
/
ce_dlh_googlemaps_default.html5
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
if($_COOKIE['dlh_googlemaps'] || $this->map['protected']!='1'):
$GLOBALS['TL_JAVASCRIPT'][] = 'https://maps.googleapis.com/maps/api/js?key=' . $this->map['key'] . '&language=' . $this->map['language'];
$this->map['privacy'] == '';
endif;
?>
<!-- indexer::stop -->
<div class="<?= $this->class; ?> block"<?= $this->cssID; ?><?php if ($this->style): ?> style="<?= $this->style; ?>"<?php endif; ?>>
<?php if ($this->headline): ?>
<<?= $this->hl; ?>><?= $this->headline; ?></<?= $this->hl; ?>>
<?php endif; ?>
<div class="dlh_googlemap block" id="dlh_googlemap_<?= $this->map['id']; ?>" style="<?= $this->map['mapSize']['position'].$this->map['mapSize']['width'].$this->map['mapSize']['height'].$this->map['mapSize']['padding']; ?>"><?php if($_COOKIE['dlh_googlemaps'] || $this->map['protected']!='1'): ?><noscript><p><?= ($this->map['staticMapNoscript'] ? $this->map['staticMap'] : $this->labels['noscript']); ?></p></noscript><?php else: ?><div id="confirm-googlemaps" onClick="gmap<?= $this->map['id']; ?>_allow()"><?php echo ($this->map['protected']=='1' && $this->map['privacy']=='') ? $this->labels['privacy'] : $this->map['privacy']; ?></div><?php endif; ?></div>
<script>
function gmap<?= $this->map['id']; ?>_allow() {
document.cookie = 'dlh_googlemaps=ok; max-age=<?= $GLOBALS['TL_CONFIG']['dlh_googlemaps']['cookiedays']; ?> ; path=/';
var mapsSrc = document.createElement('script');
mapsSrc.type = 'text/javascript';
mapsSrc.src = 'https://maps.googleapis.com/maps/api/js?key=<?= $this->map['key']; ?>&language=<?= $this->map['language']; ?>';
document.getElementsByTagName('head')[0].appendChild(mapsSrc);
window.setTimeout("gmap<?= $this->map['id']; ?>_initialize()", 500);
}
function gmap<?= $this->map['id']; ?>_initialize() {
if(!window.google){
return false;
}
var gmap<?= $this->map['id']; ?>_Options = {
zoom: <?= $this->map['zoom']; ?>
, center: new google.maps.LatLng(<?= $this->map['center']; ?>)
, mapTypeId: google.maps.MapTypeId.<?= $this->map['mapTypeId']; ?>
, draggable: <?= $this->map['draggable']; ?>
, disableDoubleClickZoom: <?= $this->map['disableDoubleClickZoom']; ?>
, scrollwheel: <?= $this->map['scrollwheel']; ?>
<?php if ($this->map['useMapTypeControl']) : ?>
, mapTypeControl: true
, mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.<?= $this->map['mapTypeControlStyle']; ?>
, position: google.maps.ControlPosition.<?= $this->map['mapTypeControlPos']; ?>
<?php if (is_array($this->map['mapTypesAvailable'])) : ?>
, mapTypeIds: [
<?php foreach($this->map['mapTypesAvailable'] as $k=>$v) : ?>
<?php if($k>0) echo ','; ?>google.maps.MapTypeId.<?= $v; ?>
<?php endforeach; ?>
]
<?php endif; ?>
}
<?php else : ?>
, mapTypeControl: false
<?php endif; ?>
<?php if ($this->map['useOverviewMapControl']) : ?>
, overviewMapControl: true
, overviewMapControlOptions: {
opened: <?= ($this->map['overviewMapControlOpened'] ? 'true':'false'); ?>
}
<?php else : ?>
, overviewMapControl: false
<?php endif; ?>
<?php if ($this->map['useStreetViewControl']) : ?>
, streetViewControl: true
, streetViewControlOptions: {
position: google.maps.ControlPosition.<?= $this->map['streetViewControlPos']; ?>
}
<?php else : ?>
, streetViewControl: false
<?php endif; ?>
<?php if ($this->map['useRotateControl']) : ?>
, rotateControl: true
, rotateControlOptions: {
position: google.maps.ControlPosition.<?= $this->map['rotateControlPos']; ?>
}
<?php else : ?>
, rotateControl: false
<?php endif; ?>
<?php if ($this->map['usePanControl']) : ?>
, panControl: true
, panControlOptions: {
position: google.maps.ControlPosition.<?= $this->map['panControlPos']; ?>
}
<?php else : ?>
, panControl: false
<?php endif; ?>
<?php if ($this->map['useZoomControl']) : ?>
, zoomControl: true
, zoomControlOptions: {
style: google.maps.ZoomControlStyle.<?= $this->map['zoomControlStyle']; ?>,
position: google.maps.ControlPosition.<?= $this->map['zoomControlPos']; ?>
}
<?php else : ?>
, zoomControl: false
<?php endif; ?>
<?php if ($this->map['useScaleControl']) : ?>
, scaleControl: true
, scaleControlOptions: {
position: google.maps.ControlPosition.<?= $this->map['scaleControlPos']; ?>
}
<?php else : ?>
, scaleControl: false
<?php endif; ?>
<?php if ($this->map['parameter']) : ?>
, <?= $this->map['parameter']; ?>
<?php endif; ?>
};
google.maps.event.addDomListener(window, 'resize', function() {
var center = gmap<?= $this->map['id'];?>.getCenter();
google.maps.event.trigger(gmap<?= $this->map['id'];?>, 'resize');
gmap<?= $this->map['id'];?>.setCenter(center);
});
var gmap<?= $this->map['id']; ?> = new google.maps.Map(document.getElementById("dlh_googlemap_<?= $this->map['id']; ?>"), gmap<?= $this->map['id']; ?>_Options);
var gmap<?= $this->map['id']; ?>_markers = [];
<?php if ($this->map['moreParameter']) : echo $this->map['moreParameter']; endif; ?>
<?php
// Auto-generated map elements
foreach($this->map['elements'] AS $element) : echo $element['parsed']; endforeach; ?>
if(window.gmap<?= $this->map['id']; ?>_dynmap){
gmap<?= $this->map['id']; ?>_dynmap(gmap<?= $this->map['id']; ?>);
}
<?php if($this->map['useClusterer']): ?>
var gmap<?= $this->map['id']; ?>_markerCluster = new MarkerClusterer(gmap<?= $this->map['id']; ?>, gmap<?= $this->map['id']; ?>_markers, {imagePath: '<?= $this->map[clusterImg]; ?>/m'});
<?php endif; ?>
<?php
// tabcontrol
echo $this->tabs ? $this->map['tabsCode'] : ''; ?>
}
if(window.addEvent) {
window.addEvent('domready', function() {
gmap<?= $this->map['id']; ?>_initialize();
});
} else if(typeof jQuery == "function") {
jQuery(document).ready(function(){
gmap<?= $this->map['id']; ?>_initialize();
});
} else {
window.setTimeout("gmap<?= $this->map['id']; ?>_initialize()", 500);
}
</script>
</div>
<!-- indexer::continue -->