|
|
|
@ -31,6 +31,8 @@
|
|
|
|
|
break;
|
|
|
|
|
case 'center':
|
|
|
|
|
map.setCenter(new google.maps.LatLng(e.data.lat, e.data.lon));
|
|
|
|
|
marker.setPosition( new google.maps.LatLng( e.data.lat, e.data.lon ) );
|
|
|
|
|
map.panTo( new google.maps.LatLng( e.data.lat, e.data.lon ) );
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.log('message error');
|
|
|
|
@ -47,24 +49,24 @@
|
|
|
|
|
window.onload = loadMapScript;
|
|
|
|
|
|
|
|
|
|
var map;
|
|
|
|
|
var marker;
|
|
|
|
|
|
|
|
|
|
function initialize() {
|
|
|
|
|
|
|
|
|
|
var mapOptions = {
|
|
|
|
|
zoom: 17,
|
|
|
|
|
zoomControl: false,
|
|
|
|
|
streetViewControl: false,
|
|
|
|
|
// mapTypeId: google.maps.MapTypeId.SATELLITE,
|
|
|
|
|
center: {lat: 53.570645, lng: 10.001362}
|
|
|
|
|
};
|
|
|
|
|
map = new google.maps.Map(document.getElementById('map-canvas'),
|
|
|
|
|
mapOptions);
|
|
|
|
|
map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions);
|
|
|
|
|
|
|
|
|
|
var image = {
|
|
|
|
|
url: '../images/icons/cf_icon_position.png',
|
|
|
|
|
scaledSize: new google.maps.Size(70, 70)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var marker = new google.maps.Marker({
|
|
|
|
|
marker = new google.maps.Marker({
|
|
|
|
|
icon : image,
|
|
|
|
|
position: new google.maps.LatLng(53.570645, 10.001362),
|
|
|
|
|
map:map
|
|
|
|
@ -85,14 +87,10 @@ var marker = new google.maps.Marker({
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
window.addEventListener('message', function(e) {
|
|
|
|
|
|
|
|
|
|
var data = e.data;
|
|
|
|
|
var origin = e.origin;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// sandbox docs1: https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/sandbox
|
|
|
|
|
// sandbox docs1: https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/sandboxed-content
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
</head>
|
|
|
|
|