var map, svp;
function manyw_gmap(street_map,str_x,str_y,str_pov,map_div,init_x,init_y,nav_div,goto,search_engine,icon_layout,thePitch){
wiki_mode = 'off';
var wiki_marker;
wiki_x = '';
wiki_y = '';
var wiki_x_y = '';
var current_street_x = str_x;
var current_street_y = str_y;
var current_str_pov = str_pov;
var stationx;
var stationy;
var need_load_icon_at_first_time = true;
var icon_category = 'branch,prop_info,p_school,s_school,street_720,flat_720,wiki';
var previous_pano_pano;
var previous_pano_xy;
var markerAry = new Array();
var xy_array = new Array();
//var map = new GMap2(document.getElementById(map_div));
//map.addControl(new GLargeMapControl());
//map.setCenter(new GLatLng(init_y,init_x), 17);
map = new google.maps.Map(
document.getElementById(map_div), {
center: new google.maps.LatLng(init_y,init_x ),
zoom: 17,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
if (street_map != '' && false){
/*Suet Street Map*/
svp = new google.maps.StreetViewPanorama(document.getElementById(street_map));
var arrow = new google.maps.Marker({
position: new google.maps.LatLng(90,0),
icon: '/view/NEW/dir_0.png',
map: map
});
var sv = new google.maps.StreetViewService();
sv.getPanoramaByLocation(new google.maps.LatLng(str_x,str_y), 50, processSVData);
//map.addOverlay(arrow);
streetMapPos(str_x,str_y,str_pov);
/*End Map*/
// highlight d 街
/*
var street = new google.maps.ImageMapType({
getTileUrl: function(coord, zoom) {
var X = coord.x % (1 << zoom);
return "http://cbk0.google.com/cbk?output=overlay&zoom=" + zoom + "&x=" + X + "&y=" + coord.y + "&cb_client=api";
},
tileSize: new google.maps.Size(256, 256),
isPng: true
});
map.overlayMapTypes.push(null);
map.overlayMapTypes.setAt(0, street);
*/
}
/*
var private_icon = new GIcon();
private_icon.image = "https://www.manyw.com/view/NEW/icon/housing2.gif";
private_icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
private_icon.iconSize = new GSize(25, 25);
private_icon.shadowSize = new GSize(25, 25);
private_icon.iconAnchor = new GPoint(6, 20);
private_icon.infoWindowAnchor = new GPoint(5, 1);
var hos_icon = new GIcon();
hos_icon.image = "https://www.manyw.com/view/NEW/icon/housing.gif";
hos_icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
hos_icon.iconSize = new GSize(25, 25);
hos_icon.shadowSize = new GSize(25, 25);
hos_icon.iconAnchor = new GPoint(6, 20);
hos_icon.infoWindowAnchor = new GPoint(5, 1);
var public_icon = new GIcon();
public_icon.image = "https://www.manyw.com/view/NEW/icon/housing3.gif";
public_icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
public_icon.iconSize = new GSize(25, 25);
public_icon.shadowSize = new GSize(25, 25);
public_icon.iconAnchor = new GPoint(6, 20);
public_icon.infoWindowAnchor = new GPoint(5, 1);
var branch_icon = new GIcon();
branch_icon.image = "https://www.manyw.com/view/NEW/mwicon.png";
branch_icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
branch_icon.iconSize = new GSize(22, 28);
branch_icon.shadowSize = new GSize(20, 20);
branch_icon.iconAnchor = new GPoint(6, 20);
branch_icon.infoWindowAnchor = new GPoint(5, 1);
var school_icon = new GIcon();
school_icon.image = "https://www.manyw.com/view/NEW/icon/sicon.gif";
school_icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
school_icon.iconSize = new GSize(23,23);
school_icon.shadowSize = new GSize(20, 20);
school_icon.iconAnchor = new GPoint(6, 20);
school_icon.infoWindowAnchor = new GPoint(5, 1);
var street_720_icon = new GIcon();
street_720_icon.image = "https://www.manyw.com/view/NEW/720icona-1.gif";
street_720_icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
street_720_icon.shadowSize = new GSize(20, 20);
street_720_icon.iconAnchor = new GPoint(6, 20);
street_720_icon.infoWindowAnchor = new GPoint(5, 1);
var flat_720_icon = new GIcon();
flat_720_icon.image = "https://www.manyw.com/view/NEW/720icon.gif";
flat_720_icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
flat_720_icon.iconSize = new GSize(65,28);
flat_720_icon.shadowSize = new GSize(65,28);
flat_720_icon.iconAnchor = new GPoint(65,28);
flat_720_icon.infoWindowAnchor = new GPoint(5, 1);
var wiki_icon = new GIcon();
wiki_icon.image = "https://www.manyw.com/view/NEW/wiki_icon.gif";
wiki_icon.iconSize = new GSize(25,25);
wiki_icon.shadowSize = new GSize(25,25);
wiki_icon.iconAnchor = new GPoint(25,25);
wiki_icon.infoWindowAnchor = new GPoint(5, 1);
*/
this.add_category = function(category_to_be_add){
add_category(category_to_be_add);
}
this.cut_category = function(category_to_be_cut){
cut_category(category_to_be_cut);
}
this.add_cut_category = function(to_add,c){
add_cut_category(to_add,c);
}
//GEvent.addListener(map, "dragend", function() {
google.maps.event.addListener(map, "dragend", function() {
hide_all_icon();
show_icon_on_screen();
});
//GEvent.addListener(map, "zoomend", function() {
google.maps.event.addListener(map, "zoomend", function() {
if (map.getZoom() <= 15){
hide_all_icon();
} else {
show_icon_on_screen();
}
});
/*Suet Street Map 2010-03-11*/
function streetMapPos(str_x,str_y,str_pov){
str_x = str_x /1;
str_y = str_y /1;
var pov = str_pov /1;
//alert(str_pov);
var latlng = new google.maps.LatLng(str_x,str_y ); //GLatLng(str_x,str_y);
var myPov = { heading: pov, pitch: -0.13590989423507835 ,zoom: 1};
//svp.remove();
svp.setPov(myPov);
//console.log(myPov);
//console.log(svp);
//svp.setLocationAndPOV(latlng, myPov);
//lastPoint = latlng;
//lastPoint2 = lastPoint;
//map.setCenter(latlng,16);
}
function processSVData(panoData, status) {
var pov = str_pov /1;
//alert(pov);
if (status != google.maps.StreetViewStatus.OK) {
//alert("Panorama data not found for this location.");
} else {
var stPitch = 30;
if(thePitch !== "undefined" ){
if(thePitch != "" && thePitch >0) stPitch = thePitch /1;
}
//alert(panoData.location.latLng);
svp.setPano(panoData.location.pano);
//alert(pov);
svp.setPov({
heading: pov,
pitch: stPitch,
zoom: 1
});
svp.setVisible(true);
arrow.setPosition(panoData.location.latLng);
}
}
if (street_map!=''){
/*var StreetViewOverlay = new GStreetviewOverlay();
map.addOverlay(StreetViewOverlay);
StreetViewOverlay.hide();
*/ //fuck
google.maps.event.addListener(map,"click",function(point){
if (wiki_mode=='on'){
if (wiki_marker) wiki_marker.setVisible(false);
wiki_x_y = point.latLng;
//var pointer = new google.maps.LatLng(point.y,point.x ); /// GLatLng(point.y, point.x);
wiki_marker = new google.maps.Marker({
position: point.latLng,
icon: 'https://www.manyw.com/view/NEW/wiki_icon.gif',
map: map
});
var wiki_html = '
";
wiki_marker.info = new google.maps.InfoWindow({
content: wiki_html
});
wiki_marker.info.open(map, wiki_marker);
} else {
var sv = new google.maps.StreetViewService();
sv.getPanoramaByLocation(point.latLng, 50, processSVData);
}
/*
if (!overlay) {
//
alert('b');
if (wiki_mode=='on'){
if (wiki_marker) wiki_marker.setVisible(false);
wiki_x = point.x;
wiki_y = point.y;
var pointer = new google.maps.LatLng(point.y,point.x ); /// GLatLng(point.y, point.x);
wiki_marker = new GMarker( pointer , wiki_icon );
//map.addOverlay(wiki_marker);
var wiki_html = '";
wiki_marker.openInfoWindowHtml(wiki_html);
} else{
lastPoint2 = lastPoint;
svp.remove();
svp.setLocationAndPOV(point);
arrow.setLatLng(point);
lastPoint = point;
current_street_x = get_xy_from_point(lastPoint,'x');
current_street_y = get_xy_from_point(lastPoint,'y');
}
}
*/
});
//GEvent.addListener(map,"mouseover",function(){
google.maps.event.addListener(map,"mouseover",function(){
//StreetViewOverlay=map.addOverlay(new GStreetviewOverlay());
//StreetViewOverlay.show(); //fuck
});
//GEvent.addListener(map,"mouseout",function(){
google.maps.event.addListener(map,"mouseout",function(){
//StreetViewOverlay.hide(); //fuck
});
//GEvent.addListener(svp, "error", handleError);
//google.maps.event.addListener(svp, "error", handleError);
/* End of Street Map*/
}
function hide_all_icon(){
if(markerAry.length !=0){
for(i=0;i" + theHTML + ""
});
google.maps.event.addListener(marker, "click", function(){
if(markerAry.length !=0){
for(i=0;i" + theHTML + ""
});
if(markerAry.length !=0){
for(i=0;i' + housingDataAry[3] + '';
theHTML += '
';
theHTML += '
';
theHTML += '
';
theHTML += '
';
theHTML += '
';
theHTML += '
';
theHTML += '';
theHTML += '
';
theHTML += '| ' + housingDataAry[13] + ' |
';
theHTML += '';
theHTML += ' | ';
theHTML += ' |
';
theHTML += '';
theHTML += '
';
theHTML += '
';
theHTML += ' | 地址: | ';
theHTML += ' ' + housingDataAry[9] + ' | ';
theHTML += '';
theHTML += '';
theHTML += ' | 入伙日期: | ';
theHTML += ' ' + housingDataAry[8] + ' |
';
theHTML += ' | 間格: | ';
theHTML += ' ' + housingDataAry[10] + ' | ';
theHTML += '
';
theHTML += '';
//theHTML += bArray[no][13] + ' ';
theHTML += ' |
';
theHTML += '
';
theHTML += '';
theHTML += get_housing_img(housingImgList);
theHTML += '
';
theHTML += '';
theHTML += get_housing_video(housingVideoList,housingDataAry[14]);
theHTML += '
';
break;
case 'branch_info':
theHTML = '';
theHTML += '';
theHTML += ' ' + housingDataAry[3] + ' | ';
theHTML += '
';
theHTML += '';
if(housingDataAry[7] != ''){
theHTML += '  | ';
//theHTML += '  | ';
theHTML += '
';
theHTML += '';
theHTML += ' | 分行門面 | ';
//theHTML += ' 員工照片 | ';
theHTML += '
';
}
theHTML += '
';
theHTML += '';
theHTML += '';
theHTML += ' | 地址: | ';
theHTML += ' ' + housingDataAry[4] + ' | ';
theHTML += '
';
theHTML += '';
theHTML += ' | 電話: | ';
theHTML += ' ' + housingDataAry[5]+ ' | ';
theHTML += '
';
theHTML += '';
theHTML += ' 傳真:
| ';
theHTML += ' ' +housingDataAry[6] + '
| ';
theHTML += '
';
theHTML += '
';
break;
case 's_school':
case 'p_school':
theHTML = '';
theHTML += '';
theHTML += '' + housingDataAry[3] + ' | ';
theHTML += '
';
theHTML += '| 資助? | ' + housingDataAry[4] + ' |
';
theHTML += '| 電話? | '+housingDataAry[8]+' |
';
theHTML += '| 電郵? | '+housingDataAry[10]+' |
';
theHTML += '| 全日制? | ' + housingDataAry[5] + ' |
';
theHTML += '| 男女校? | ' + housingDataAry[6] + ' |
';
theHTML += '| 宗教? | ' + housingDataAry[7] + ' |
';
theHTML += '| 網頁? | '+housingDataAry[11]+' |
';
theHTML += '
';
break;
case 'street_720':
/*https://www.manyw.com/view/program/files/pano.swf?xml_file=
xml&allowFullScreen=true*/
theHTML = '';
theHTML += '';
theHTML += '| 街景圖 | ';
theHTML += '
';
theHTML += '
';
break;
case 'flat_720':
/*https://www.manyw.com/view/program/files/pano.swf?xml_file=
xml&allowFullScreen=true*/
theHTML = '';
theHTML += '';
theHTML += '| ' + housingDataAry[3] + ' 720睇樓 | ' + housingDataAry[6] + ' |
| ';
theHTML += '
';
theHTML += '
';
break;
case 'wiki':
theHTML = '';
theHTML += '| 自訂地圖標記 |
';
theHTML += '| |
';
theHTML += '| 簡介: | ' + housingDataAry[3] + ' |
';
theHTML += '| |
';
theHTML += '| 輸入者: | ' + housingDataAry[4] + ' |
';
theHTML += '| |
';
theHTML += '| |
';
theHTML += '此地圖標記由瀏覽者提供,若因資料錯漏而引致任何不便或損失,祥益地產慨不負責 |
';
theHTML += '
';
break;
}
return theHTML;
}
function in_array(needle,haystack,argStrict){
var key='',strict=!!argStrict;
if(strict){for(key in haystack){
if(haystack[key]===needle){
return true;
}
}
}else{
for(key in haystack){
if(haystack[key]==needle){
return true;
}
}
}
return false;
}
function get_array_key(needle,haystack){
var i = 0;
if(haystack.length !=0){
for(i=0;i1st result for geocoding is ' +
result[0].geometry.location_type.toLowerCase() +
' to ' +
result[0].formatted_address + ' of types ' +
result[0].types.join(', ').replace(/_/, ' ') +
' at ' + result[0].geometry.location +
'';
var marker_title = result[0].formatted_address +
' at ' + latlng;
if (marker) {
marker.setPosition(result[0].geometry.location);
marker.setTitle(marker_title);
} else {
marker = new google.maps.Marker({
position: result[0].geometry.location,
title: marker_title,
map: map
});
}
*/
}
}
function onGDirectionsLoadDuration(){
//directions.getMarker(1).getIcon().image = 'https://www.manyw.com/view/NEW/gmap_icon_to1.png';
//directions.getMarker(0).getIcon().image = 'https://www.manyw.com/view/NEW/gmap_icon_from.png';
//if(themode == 'driving'){
// directions.getMarker(0).getIcon().image = 'https://www.manyw.com/view/NEW/gmap_icon_to1.png';
//}
// dur = Math.round(directions.getDuration().seconds / 60);
// document.getElementById('waymins').innerHTML = "路程約 "+dur+" 分鐘";
}
function show_menu(){
self_type_mode = 'no';
document.getElementById('nav_driving').style.display='none';
document.getElementById('nav_walking').style.display='none';
document.getElementById('nav_driving').selectedIndex=0;
document.getElementById('nav_walking').selectedIndex=0;
document.getElementById(themode).style.display='block';
document.getElementById('nav_show_menu_span').style.display='none';
document.getElementById('nav_fm').style.display='none';
}
function point2point(thepointx,thepointy,to_pointx,to_pointy){
//GEvent.addListener(directions, "load", onGDirectionsLoadDuration);
if (directions) {directions.clear();}
//marker.closeInfoWindowHtml();
directionsPanel = document.getElementById("nav_route");
directions = new GDirections(map, directionsPanel);
directions.load("from: " + thepointy + ',' + thepointx + " to: " + to_pointy + ", " + to_pointx, {'travelMode': G_TRAVEL_MODE_WALKING });
}
function hide_panorama(){
document.getElementById(street_map).style.height = '1px';
document.getElementById(street_map).style.display = 'none';
}
function show_panorama(){
document.getElementById(street_map).style.height = '300px';
document.getElementById(street_map).style.display = 'block';
}
function show_hide_panorama(){
if (document.getElementById('gmap_show_hide_street_button').value=='隱藏街景'){
document.getElementById('gmap_show_hide_street_button').value='顯示街景';
hide_panorama();
var req=new XMLHttpRequest();
link = 'https://www.manyw.com/view/NEW/manyw_gmap_set_panorama_setting.php?panorama=hide';
req.open('GET',link);
req.send(null);
} else {
document.getElementById('gmap_show_hide_street_button').value='隱藏街景';
show_panorama();
var req=new XMLHttpRequest();
link = 'https://www.manyw.com/view/NEW/manyw_gmap_set_panorama_setting.php?panorama=show';
req.open('GET',link);
req.send(null);
}
}
function set_nav(){
var tmp = "";
var tmp = "
";
var tmp = tmp + "";
var tmp = tmp + "";
document.getElementById(nav_div).innerHTML = tmp;
}
function set_icon_layout_div(){
var tmp = "";
tmp = tmp + "";
tmp = tmp + "

";
tmp = tmp + "

";
tmp = tmp + "
學校 ";
tmp = tmp + "

";
tmp = tmp + "
720睇樓 ";
tmp = tmp + "

";
tmp = tmp + "
720街景 ";
tmp = tmp + "

";
tmp = tmp + "
自訂標記 ";
/// // #2.1.7.12# 圖例點擊會將地圖上該圖例作顯示或隱藏,有tick 的會顯示,無tick 的會隱藏
document.getElementById(icon_layout).innerHTML = tmp;
}
function set_search_engine(){
var tmp = "";
var tmp = tmp + "
";
document.getElementById(search_engine).innerHTML = tmp;
}
function search_start(){
hide_all_icon();
show_icon_on_screen();
}
function add_cut_category(to_add,c){
hide_all_icon();
//alert('hide');
//return false;
if (to_add){
if (c=='school'){
add_category('s_school');
add_category('p_school');
}
add_category(c);
} else {
if (c=='school'){
cut_category('s_school');
cut_category('p_school');
}
cut_category(c);
}
show_icon_on_screen();
}
this.show_one_icon = function(x,y){
show_one_icon(x,y);
}
this.way = function(txt){
way(txt);
}
this.chgtype = function(txt){
chgtype(txt);
}
this.show_menu = function(){
show_menu();
}
this.chgdw = function(txt){
chgdw(txt);
}
this.near_lightrail = function (a1,a2,a3,a4){
point2point(a1,a2,a3,a4);
}
this.point2point = function (a1,a2,a3,a4){
point2point(a1,a2,a3,a4);
}
this.search_start = function () {
search_start();
}
this.switch_wiki_mode = function(val){
wiki_mode = val;
if (val=='on'){
document.getElementById('map').style.cursor = "hand";
}
if (val=='off'){
document.getElementById('map').style.cursor = "pointer";
}
}
this.resize0 = function(){
google.maps.event.trigger(map, 'resize');
}
this.hide_panorama = function(){
hide_panorama();
}
this.show_panorama = function(){
show_panorama();
}
this.show_hide_panorama = function (){
show_hide_panorama();
}
this.get_wiki_x_y = function(){
return wiki_x_y;
}
this.add_comment = function(comment,comment_by,x_y){
if (comment==''){
alert('請輸入標記簡介');
return false;
}
if (comment_by==''){
alert('請輸入你的名字');
return false;
}
var req=new XMLHttpRequest();
var content_bulk;
if (req) {
req.onreadystatechange = function(){
if (req.readyState==4 && req.status==200){
if (req.responseText=='ok'){
wiki_marker.setVisible(false);
map.setCenter(x_y), map.getZoom();
wiki_mode = 'off';
show_icon_on_screen();
theHTML = '
';
theHTML += ' 多謝你輸入了以下資訊
|
';
theHTML += '| 簡介:' + document.getElementById("manyw_gmap_add_comment").value + ' |
';
theHTML += '| 輸入者:' + document.getElementById("manyw_gmap_comment_by").value + ' |
';
theHTML += '
';
document.getElementById("manyw_gmap_add_comment").value = '';
document.getElementById("manyw_gmap_comment_by").value = '';
document.getElementById('manyw_gmap_comment_div').innerHTML = theHTML;
var wiki_html = "
" + wiki_html + "
";
//wiki_marker.openInfoWindowHtml(theHTML);
wiki_marker.info = new google.maps.InfoWindow({
content: theHTML
});
wiki_marker.info.open(map, wiki_marker);
}
}
};
link = 'https://www.manyw.com/view/NEW/manyw_gmap_add_comment.php?comment=' + encodeURIComponent(comment) + '&comment_by=' + encodeURIComponent(comment_by) + '&x_pos=' + x_y.lng() + '&y_pos=' + x_y.lat();
req.open('POST',link);
req.send(null);
}
}
this.reload_street = function(aaa,bbb,ccc){
reload_street(aaa,bbb,ccc);
}
if (document.getElementById('school')!= null){
document.getElementById('school').click();
cut_category('p_school');
cut_category('s_school');
}
google.maps.event.addListener(map,'bounds_changed',function(){
if (need_load_icon_at_first_time){
need_load_icon_at_first_time = false;
show_icon_on_screen();
}
});
String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*$)/g, "");
}
function cut_category(category_to_be_cut){
tmp_array = new Array();
tmp_array2 = new Array();
tmp_array = icon_category.split(",");
for(category_index=0;category_index
";
img_HTML +=" | ";
if(i % 3 == 2) img_HTML += "";
}
img_HTML +="";
}else{
img_HTML = "暫時沒有相片";
}
return img_HTML;
}
function show_housing_info(path,hid,type){
var divInfo = document.getElementById('divHousingInfo'+hid);
var divImg = document.getElementById('divHousingImg'+hid);
var divVideo = document.getElementById('divHousingVideo'+hid)
divInfo.style.display = "none";
divImg.style.display = "none";
divVideo.style.display = "none";
document.getElementById('divHousing'+type+hid).style.display="block";
if(type=='Video'){
chgVideo(path,hid);
}
}
function get_housing_video(video_list,hid){
var video_HTML = "";
if(video_list != ''){
var videoOpt;
var videoAry = new Array();
videoAry = video_list.split(",,,,");
for(var i=0;i < videoAry.length;i++){
var videoInfoAry = new Array();
var currVideo = videoAry[i];
videoInfoAry = currVideo.split("++++");
videoOpt += "";
}
videoOpt = "";
video_HTML = videoOpt;
video_HTML += "";
video_HTML += "
";
video_HTML += "
";
}else{
video_HTML ="暫時沒有短片";
}
return video_HTML;
}
function chgVideo(path,hid){
document.getElementById("myFlash").SetVariable("player:jsStop", "");
document.getElementById("myFlash").SetVariable("player:jsUrl", path);
document.getElementById("myFlash").SetVariable("player:jsPlay", "");
}
var testing_12346 = '1';
function testing_1234(){
console.log('gg');
this.call1=function(){
console.log('call1');
}
}