6 |
6 |
<?php include_metas() ?>
|
7 |
7 |
<title><?php echo ($op_config['sns_title']) ? $op_config['sns_title'] : $op_config['sns_name'] ?></title>
|
8 |
8 |
<?php echo $op_config->get('pc_html_head') ?>
|
9 |
|
<?php if (isset($op_config['google_AJAX_search_api_key']) && isset($op_config['google_maps_api_key'])): ?>
|
10 |
|
<?php use_javascript('http://www.google.co.jp/uds/api?file=uds.js&v=1.0&key='.$op_config['google_AJAX_search_api_key']) ?>
|
11 |
|
<?php use_javascript('http://maps.google.co.jp/maps?file=api&v=2.x&key='.$op_config['google_maps_api_key']) ?>
|
|
9 |
<?php if (isset($op_config['google_maps_api_key'])): ?>
|
|
10 |
<?php use_javascript('http://maps.google.com/maps/api/js?sensor=true&key='.$op_config['google_maps_api_key']) ?>
|
|
11 |
<?php include_stylesheets() ?>
|
|
12 |
<?php include_javascripts() ?>
|
12 |
13 |
<?php
|
13 |
14 |
$googlemaps_script = <<<EOM
|
14 |
15 |
// parse request parameters
|
... | ... | |
27 |
28 |
}
|
28 |
29 |
request[n] = v;
|
29 |
30 |
}
|
30 |
|
var MapType = %s; // It is not user-inputed values
|
31 |
31 |
|
32 |
|
var gls;
|
33 |
|
var gMap;
|
34 |
|
function OnLocalSearch() {
|
35 |
|
if (!gls.results) return;
|
36 |
|
var first = gls.results[0];
|
37 |
|
var point = new GLatLng(parseFloat(first.lat), parseFloat(first.lng));
|
38 |
|
var zoom = request.z;
|
39 |
|
gMap.addControl(new GSmallMapControl());
|
40 |
|
gMap.addControl(new GMapTypeControl());
|
41 |
|
gMap.setMapType(MapType);
|
42 |
|
gMap.setCenter(point, zoom);
|
43 |
|
var marker = new GMarker(point);
|
44 |
|
gMap.addOverlay(marker);
|
45 |
|
geocoder = new GClientGeocoder();
|
46 |
|
}
|
47 |
32 |
function load() {
|
48 |
|
if (GBrowserIsCompatible()) {
|
49 |
|
if ((request.x == 0) && (request.y == 0)){
|
50 |
|
gMap = new GMap2(document.getElementById('map'));
|
51 |
|
gMap.addControl(new GSmallMapControl());
|
52 |
|
gMap.addControl(new GMapTypeControl());
|
53 |
|
gMap.setCenter(new GLatLng(0, 0));
|
54 |
|
gls = new GlocalSearch();
|
55 |
|
gls.setCenterPoint(gMap);
|
56 |
|
gls.setSearchCompleteCallback(null, OnLocalSearch);
|
57 |
|
var q = request.q;
|
58 |
|
gls.execute(q);
|
59 |
|
} else {
|
60 |
|
var point = new GLatLng(request.x, request.y);
|
61 |
|
var zoom = request.z;
|
62 |
|
gMap = new GMap2(document.getElementById('map'));
|
63 |
|
gMap.addControl(new GSmallMapControl());
|
64 |
|
gMap.addControl(new GMapTypeControl());
|
65 |
|
gMap.setCenter(point, zoom);
|
66 |
|
gMap.setMapType(MapType);
|
67 |
|
var marker = new GMarker(point);
|
68 |
|
gMap.addOverlay(marker);
|
69 |
|
geocoder = new GClientGeocoder();
|
70 |
|
}
|
|
33 |
var gMap;
|
|
34 |
if ((request.x == 0) && (request.y == 0)){
|
|
35 |
gMap = new google.maps.Map(document.getElementById('map'), {
|
|
36 |
center: new google.maps.LatLng(0, 0)
|
|
37 |
});
|
|
38 |
} else {
|
|
39 |
var point = new google.maps.LatLng(request.x, request.y);
|
|
40 |
var zoom = request.z;
|
|
41 |
gMap = new google.maps.Map(document.getElementById('map'), {
|
|
42 |
center: point,
|
|
43 |
zoom: zoom,
|
|
44 |
mapTypeId: google.maps.MapTypeId.%s
|
|
45 |
});
|
|
46 |
var marker = new google.maps.Marker({
|
|
47 |
position: point,
|
|
48 |
map: gMap
|
|
49 |
});
|
71 |
50 |
}
|
72 |
51 |
}
|
|
52 |
google.maps.event.addDomListener(window, 'load', load);
|
73 |
53 |
EOM;
|
74 |
54 |
echo javascript_tag(sprintf($googlemaps_script, $mapType)); ?>
|
75 |
55 |
<?php endif; ?>
|
76 |
|
<?php include_stylesheets() ?>
|
77 |
|
<?php include_javascripts() ?>
|
78 |
56 |
</head>
|
79 |
|
<body onload="load()" onunload="GUnload()" id="page_googlemaps_index" class="<?php echo opToolkit::isSecurePage() ? 'secure_page' : 'insecure_page' ?>">
|
|
57 |
<body id="page_googlemaps_index" class="<?php echo opToolkit::isSecurePage() ? 'secure_page' : 'insecure_page' ?>">
|
80 |
58 |
<div id="map" style="width: 300px; height: 320px"></div>
|
81 |
59 |
</body>
|
82 |
60 |
</html>
|