btn-exit

圖示說明

壅塞

車多

順暢

無資料

國父紀念館室內導覽

place2

中正紀念堂室內導覽

$('#btn-toogle-close').hide(); $('#btn-toogle-open').show(); } }, setItem: function (value) { item = value; }, getItem: function () { return item; }, getItemById: function (id) { for (var i = 0; i < records.length; i++) { if (records[i].id == id) { return records[i]; } } if (id == Kiosk.l) { return { id: Kiosk.l, name: Kiosk.location, xy: { x: Kiosk.lon, y: Kiosk.lat } } } }, getLocationById: function (id) { var obj = itemPanel.getItemById(id); if (obj) { if (obj.xy) { return { lon: obj.xy.x, lat: obj.xy.y }; } else if (obj.getLonLat) { var lonlat = obj.getLonLat(); return { lon: lonlat.lon, lat: lonlat.lat }; } else if (obj.lon && obj.lat) { return obj; } } if (id == Kiosk.l) { return { id: Kiosk.l, name: Kiosk.location, xy: { x: Kiosk.lon, y: Kiosk.lat } } } }, getItemByLocation: function (location) { if (location.lat == Kiosk.lat && location.lon == Kiosk.lon) { return { id: Kiosk.l, name: Kiosk.location, xy: { x: Kiosk.lon, y: Kiosk.lat } } } if (records == null) { return null; } for (var i = 0; i < records.length; i++) { var xy; if (records[i].xy) { xy = records[i].xy; } else if (records[i].getLonLat) { var lonlat = records[i].getLonLat(); xy = { x: lonlat.lon, y: lonlat.lat }; } else { xy = { x: records[i].lon, y: records[i].lat }; } var y = new Number(xy.y); var x = new Number(xy.x); var lat = new Number(location.lat); var lon = new Number(location.lon); if (y.toFixed(10) == lat.toFixed(10) && x.toFixed(10) == lon.toFixed(10)) { return records[i]; } } }, returnList: function () { $('#itemPanelMain .mapTab .tab1').addClass('active'); $('#itemPanelMain .mapTab .tab2').removeClass('active'); itemPanel.showList(); var view = app.getView(); if (view.renderMap) { view.renderMap(records); } }, getCoupon: function (poiId, couponId) { var poi = this.getItemById(poiId); if (poi) { for (var i = 0; i < poi.coupon.length; i++) { var coupon = poi.coupon[i]; if (coupon.cid == couponId) { return coupon; } } } else { alert('getCoupon ' + poiId + ' ' + couponId + ' is null'); } return null; }, init: function (config) { target = $('#itemPanelMain'); items = $('#itemPanelItems'); btnClose = $('#closeItemPanel'); $('#btn-toogle-close').hide(); }, setRecords: function (newRecords) { if (newRecords) { for (var i = 0; i < newRecords.length; i++) { if (newRecords[i].id == null) { newRecords[i].id = '' + i; } } } records = newRecords; return this; }, load: function (html) { items.html(html); show(); }, showList: function () { $('#itemPanelList').show(); $('#itemPanelRouting').hide(); show(); }, showRouting: function () { $('#itemPanelList').hide(); $('#itemPanelRouting').show(); show(); }, show: function () { show(); }, hide: function () { hide(); } } } (); var app = function () { // 常數 // 定義變數 var quiz; var me = this; var dialog; var subDialog; var view; var streetView; // var startPoint; // var endPoint; // 11/29 var routingView; function openDownloadWindow(config, downloadPriviewFun) { $.get('templates/map/poi/bluetoothl.aspx?lang=' + Kiosk.Language, function (template) { subDialog = $("#poiDetailPhoneDownload").dialog({ autoOpen: false, resizable: true, height: 550, width: 644 }); var t = $.template(template); t.helpers.getDownloadPriview = downloadPriviewFun; subDialog.html(t.apply(config)); subDialog.dialog("open"); }); } function getLocation() { return { lon: Kiosk.lon, lat: Kiosk.lat }; } function openItemPanel() { itemPanel.show(); } return { isOpenStreetView: function () { return $('#street').is(":visible"); }, /** Comm */ getDialog: function () { return dialog; }, setDialog: function (newDialog) { dialog = newDialog; return dialog; }, getSubDialog: function () { return subDialog; }, setSubDialog: function (newDialog) { subDialog = newDialog; return subDialog; }, getView: function () { return view; }, getStreetView: function () { return streetView; }, /** StreetView */ openStreetView: function (id) { Kiosk.Service.Log(1, 35); var item = itemPanel.getItemById(id); if (item != null) { var xy = item.xy; if (xy == null) { if (item.getLonLat) { xy = { x: item.getLonLat().lon, y: item.getLonLat().lat }; } else { xy = { x: item.lon, y: item.lat }; } } // 131121-5 [s] : verify the point in street view is display var fenwayPark = new google.maps.LatLng(xy.y, xy.x); var debug = false; if(debug) { var streetViewService = new google.maps.StreetViewService(); var STREETVIEW_MAX_DISTANCE = 100; var latLng = fenwayPark; streetViewService.getPanoramaByLocation(latLng, STREETVIEW_MAX_DISTANCE, function (streetViewPanoramaData, status) { if (status === google.maps.StreetViewStatus.OK) { // ok alert('ok'); } else { alert('not ok'); // no street view available in this range, or some error occurred } }); } panoramaOptions = { position: fenwayPark }; if (!streetView) { try { streetView = new google.maps.StreetViewPanorama(document.getElementById('street'),panoramaOptions); mapPanel.helper().getMap().setStreetView(streetView); } catch (e) { } } streetView.setPosition(fenwayPark); // 131121-5 [e] // todo - $('#itemPanelMain').width() var streetWidth = $('#map').width(); //$('#street').width(streetWidth); $('#street').show(); $('.streetControl').show(); //$('#streetExit').css( {'right':10} ); $('#mapControl').hide(); $('#closeStreet').show(); app.changeUI(); mapPanel.helper().getMap().closeInfoWindow(); itemPanel.setItem(item); if (app.getView().short) { app.getView().short(item); } else { app.getView().info(item.id); } } }, closeStreetView: function () { if (app.isOpenStreetView()) { $('#street').hide(); $('.streetControl').hide(); $('#mapControl').show(); $('#closeStreet').hide(); //mapPanel.helper().getMap().checkResize(); app.getView().info(itemPanel.getItem().id); } app.changeUI(); /** $('#map').unblock(); $('.navi-in-home').unblock(); $('.mapnav-controller').show(); $('#navSubMenu').unblock(); $('#navMenu').unblock(); $('#itemPanelMain').show(); */ }, /** Coupon */ downloadCoupon: function (poiId, couponId) { var coupon = itemPanel.getCoupon(poiId, couponId); var priview = function () { return ''; }; openDownloadWindow({ url: coupon.url, id: couponId }, priview); }, /** Routing */ downloadRoutingTextFile: function () { Kiosk.Service.getImageId(GetGooglemapRoutinhContent('mapRoutingResult'), function (url, id) { var priview = function () { return ''; }; openDownloadWindow({ url: url, id: id }, priview); }); }, showRoutingQRCode: function () { $.get('templates/map/poi/qrcode.html', function (template) { subDialog = $("#qrcode").dialog({ autoOpen: false, resizable: false, height: 400, width: 400 }); var t = $.template(template); var helpers = t.helpers; var endPointDesc = ''; if (view.getEndPoint) { endPoint = view.getEndPoint(); if (endPoint) { endPointDesc = endPoint.name; }