function getGlobalPath()
{ var f = function(e)
{ var name = e.tagName; if( !!name && name.toUpperCase() == "SCRIPT" )
{ return e;}
var c = e.lastChild; return (!!c)?f(c):null;}; var es = f(document); if(!es)
{ return window.location;}
return es.getAttribute("src") || window.location;}; var g_cnt; var g_path_GoogleMap_getCoordinates = getGlobalPath(); var g_array = new Array(); if( "object" == typeof(g_path_GoogleMap_getCoordinates) )
{ g_path_GoogleMap_getCoordinates = g_path_GoogleMap_getCoordinates.href;}
g_array = g_path_GoogleMap_getCoordinates.split("/"); g_cnt = g_array.length; g_path_GoogleMap_getCoordinates = g_path_GoogleMap_getCoordinates.replace(g_array[g_cnt - 1], ""); var GoogleMap_getCoordinatesVer2 = function(instanceName, divName, lat, lon, zoom)
{ if(!lat) lat = 34.9763729373547; if(!lon) lon = 135.75041502714157; if(!zoom) zoom= 10; this.zoom = zoom; this.lat = lat; this.lon = lon; this.instanceName = instanceName; this.divName = divName; this.y = 0; this.yMarkerDrag = 0; this.limiter = 0; this.imgSizeH_h; this.imgSizeH_w; this.imgSizeW_h; this.imgSizeW_w; this.sizeSvInfoWindow_h = 200; this.sizeSvInfoWindow_w = 100; this.noPolygon; this.miniMapW = 200; this.miniMapH = 200; this.latMarker = null; this.latMarker1 = null; this.lonMarker = null; this.lonMarker1 = null; this.svLat = null; this.svLon = null; this.svYaw = null; this.svPitch = null; this.svZoom = null; this.distance = null; this.timerId_geocoder = null; this.version = "1.3.1"; this.idZoom = null; this.idLat = null; this.idLon = null; this.idLatMarker = null; this.idLonMarker = null; this.idLatMarker1 = null; this.idLonMarker1 = null; this.idReverseGeocoding = null; this.idReverseGeocoding1 = null; this.idSvLat = null; this.idSvLon = null; this.idSvYaw = null; this.idSvPitch = null; this.idSvZoom = null; this.idDistance = null; this.imgH; this.imgW; this.svMarkerImg = null; this.distanceUnit = "km"; this.iconImg_drag = "g-red"; this.icomImg_gc = "g-arrowSmall80"; this.geodosu_apikey = null; this.arrayMarkerDrag = new Array(); this.arrayPoint = new Array(); this.arrayAddressReverseGeocoder = new Array(); this.arrayTimerIdReverseGeocoder = new Array(); this.arrayMarker = new Array(); this.arrayPolygon = new Array(); this.arrayPolygonDetail = new Array(); this.arrayPolygon_circle = new Array(); this.arrayPolyline = new Array(); this.arrayPolylineDetail = new Array(); this.flgLock = false; this.flgControl_GLargeMapControl = false; this.flgControl_GSmallMapControl = false; this.flgControl_GSmallZoomControl = false; this.flgControl_GScaleControl = false; this.flgControl_GMapTypeControl = false; this.flgControl_G_PHYSICAL_MAP = false; this.flgControl_GOverviewMapControl = false; this.flgControl_WheelZoom = false; this.flgSvLine = false; this.flgSvPanoramaDisp = true; this.flgStraight = true; this.map = new GMap2( document.getElementById(divName) ); this.geocoder = null; this.geocoder_geodosu = null; this.point = null; this.sv = null; this.svMarker; this.svInfoWindow = null; this.panorama = null; this.polylineDistance = null; this.overlay_panoramio_all = null; this.overlay_wikipedia_jp = null; this.map.setCenter( new GLatLng(this.lat, this.lon), this.zoom ); this.set_flgLock = function(flgLock)
{ this.flgLock = flgLock;}
this.set_flgControl_GLargeMapControl = function(flgControl_GLargeMapControl)
{ this.flgControl_GLargeMapControl = flgControl_GLargeMapControl;}
this.set_flgControl_GSmallMapControl = function(flgControl_GSmallMapControl)
{ this.flgControl_GSmallMapControl = flgControl_GSmallMapControl;}
this.set_flgControl_GSmallZoomControl = function(flgControl_GSmallZoomControl)
{ this.flgControl_GSmallZoomControl = flgControl_GSmallZoomControl;}
this.set_flgControl_GScaleControl = function(flgControl_GScaleControl)
{ this.flgControl_GScaleControl = flgControl_GScaleControl;}
this.set_flgControl_GMapTypeControl = function(flgControl_GMapTypeControl)
{ this.flgControl_GMapTypeControl = flgControl_GMapTypeControl;}
this.set_flgControl_G_PHYSICAL_MAP = function(flgControl_G_PHYSICAL_MAP)
{ this.flgControl_G_PHYSICAL_MAP = flgControl_G_PHYSICAL_MAP;}
this.set_flgControl_GOverviewMapControl = function(flgControl_GOverviewMapControl, miniMapH, miniMapW)
{ this.flgControl_GOverviewMapControl = flgControl_GOverviewMapControl; if(!!miniMapH) this.miniMapH = miniMapH; if(!!miniMapW) this.miniMapW = miniMapW;}
this.set_flgControl_WheelZoom = function(flgControl_WheelZoom)
{ this.flgControl_WheelZoom = flgControl_WheelZoom;}
this.set_flgControlBatch_standard = function()
{ this.flgControl_GLargeMapControl= true; this.flgControl_GScaleControl = true; this.flgControl_GMapTypeControl = true; this.flgControl_G_PHYSICAL_MAP = true;}
this.set_flgStraight = function(flgStraight)
{ this.flgStraight = flgStraight;}
this.set_flgOverlay_panoramio_all = function(flgOverlay_panoramio_all)
{ this.flgOverlay_panoramio_all = flgOverlay_panoramio_all;}
this.set_flgOverlay_wikipedia_jp = function(flgOverlay_wikipedia_jp)
{ this.flgOverlay_wikipedia_jp = flgOverlay_wikipedia_jp;}
this.set_idZoom = function(idZoom)
{ this.idZoom = idZoom;}
this.set_idCoordinatesCenter = function(idLat, idLon)
{ this.idLat = idLat; this.idLon = idLon;}
this.set_idCoordinatesMarker = function(idLatMarker, idLonMarker)
{ this.idLatMarker = idLatMarker; this.idLonMarker = idLonMarker;}
this.set_idCoordinatesMarker_distance = function(idLatMarker1, idLonMarker1)
{ this.idLatMarker1 = idLatMarker1; this.idLonMarker1 = idLonMarker1;}
this.set_idSv_batch = function(lat, lon, yaw, pitch, zoom)
{ this.idSvLat = lat; this.idSvLon = lon; this.idSvYaw = yaw; this.idSvPitch = pitch; this.idSvZoom = zoom;}
this.set_idDistance = function(idDistance)
{ this.idDistance = idDistance;}
this.set_idReverseGeocoding = function(idReverseGeocoding, idReverseGeocoding1)
{ this.idReverseGeocoding = idReverseGeocoding; if(!!idReverseGeocoding1)
{ this.idReverseGeocoding1 = idReverseGeocoding1;}
}
this.set_iconImg_drag = function(iconImg_drag)
{ this.iconImg_drag = iconImg_drag;}
this.set_iconImg_gc = function(icomImg_gc)
{ this.icomImg_gc = icomImg_gc;}
this.set_marker_preparation = function()
{ this.arrayMarker[this.y] = new Array(); this.arrayMarker[this.y]["lat"] = null; this.arrayMarker[this.y]["lon"] = null; this.arrayMarker[this.y]["svLat"] = null; this.arrayMarker[this.y]["svLon"] = null; this.arrayMarker[this.y]["svYaw"] = null; this.arrayMarker[this.y]["svPitch"] = null; this.arrayMarker[this.y]["svZoom"] = null; this.arrayMarker[this.y]["iwText"] = null; this.arrayMarker[this.y]["iconName"] = null; this.arrayMarker[this.y]["noPolygon"] = null; this.arrayMarker[this.y]["mode"] = 0;}
this.set_marker = function(lat, lon, iwText)
{ this.set_marker_preparation(); this.arrayMarker[this.y]["lat"] = lat; this.arrayMarker[this.y]["lon"] = lon; if(!!iwText && null != iwText && "" != iwText)
{ this.arrayMarker[this.y]["iwText"] = iwText;}
this.y++;}
this.set_marker_originalIcon = function(iconName, lat, lon, iwText)
{ this.set_marker_preparation(); this.arrayMarker[this.y]["iconName"]= iconName; this.arrayMarker[this.y]["lat"] = lat; this.arrayMarker[this.y]["lon"] = lon; if(!!iwText && null != iwText && "" != iwText)
{ this.arrayMarker[this.y]["iwText"] = iwText;}
this.y++;}
this.set_marker_polyLine = function(noPolygon, lat, lon, iwText, iconName)
{ this.set_marker_preparation(); this.arrayMarker[this.y]["noPolygon"] = noPolygon; this.arrayMarker[this.y]["lat"] = lat; this.arrayMarker[this.y]["lon"] = lon; if(!!iwText && null != iwText && "" != iwText) this.arrayMarker[this.y]["iwText"] = iwText; if(!!iconName && null != iconName && "" != iconName) this.arrayMarker[this.y]["iconName"]= iconName; this.y++;}
this.set_marker_sv = function(lat, lon, svLat, svLon, svYaw, svPitch, svZoom, iwText)
{ this.set_marker_preparation(); if(!svZoom) svZoom = 0; if(!svPitch)svPitch = 0; if(!svYaw) svYaw = 0; this.arrayMarker[this.y]["mode"] = 1; this.arrayMarker[this.y]["lat"] = lat; this.arrayMarker[this.y]["lon"] = lon; this.arrayMarker[this.y]["svLat"] = svLat; this.arrayMarker[this.y]["svLon"] = svLon; this.arrayMarker[this.y]["svYaw"] = svYaw; this.arrayMarker[this.y]["svPitch"] = svPitch; this.arrayMarker[this.y]["svZoom"] = svZoom; this.arrayMarker[this.y]["iwText"] = iwText; this.y++;}
this.set_marker_originalIcon_sv = function(iconName, lat, lon, svLat, svLon, svYaw, svPitch, svZoom, iwText)
{ this.set_marker_preparation(); if(!svZoom) svZoom = 0; if(!svPitch)svPitch = 0; if(!svYaw) svYaw = 0; this.arrayMarker[this.y]["mode"] = 1; this.arrayMarker[this.y]["iconName"]= iconName; this.arrayMarker[this.y]["lat"] = lat; this.arrayMarker[this.y]["lon"] = lon; this.arrayMarker[this.y]["svLat"] = svLat; this.arrayMarker[this.y]["svLon"] = svLon; this.arrayMarker[this.y]["svYaw"] = svYaw; this.arrayMarker[this.y]["svPitch"] = svPitch; this.arrayMarker[this.y]["svZoom"] = svZoom; this.arrayMarker[this.y]["iwText"] = iwText; this.y++;}
this.set_polygonArray = function(array, array1)
{ this.arrayPolygon = new Array(); for(var y = 0, cnt = array.length; y < cnt; y++)
{ this.arrayPolygon[y] = new Array(); this.arrayPolygon[y]["no"] = array[y][0]; this.arrayPolygon[y]["lat"] = array[y][1]; this.arrayPolygon[y]["lon"] = array[y][2];}
this.arrayPolygonDetail = new Array(); for(var y = 0, cnt = array1.length; y < cnt; y++)
{ this.arrayPolygonDetail[y] = new Array(); this.arrayPolygonDetail[y]["lat"] = array1[y][0]; this.arrayPolygonDetail[y]["lon"] = array1[y][1]; this.arrayPolygonDetail[y]["zoom"] = array1[y][2]; this.arrayPolygonDetail[y]["lineColor"] = array1[y][3]; this.arrayPolygonDetail[y]["lineThick"] = array1[y][4]; this.arrayPolygonDetail[y]["lineAlpha"] = array1[y][5]; this.arrayPolygonDetail[y]["paintColor"]= array1[y][6]; this.arrayPolygonDetail[y]["paintAlpha"]= array1[y][7]; this.arrayPolygonDetail[y]["iwText"] = array1[y][8];}
}
this.set_noPolygon = function(noPolygon)
{ this.noPolygon = noPolygon;}
this.set_polygonCircleArray = function(array)
{ this.arrayPolygon_circle = new Array(); for(var y = 0, cnt = array.length; y < cnt; y++)
{ this.arrayPolygon_circle[y] = new Array(); this.arrayPolygon_circle[y]["no"] = array[y][0]; this.arrayPolygon_circle[y]["lat"] = array[y][1]; this.arrayPolygon_circle[y]["lon"] = array[y][2]; this.arrayPolygon_circle[y]["radius"] = array[y][3]; this.arrayPolygon_circle[y]["level"] = array[y][4] * 4;}
}
this.set_polylineArray = function(array, array1)
{ this.arrayPolyline = new Array(); for(var y = 0, cnt = array.length; y < cnt; y++)
{ this.arrayPolyline[y] = new Array(); this.arrayPolyline[y]["no"] = array[y][0]; this.arrayPolyline[y]["lat"]= array[y][1]; this.arrayPolyline[y]["lon"]= array[y][2];}
this.arrayPolylineDetail = new Array(); for(var y = 0, cnt = array1.length; y < cnt; y++)
{ this.arrayPolylineDetail[y] = new Array(); this.arrayPolylineDetail[y]["lineColor"]= array1[y][0]; this.arrayPolylineDetail[y]["lineThick"]= array1[y][1]; this.arrayPolylineDetail[y]["lineAlpha"]= array1[y][2];}
}
this.set_centerPaint = function(cross_px, cross_td, cross_cr)
{ if(!cross_px) cross_px = 30; if(!cross_td) cross_td = 2; if(!cross_cr) cross_cr = "red"; var cross_v_emt = document.createElement("div"); cross_v_emt.style.margin = "0px"; cross_v_emt.style.padding = "0px"; cross_v_emt.style.width = cross_td+"px"; cross_v_emt.style.height = cross_px + "px"; cross_v_emt.style.backgroundColor = cross_cr; var cross_h_emt = document.createElement("div"); cross_h_emt.style.fontSize = "1px"; cross_h_emt.style.margin = "0px"; cross_h_emt.style.padding = "0px"; cross_h_emt.style.width = cross_px + "px"; cross_h_emt.style.height = cross_td + "px"; cross_h_emt.style.borderTop = cross_cr + " solid " + cross_td + "px"; var mapPX = this.map.getSize(); var mycenterHX = mapPX.width / 2 - cross_px / 2; var mycenterHY = mapPX.height / 2 - cross_td / 2; var mycenterVX = mapPX.width / 2 - cross_td / 2; var mycenterVY = mapPX.height / 2 - cross_px / 2; var mycenter_H = new GSize(mycenterHX,mycenterHY); var myposH = new GControlPosition(G_ANCHOR_TOP_LEFT, mycenter_H); myposH.apply(cross_h_emt); this.map.getContainer().appendChild(cross_h_emt); var mycenter_V = new GSize(mycenterVX, mycenterVY); var myposV = new GControlPosition(G_ANCHOR_TOP_LEFT, mycenter_V); myposV.apply(cross_v_emt); this.map.getContainer().appendChild(cross_v_emt);}
this.set_dragMarkerCoordinates = function(latMarker, lonMarker)
{ this.latMarker = latMarker; this.lonMarker = lonMarker;}
this.set_dragMarkerCoordinates_distance = function(latMarker1, lonMarker1)
{ this.latMarker1 = latMarker1; this.lonMarker1 = lonMarker1;}
this.set_svInfoWindowSize = function(h, w)
{ this.sizeSvInfoWindow_h = h; this.sizeSvInfoWindow_w = w;}
this.set_distanceUnit = function(unit)
{ switch(unit)
{ case "m" : this.distanceUnit = "m"; break; default : this.distanceUnit = "km";}
}
this.set_geodosu_apikey = function(geodosu_apikey)
{ this.geodosu_apikey = geodosu_apikey;}
this.get_polyline_distanc_vertex = function()
{ var str = ""; for(var y = 0, cntVertex = this.polylineDistance.getVertexCount(); y < cntVertex; y++)
{ str+= y + "," + this.polylineDistance.getVertex(y).y + "," + this.polylineDistance.getVertex(y).x + "\n";}
return str;}
this.alert_version = function()
{ alert(this.version);}
this.obtain_marker = function(iconNameOrg, lat, lon)
{ var iconName; var point = new GPoint(lon, lat); var icon = new GIcon(); if(null != iconNameOrg)
{ iconName = iconNameOrg.replace(/^g-/, "");}
else if(null == iconNameOrg)
{ iconNameOrg= "g-red-dot"; iconName = "red-dot";}
if( null != iconNameOrg && iconNameOrg.match(/^g-/) )
{ if( iconName.match(/-dot$/) || null == iconName )
{ icon.image = "http://maps.google.co.jp/mapfiles/ms/icons/" + iconName + ".png"; icon.shadow = "http://maps.google.co.jp/mapfiles/ms/icons/msmarker.shadow.png"; icon.iconSize = new GSize(32, 32); icon.shadowSize = new GSize(59, 32); icon.iconAnchor = new GPoint(16, 32); icon.infoWindowAnchor = new GPoint(16, 32);}
else if( iconName.match(/-pushpin$/) )
{ icon.image = "http://maps.google.co.jp/mapfiles/ms/icons/" + iconName + ".png"; icon.shadow = "http://maps.google.co.jp/mapfiles/ms/icons/pushpin_shadow.png"; icon.iconSize = new GSize(32, 32); icon.shadowSize = new GSize(59, 32); icon.iconAnchor = new GPoint(10, 32); icon.infoWindowAnchor = new GPoint(10, 32);}
else if( iconName.match(/^mm_20_/) )
{ icon.image = "http://labs.google.com/ridefinder/images/" + iconName + ".png"; icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; icon.iconSize = new GSize(12, 20); icon.shadowSize = new GSize(22, 20); icon.iconAnchor = new GPoint(6, 20); icon.infoWindowAnchor = new GPoint(6, 20);}
else if( iconName.match(/^marker/) )
{ icon.image = "http://www.google.com/mapfiles/gadget/letters/" + iconName + ".png"; icon.shadow = "http://www.google.com/mapfiles/gadget/shadow50Small80.png"; icon.iconSize = new GSize(16, 27); icon.shadowSize = new GSize(30, 28); icon.iconAnchor = new GPoint(8, 27); icon.infoWindowAnchor = new GPoint(8, 27);}
else if( iconName.match(/^arrowSmall80/) )
{ icon.image = "http://www.google.com/mapfiles/gadget/arrowSmall80.png"; icon.shadow = "http://www.google.com/mapfiles/gadget/arrowshadowSmall80.png"; icon.iconSize = new GSize(31, 27); icon.shadowSize = new GSize(31, 27); icon.iconAnchor = new GPoint(9, 27); icon.infoWindowAnchor = new GPoint(9, 27);}
else
{ switch(iconName)
{ case "blue" :
case "red" :
case "green" :
case "lightblue" :
case "yellow" :
case "purple" :
case "pink" :
case "orange" :
icon.image = "http://maps.google.co.jp/mapfiles/ms/icons/" + iconName + ".png"; icon.shadow = "http://maps.google.co.jp/mapfiles/ms/icons/msmarker.shadow.png"; icon.iconSize = new GSize(32, 32); icon.shadowSize = new GSize(59, 32); icon.iconAnchor = new GPoint(16, 32); icon.infoWindowAnchor = new GPoint(16, 32); break; case "restaurant" :
case "coffeehouse" :
case "bar" :
case "snack_bar" :
case "drinking_water" :
case "lodging" :
case "wheel_chair_accessible" :
case "shopping" :
case "movies" :
case "grocerystore" :
case "convienancestore" :
case "arts" :
case "homegardenbusiness" :
case "electronics" :
case "mechanic" :
case "pharmacy-us" :
case "realestate" :
case "salon" :
case "dollar" :
case "parkinglot" :
case "gas" :
case "cabs" :
case "bus" :
case "truck" :
case "rail" :
case "plane" :
case "ferry" :
case "helicopter" :
case "question" :
case "info" :
case "flag" :
case "earthquake" :
case "webcam" :
case "postoffice-us" :
case "police" :
case "firedept" :
case "hospitals" :
case "landmarks-jp" :
case "phone" :
case "caution" :
case "postoffice-jp" :
case "hotsprings" :
case "tree" :
case "campfire" :
case "picnic" :
case "campground" :
case "rangerstation" :
case "toilets" :
case "POI" :
case "hiker" :
case "cycling" :
case "motorcycling" :
case "horsebackriding" :
case "sportvenue" :
case "golfer" :
case "trail" :
case "water" :
case "snowflake_simple" :
case "marina" :
case "fishing" :
case "sailing" :
case "swimming" :
case "waterfalls" :
icon.image = "http://maps.google.co.jp/mapfiles/ms/icons/" + iconName + ".png"; icon.shadow = "http://maps.google.co.jp/mapfiles/ms/icons/" + iconName + ".shadow.png"; icon.iconSize = new GSize(32, 32); icon.shadowSize = new GSize(59, 32); icon.iconAnchor = new GPoint(16, 32); icon.infoWindowAnchor = new GPoint(16, 32); break; default :
alert("error google icon");}
}
}
else
{ if(null != iconNameOrg)
{ icon.image = g_path_GoogleMap_getCoordinates + "img/marker/" + iconNameOrg + ".png"; icon.shadow = g_path_GoogleMap_getCoordinates + "img/marker/" + iconNameOrg + "_shadow.png";}
switch(iconNameOrg)
{ case "arrow":
icon.iconSize = new GSize(32, 32); icon.shadowSize = new GSize(32, 32); icon.iconAnchor = new GPoint(14, 26); icon.infoWindowAnchor = new GPoint(14, 26); break; case "dental":
icon.iconSize = new GSize(44, 45); icon.shadowSize = new GSize(44, 45); icon.iconAnchor = new GPoint(13, 37); icon.infoWindowAnchor = new GPoint(13, 37); break; case "post":
icon.iconSize = new GSize(32, 32); icon.shadowSize = new GSize(32, 32); icon.iconAnchor = new GPoint(15, 25); icon.infoWindowAnchor = new GPoint(15, 25); break; case "shop":
icon.iconSize = new GSize(32, 32); icon.shadowSize = new GSize(32, 32); icon.iconAnchor = new GPoint(16, 24); icon.infoWindowAnchor = new GPoint(16, 24); break; case "beauty" :
case "gourmet" :
case "play" :
case "shopping2":
case "study" :
case "travel" :
icon.shadow = g_path_GoogleMap_getCoordinates + "img/marker/beauty_shadow.png"; icon.iconSize = new GSize(45, 34); icon.shadowSize = new GSize(45, 34); icon.iconAnchor = new GPoint(17, 33); icon.infoWindowAnchor = new GPoint(17, 33); break; case "juku" :
case "juku1" :
icon.shadow = g_path_GoogleMap_getCoordinates + "img/marker/juku_shadow.png"; icon.iconSize = new GSize(45, 37); icon.shadowSize = new GSize(45, 37); icon.iconAnchor = new GPoint(17, 36); icon.infoWindowAnchor = new GPoint(17, 36); break; case "pin_blue" :
icon.shadow = g_path_GoogleMap_getCoordinates + "img/marker/pin_blue_shadow.png"; icon.iconSize = new GSize(44, 44); icon.shadowSize = new GSize(44, 44); icon.iconAnchor = new GPoint(1, 39); icon.infoWindowAnchor = new GPoint(1, 39); break; case "hello_moto" :
case "hello_saki" :
icon.shadow = g_path_GoogleMap_getCoordinates + "img/marker/hello_moto_shadow.png"; icon.iconSize = new GSize(52, 52); icon.shadowSize = new GSize(52, 52); icon.iconAnchor = new GPoint(12, 50); icon.infoWindowAnchor = new GPoint(12, 50); break; case "tagayashi":
icon.shadow = g_path_GoogleMap_getCoordinates + "img/marker/tagayashi_shadow.png"; icon.iconSize = new GSize(44, 45); icon.shadowSize = new GSize(44, 45); icon.iconAnchor = new GPoint(20, 40); icon.infoWindowAnchor = new GPoint(15, 48);}
}
return icon;}
this.obtain_svMarkerImg_fromYaw = function(yaw)
{ if(22.5 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-0.png"; if(45 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-1.png"; if(67.5 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-2.png"; if(90 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-3.png"; if(112.5 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-4.png"; if(135 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-5.png"; if(157.5 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-6.png"; if(180 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-7.png"; if(202.5 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-8.png"; if(225 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-9.png"; if(247.5 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-10.png"; if(270 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-11.png"; if(292.5 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-12.png"; if(315 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-13.png"; if(337.5 > yaw) return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-14.png"; return "http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-15.png";}
this.toId_generalPurpose = function(idName, value)
{ var variant; eval( "variant = this." + idName + ";" ); if(null == variant || "" == variant)
{ return;}
eval( "document.getElementById(this." + idName + ").value = value;" );}
this.toId_latLonZoom = function()
{ var instanceName = this.instanceName; var latLngObj = this.map.getCenter(); this.toId_generalPurpose("idLat", latLngObj.y); this.toId_generalPurpose("idLon", latLngObj.x); this.toId_generalPurpose("idZoom", this.map.getZoom() ); GEvent.addListener
( eval( instanceName + ".map" ), "moveend", function()
{ eval( "latLngObj = "+ instanceName + ".map.getCenter();" ); eval( instanceName + ".toId_generalPurpose('idLat', latLngObj.y);" ); eval( instanceName + ".toId_generalPurpose('idLon', latLngObj.x);" ); eval( instanceName + ".toId_generalPurpose('idZoom'," + instanceName + ".map.getZoom() );" );} );}
this.toId_distance = function(flg)
{ if( "undefined" == typeof(flg) ) flg = true; var unit = this.polylineDistance.getLength(); if(null != this.idDistance)
{ if(true == flg)
{ if("km" == this.distanceUnit)
{ unit = unit * 1; unit = Math.round(unit); unit = unit / 1; unit = unit / 1000;}
else
{ unit = unit * 1000; unit = Math.round(unit); unit = unit / 1000;}
this.toId_generalPurpose("idDistance", unit);}
else
{ this.toId_generalPurpose("idDistance", "");}
}
}
this.toId_svLatLon = function(lat, lon)
{ this.toId_generalPurpose("idSvLat", lat); this.toId_generalPurpose("idSvLon", lon);}
this.toId_jsonPdb = function(json, idDiv, idPdb, text)
{ if( !text || null == text || "" == text) text = "選択してください"; var cnt = json.length; var tag = ""; var array = new Array(); var flg = false; var select = null; var option = null; if( document.getElementById(idDiv).hasChildNodes() )
{ document.getElementById(idDiv).removeChild( document.getElementById(idDiv).firstChild );}
for(var y = 0; y < cnt; y++)
{ array.push(json[y]);}
array.sort( function(a, b){ return a.pdbKana < b.pdbKana ? -1 : 1;} ); for(var x = 0; x < cnt; x++)
{ if(!!json[x].pdb)
{ flg = true; break;}
}
if(true == flg)
{ select = document.createElement("select"); select.setAttribute("id", idPdb); for(var y = 0, tmp = array.length; y < cnt; y++)
{ for(var x = 0; x < cnt; x++)
{ if(!!json[x].pdb && array[y].pdb == json[x].pdb)
{ option = document.createElement("option"); option.text = json[x].pdb; option.value= json[x].lat + "," + json[x].lon; select.options.add(option); break;}
}
}
document.getElementById(idDiv).appendChild(select); document.getElementById(idPdb).onchange = new Function( this.instanceName + ".wrap_setCenter1(this.value)" );}
}
this.put_markerBatch = function(noPolygon)
{ if(!noPolygon) noPolygon = null; var iconName; var icon; for(var y = 0, cnt = this.arrayMarker.length; y < cnt; y++)
{ if(null == this.arrayMarker[y]["noPolygon"] || noPolygon == this.arrayMarker[y]["noPolygon"])
{ icon = this.obtain_marker(this.arrayMarker[y]["iconName"], this.arrayMarker[y]["lat"], this.arrayMarker[y]["lon"]); this.put_marker( icon, y, new GPoint(this.arrayMarker[y]["lon"], this.arrayMarker[y]["lat"]) );}
}
}
this.put_marker = function(icon, y, point)
{ var instanceName = this.instanceName; this.arrayMarker[y]["object"] = new GMarker(point, icon); if(y == null || 0 == this.arrayMarker[y]["mode"])
{ if(null != this.arrayMarker[y]["iwText"] && "" != this.arrayMarker[y]["iwText"])
{ GEvent.addListener
( this.arrayMarker[y]["object"], "click", function()
{ eval( instanceName + ".arrayMarker[y]['object'].openInfoWindowHtml(" + instanceName + ".arrayMarker[y]['iwText']);" );} );}
}
else if(1 == this.arrayMarker[y]["mode"])
{ GEvent.addListener
( this.arrayMarker[y]["object"], "click", function()
{ eval( instanceName + ".draw_streetViewInfoWindow_onePoint(" + instanceName + ".arrayMarker[y]['object'], y);" )
} );}
GEvent.addListener
( this.arrayMarker[y]["object"], "dblclick", function()
{ eval( instanceName + ".map.setCenter( new GLatLng(point.y, point.x) );" );} ); this.map.addOverlay(this.arrayMarker[y]["object"]);}
this.put_markerWhenDisappearing = function()
{ this.remove_markerDrag(); this.put_makerDrag( this.map.getCenter(), null, this.obtain_marker(this.iconImg_drag) );}
this.put_makerDrag = function(point, iwText, icon, flg)
{ if(null == this.geocoder) this.geocoder = new GClientGeocoder(); if(!iwText) iwText = null; if( "undefined" == typeof(flg) ) flg = true; var instanceName = this.instanceName; var address1; var flgLock = !this.flgLock; var marker; var geocoder = this.geocoder; if( "string" == typeof(point) ) point = this.string2GPoint(point); this.arrayMarkerDrag[this.yMarkerDrag] = new GMarker(point, {icon: icon, draggable:flgLock}); this.map.addOverlay(this.arrayMarkerDrag[this.yMarkerDrag]); marker = this.arrayMarkerDrag[this.yMarkerDrag]; this.yMarkerDrag++; if(null != iwText && '' != iwText)
{ GEvent.addListener
( marker, "click", function()
{ marker.openInfoWindowHtml(iwText);} );}
GEvent.addListener
( marker, "dragend", function()
{ eval( "var latLngObj = " + instanceName + ".map.getCenter();" ); eval( instanceName + ".toId_generalPurpose('idLat', latLngObj.y);" ); eval( instanceName + ".toId_generalPurpose('idLon', latLngObj.x);" ); var latLngObj = marker.getPoint(); if(true == flg)
{ eval( instanceName + ".toId_generalPurpose('idLatMarker', latLngObj.y);" ); eval( instanceName + ".toId_generalPurpose('idLonMarker', latLngObj.x);" ); eval( instanceName + ".reverseGeocoder_addressByLatLng(latLngObj, 0);" ); eval( instanceName + ".arrayTimerIdReverseGeocoder[0] = setInterval( instanceName + '.reverseGeocoder_interval_address2id(0)', 100 );" );}
else
{ eval( instanceName + ".toId_generalPurpose('idLatMarker1', latLngObj.y);" ); eval( instanceName + ".toId_generalPurpose('idLonMarker1', latLngObj.x);" ); eval( instanceName + ".reverseGeocoder_addressByLatLng(latLngObj, 1);" ); eval( instanceName + ".arrayTimerIdReverseGeocoder[1] = setInterval( instanceName + '.reverseGeocoder_interval_address2id(1)', 100 );" );}
} );}
this.put_svMarker = function(svLat, svLon, yaw, pitch, zoom)
{ if(!!yaw) this.svYaw = yaw; if(!!pitch) this.svPitch= pitch; if(!!zoom) this.svZoom = zoom; var instanceName = this.instanceName; var latlng = new GLatLng(svLat, svLon); var svIcon = new GIcon(G_DEFAULT_ICON); var client = new GStreetviewClient(); var svPoint; this.sv = new GStreetviewOverlay(); this.svMarkerImg= this.obtain_svMarkerImg_fromYaw(yaw); this.svLat = svLat; this.svLon = svLon; svIcon.image = this.svMarkerImg; svIcon.shadow = null; svIcon.imageMap = [26,13, 30,14, 32,28, 27,28, 28,36, 18,35, 18,27, 16,26, 16,20, 16,14, 19,13, 22,8]; svIcon.iconSize = new GSize(49, 52); svIcon.iconAnchor = new GPoint(25, 35); svIcon.infoWindowAnchor = new GPoint(25, 35); this.svMarker = new GMarker( latlng, {icon: svIcon, draggable: true} ); this.map.addOverlay(this.svMarker); GEvent.addListener
( eval(instanceName + ".svMarker"), "drag", function()
{ eval( instanceName + ".svMarker.setImage('http://www.google.com/intl/ja_jp/mapfiles/cb/man_fly_left.png');" );} ); GEvent.addListener
( eval(instanceName + ".svMarker"), "dragend", function()
{ eval( instanceName + ".toId_svLatLon('', '');" ); eval( instanceName + ".svMarker.setImage(" + instanceName + ".svMarkerImg);" );} ); GEvent.addListener
( eval(instanceName + ".svMarker"), "click", function()
{ var latLngObj = eval( instanceName + ".svMarker.getPoint();" ); eval( instanceName + ".draw_streetViewInfoWindow(latLngObj.y, latLngObj.x);" );} ); GEvent.addListener
( eval(instanceName + ".svMarker"), "dragend", function()
{ eval( instanceName + ".svYaw = null; " ); eval( instanceName + ".svPitch = null;" ); eval( instanceName + ".svZoom = null;" ); var latLngObj = eval( instanceName + ".svMarker.getPoint();" ); svPoint = new GLatLng(latLngObj.y, latLngObj.x); client.getNearestPanorama
( svPoint, function(data)
{ if(data.code == 200)
{ var gpObj = new GLatLng(data.location.latlng.y, data.location.latlng.x); eval( instanceName + ".svMarker.setPoint(gpObj);" ); eval( instanceName + ".svLat = data.location.latlng.y;" ); eval( instanceName + ".svLon = data.location.latlng.x;" ); eval( instanceName + ".flgSvPanoramaDisp = true;" );}
else
{ eval( instanceName + ".flgSvPanoramaDisp = false;" );}
} );} );}
this.put_control = function()
{ if(true == this.flgLock)
{ this.map.disableDragging(); this.map.disableInfoWindow(); this.map.disableDoubleClickZoom();}
else
{ if(true == this.flgControl_GLargeMapControl) this.map.addControl( new GLargeMapControl() ); if(true == this.flgControl_GSmallMapControl) this.map.addControl( new GSmallMapControl() ); if(true == this.flgControl_GSmallZoomControl) this.map.addControl( new GSmallZoomControl() ); if(true == this.flgControl_GScaleControl) this.map.addControl( new GScaleControl() ); if(true == this.flgControl_WheelZoom) this.map.enableScrollWheelZoom(); if(true == this.flgControl_GMapTypeControl)
{ this.map.addControl( new GMapTypeControl(1) ); if(true == this.flgControl_G_PHYSICAL_MAP) this.map.addMapType(G_PHYSICAL_MAP);}
if(true == this.flgControl_GOverviewMapControl)
{ var miniMap = new GOverviewMapControl( new GSize(this.miniMapW, this.miniMapH) ); this.map.addControl(miniMap);}
}
}
this.remove_arrayMarker = function()
{ for(var y = 0, cnt = this.arrayMarker.length; y < cnt; y++)
{ this.map.removeOverlay(this.arrayMarker[y]["object"]);}
this.y = 0; this.arrayMarker= new Array();}
this.remove_markerDrag = function()
{ for(var y = 0, cnt = this.arrayMarkerDrag.length; y < cnt; y++)
{ this.map.removeOverlay(this.arrayMarkerDrag[y]);}
this.yMarkerDrag = 0; this.arrayMarkerDrag= new Array();}
this.draw_streetViewLine = function()
{ if(false == this.flgSvLine)
{ this.map.addOverlay(this.sv);}
else
{ this.map.removeOverlay(this.sv);}
this.flgSvLine = !this.flgSvLine;}
this.draw_streetViewInfoWindow = function(svLat, svLon)
{ var instanceName = this.instanceName; var panorama; if(false == this.flgSvPanoramaDisp) return; if(null == this.svYaw) this.svYaw = 0; if(null == this.svPitch) this.svPitch= 5; if(null == this.svZoom) this.svZoom = 0; this.toId_generalPurpose("idSvZoom", this.svZoom); panorama = document.createElement('div'); panorama.style.width = this.sizeSvInfoWindow_w + 'px'; panorama.style.height = this.sizeSvInfoWindow_h + 'px'; panorama.id = 'pano'; this.svMarker.openInfoWindow(panorama); this.svInfoWindow = this.map.getInfoWindow(); this.panorama = new GStreetviewPanorama(panorama); this.panorama.setLocationAndPOV( this.svMarker.getLatLng(), {yaw:this.svYaw, pitch:this.svPitch, zoom:this.svZoom} ); this.toId_svLatLon(svLat, svLon); GEvent.addListener
( eval(instanceName + ".panorama"), "initialized", function(location)
{ eval( instanceName + ".svMarker.setPoint( new GLatLng(location.latlng.y, location.latlng.x) );" ); eval( instanceName + ".svInfoWindow.reset( new GLatLng(location.latlng.y, location.latlng.x), " + instanceName + ".svInfoWindow.tabs, new GSize(" + instanceName + ".sizeSvInfoWindow_w, " + instanceName + ".sizeSvInfoWindow_h) );" ); eval( instanceName + ".toId_generalPurpose('idSvLat', location.latlng.y);" ); eval( instanceName + ".toId_generalPurpose('idSvLon', location.latlng.x);" );} ); if(null != this.idSvYaw)
{ GEvent.addListener
( eval(instanceName + ".panorama"), "yawchanged", function(yaw)
{ eval( instanceName + ".svMarker.setImage( " + instanceName + ".obtain_svMarkerImg_fromYaw(yaw) );" ); eval( instanceName + ".toId_generalPurpose('idSvYaw', yaw);" );} );}
if(null != this.idSvPitch)
{ GEvent.addListener
( eval(instanceName + ".panorama"), "pitchchanged", function(pitch)
{ eval( instanceName + ".toId_generalPurpose('idSvPitch', pitch);" );} );}
if(null != this.idSvZoom)
{ GEvent.addListener
( eval(instanceName + ".panorama"), "zoomchanged", function(zoom)
{ eval( instanceName + ".toId_generalPurpose('idSvZoom', zoom);" );} );}
}
this.draw_streetViewInfoWindow_onePoint = function(marker, y)
{ var instanceName = this.instanceName; var panorama = document.createElement('div'); var latlng = new GLatLng(this.arrayMarker[y]["svLat"], this.arrayMarker[y]["svLon"]); var point = new GLatLng(this.arrayMarker[y]["lat"], this.arrayMarker[y]["lon"]); panorama.style.width = this.sizeSvInfoWindow_w + 'px'; panorama.style.height = this.sizeSvInfoWindow_h + 'px'; panorama.id = 'pano'; if
( !this.arrayMarker[y]["iwText"] || "" == this.arrayMarker[y]["iwText"] || null== this.arrayMarker[y]["iwText"]
)
{ marker.openInfoWindow(panorama);}
else
{ tabList = [ new GInfoWindowTab("詳細", this.arrayMarker[y]["iwText"]), new GInfoWindowTab("外観", panorama)
]
this.map.openInfoWindowTabsHtml(point, tabList);}
this.panorama = new GStreetviewPanorama(panorama); this.panorama.setLocationAndPOV
( latlng, { yaw : this.arrayMarker[y]["svYaw"], pitch : this.arrayMarker[y]["svPitch"], zoom : this.arrayMarker[y]["svZoom"]
} );}
this.draw_polygon = function()
{ var lat; var lon; var cnt1 = this.arrayPolygon.length; var arrayNo = new Array(); var arraySplit = new Array(); var arrayPoints = new Array(); if(1 > cnt1) return; arrayNo = this.draw_polygonSplitArray(this.arrayPolygon, "no"); for(var y = 0, cnt = arrayNo.length; y < cnt; y++)
{ arrayPoints = new Array(); lat = 0; lon = 0; for(var y2 = 0; y2 < cnt1; y2++)
{ if(arrayNo[y] == this.arrayPolygon[y2]['no'])
{ arrayPoints.push( new GPoint(this.arrayPolygon[y2]['lon'], this.arrayPolygon[y2]['lat']) ); if(0 == lat)
{ lat = this.arrayPolygon[y2]['lat']; lon = this.arrayPolygon[y2]['lon'];}
}
}
arrayPoints.push( new GPoint(lon, lat) ); var polygon = new GPolygon
( arrayPoints, this.arrayPolygonDetail[y]["lineColor"], this.arrayPolygonDetail[y]["lineThick"], this.arrayPolygonDetail[y]["lineAlpha"], this.arrayPolygonDetail[y]["paintColor"], this.arrayPolygonDetail[y]["paintAlpha"] ); this.map.addOverlay(polygon); this.draw_polygonSetClickEvent
( polygon, this.arrayPolygonDetail[y]["lat"], this.arrayPolygonDetail[y]["lon"], this.arrayPolygonDetail[y]["zoom"], y, this.arrayPolygonDetail[y]["iwText"] );}
}
this.draw_polygonSplitArray = function(array, key)
{ var arrayRst = new Array(); for(var y = 0, cnt = array.length; y < cnt; y++)
{ arrayRst[ array[y][key] ] = array[y][key];}
return arrayRst;}
this.draw_polygonSetClickEvent = function(polygon, lat, lon, zoom, noPolygon, textWindow)
{ var instanceName = this.instanceName; if(!!textWindow && null != textWindow && "" != textWindow && noPolygon != this.noPolygon)
{ GEvent.addListener
( polygon, "mouseover", function()
{ eval( instanceName + ".map.openInfoWindowHtml( new GLatLng(lat, lon), textWindow );" );} ); GEvent.addListener
( polygon, "mouseout", function()
{ eval( instanceName + ".map.closeInfoWindow();" );} );}
if(noPolygon != this.noPolygon)
{ GEvent.addListener
( polygon, "click", function()
{ eval( instanceName + ".map.setCenter(new GLatLng(lat, lon), zoom);" ); eval( instanceName + ".set_noPolygon(" + noPolygon + ")" ); eval( instanceName + ".switch_marker_polygon(" + noPolygon + ")" );} );}
}
this.draw_polygon_circle = function()
{ var nelat; var swlng; var x; var y; var px; var py; var point; var latlngbounds; var southwest; var northeast; var lefttop; var latlng; var latlngs; var polygon; for(var Y = 0, cnt = this.arrayPolygon_circle.length; Y < cnt; Y++)
{ point = this.map.fromLatLngToDivPixel( new GLatLng(this.arrayPolygon_circle[Y]["lat"], this.arrayPolygon_circle[Y]["lon"]) ); latlngbounds= this.map.getBounds(); southwest = latlngbounds.getSouthWest(); northeast = latlngbounds.getNorthEast(); nelat = northeast.lat(); swlng = southwest.lng(); lefttop = this.map.fromLatLngToDivPixel( new GLatLng(nelat, swlng) ); x = point.x - lefttop.x; y = point.y - lefttop.y; latlngs = []; for(var i = 0 ; i < this.arrayPolygon_circle[Y]["level"]; i++)
{ py = y + this.arrayPolygon_circle[Y]["radius"] * Math.sin( i * Math.PI / (this.arrayPolygon_circle[Y]["level"] / 2) ); px = x + this.arrayPolygon_circle[Y]["radius"] * Math.cos( i * Math.PI / (this.arrayPolygon_circle[Y]["level"] / 2) ); latlng = this.map.fromContainerPixelToLatLng( new GPoint(px, py) ); latlngs.push(latlng);}
latlngs.push( this.map.fromContainerPixelToLatLng( new GPoint(x + this.arrayPolygon_circle[Y]["radius"], y) ) ); polygon = new GPolygon(latlngs, "#ff0000", 5, 0.5, "#0000ff", 0.1); this.map.addOverlay(polygon);}
}
this.draw_polyline = function()
{ var y; var y2; var cnt1 = this.arrayPolyline.length; var arrayNo = new Array(); var arraySplit = new Array(); var arrayPoints = new Array(); if(1 > cnt1) return; arrayNo = this.draw_polygonSplitArray(this.arrayPolyline, "no"); for(y = 0, cnt = arrayNo.length; y < cnt; y++)
{ arrayPoints = new Array(); lat = 0; lon = 0; for(y2 = 0; y2 < cnt1; y2++)
{ if(arrayNo[y] == this.arrayPolyline[y2]['no'])
{ arrayPoints.push( new GPoint(this.arrayPolyline[y2]['lon'], this.arrayPolyline[y2]['lat']) );}
}
var polyline = new GPolyline
( arrayPoints, this.arrayPolylineDetail[y]["lineColor"], this.arrayPolylineDetail[y]["lineThick"], this.arrayPolylineDetail[y]["lineAlpha"] ); this.map.addOverlay(polyline);}
}
this.draw_polyline_distance = function(arrayPoints)
{ var cntVertex; if(!arrayPoints)
{ arrayPoints = new Array(); cntVertex = this.polylineDistance.getVertexCount(); this.map.removeOverlay(this.polylineDistance); arrayPoints.push( this.arrayMarkerDrag[0].getPoint() ); for(var y = 1; y < cntVertex - 1; y++){ arrayPoints.push( this.polylineDistance.getVertex(y) );}
arrayPoints.push( this.arrayMarkerDrag[1].getPoint() );}
this.polylineDistance = new GPolyline
( arrayPoints, "#ff00ff", 5, 0.5 ); this.map.addOverlay(this.polylineDistance); this.toId_distance(); if(true != this.flgStraight)
{ this.polylineDistance.enableEditing({onEvent:"mouseover"}); this.polylineDistance.disableEditing({onEvent:"mouseout"});}
if(0 == this.limiter)
{ GEvent.addListener
( this.arrayMarkerDrag[0], "dragend", function()
{ eval( instanceName + ".draw_polyline_distance();" );} ); GEvent.addListener
( this.arrayMarkerDrag[1], "dragend", function()
{ eval( instanceName + ".draw_polyline_distance();" );} );}
this.limiter++; GEvent.addListener
( this.polylineDistance, "click", function
( latlng, index
)
{ eval( instanceName + ".refresh_polyline_distance(index);" );} ); GEvent.addListener
( this.polylineDistance, "dragend", function
( latlng, index
)
{ eval( instanceName + ".refresh_polyline_distance(index);" );} );}
this.draw_arietyOverlays = function(name)
{ var instanceName= this.instanceName; var fnc = function(memberVariable)
{ if(null == memberVariable)
{ memberVariable = new GLayer(name); eval( instanceName + ".map.addOverlay(memberVariable);" );}
else
{ eval( instanceName + ".map.removeOverlay(memberVariable);" ); memberVariable = null;}
return memberVariable;}
switch(name)
{ case "com.panoramio.all": this.overlay_panoramio_all= fnc(this.overlay_panoramio_all); break; case "org.wikipedia.ja" : this.overlay_wikipedia_jp = fnc(this.overlay_wikipedia_jp); break;}
}
this.refresh_polyline_distance = function(index)
{ var cntVertex; var latS; var lonS; var latG; var lonG; var instanceName = this.instanceName; var address1; if( "number" == typeof(index) )
{ this.polylineDistance.deleteVertex(index);}
this.toId_distance(); cntVertex = this.polylineDistance.getVertexCount(); latS = this.polylineDistance.getVertex(0).y; lonS = this.polylineDistance.getVertex(0).x; latG = this.polylineDistance.getVertex( (cntVertex - 1) ).y; lonG = this.polylineDistance.getVertex( (cntVertex - 1) ).x; this.arrayMarkerDrag[0].setPoint( new GLatLng(latS, lonS) ); this.arrayMarkerDrag[1].setPoint( new GLatLng(latG, lonG) ); var latLngObjS = this.arrayMarkerDrag[0].getPoint(); var latLngObjG = this.arrayMarkerDrag[1].getPoint(); this.toId_generalPurpose("idLatMarker", latLngObjS.y); this.toId_generalPurpose("idLonMarker", latLngObjS.x); this.toId_generalPurpose("idLatMarker1",latLngObjG.y); this.toId_generalPurpose("idLonMarker1",latLngObjG.x); this.reverseGeocoder_addressByLatLng(latLngObjS, 0); this.arrayTimerIdReverseGeocoder[0] = setInterval( instanceName + ".reverseGeocoder_interval_address2id(0)", 100 ); this.reverseGeocoder_addressByLatLng(latLngObjG, 1); this.arrayTimerIdReverseGeocoder[1] = setInterval( instanceName + ".reverseGeocoder_interval_address2id(1)", 100 );}
this.geocoder_latLngByAddress = function(address)
{ var instanceName = this.instanceName; var pointStr; ; if(null == this.geodosu_apikey)
{ if(null == this.geocoder)
{ this.geocoder = new GClientGeocoder();}
this.geocoder.getLatLng
( address, function(point)
{ if(point)
{ pointStr = String(point); pointStr = pointStr.replace("(", ""); pointStr = pointStr.replace(")", ""); eval( instanceName + '.arrayPoint	= pointStr.split(", ");' ); eval( instanceName + ".point = point;" );}
else
{ eval( instanceName + ".arrayPoint = null;" );}
} );}
else
{ if(null == this.geocoder_geodosu)
{ this.geocoder_geodosu = new GClientGeocoderWithGeodosu(this.geodosu_apikey);}
this.geocoder_geodosu.getLatLng
( address, function(point)
{ if(point)
{ pointStr = String(point); pointStr = pointStr.replace("(", ""); pointStr = pointStr.replace(")", ""); eval( instanceName + '.arrayPoint = pointStr.split(", ");' ); eval( instanceName + ".point = point;" );}
else
{ eval( instanceName + ".arrayPoint = null;" );}
} );}
}
this.geocoder_search = function(address, flgReset)
{ if( "unefined" == typeof(flgReset) ) flgReset = true; this.arrayPoint = new Array(); var instanceName = this.instanceName; if(true == flgReset)
{ this.remove_markerDrag();}
this.geocoder_latLngByAddress(address); this.timerId_geocoder = setInterval(instanceName + ".geocoder_iw('" + address + "')", 100);}
this.geocoder_iw = function(address)
{ if(null == this.arrayPoint)
{ alert("『" + address + "』は見つかりませんでした。"); this.toId_generalPurpose("idLatMarker", ""); this.toId_generalPurpose("idLonMarker", ""); clearInterval(this.timerId_geocoder);}
else if(0 != this.arrayPoint.length)
{ infoWindow= "<br />" + address + "<br /><br />" + "緯度：" + this.arrayPoint[0]+ "<br />" + "緯度：" + this.arrayPoint[1]+ "<br /><br />" + "緯度/経度：" + this.arrayPoint[0]+ "/" + this.arrayPoint[1]; var icon = this.obtain_marker(this.icomImg_gc, this.point.y, this.point.x); this.put_makerDrag(this.point, infoWindow, icon); this.map.setCenter(this.point); this.toId_generalPurpose("idLatMarker", this.point.y); this.toId_generalPurpose("idLonMarker", this.point.x); clearInterval(this.timerId_geocoder);}
else
{ }
}
this.geocoder_distance = function(mode, address)
{ this.arrayPoint = new Array(); var instanceName = this.instanceName; this.geocoder_latLngByAddress(address); this.timerId_geocoder = setInterval(instanceName + ".geocoder_iwDistance(" + mode + ", '" + address + "')", 100);}
this.geocoder_iwDistance = function(mode, address)
{ if(null == this.arrayPoint)
{ alert("『" + address + "』は見つかりませんでした。"); clearInterval(this.timerId_geocoder);}
else if(0 != this.arrayPoint.length)
{ this.arrayMarkerDrag[mode].setPoint(this.point); this.map.setCenter(this.point); this.limiter = 0; this.draw_polyline_distance(); latlon = new GLatLng(this.point.y, this.point.x)
if(0 == mode)
{ this.toId_generalPurpose("idLatMarker", this.point.y); this.toId_generalPurpose("idLonMarker", this.point.x);}
else
{ this.toId_generalPurpose("idLatMarker1", this.point.y); this.toId_generalPurpose("idLonMarker1", this.point.x);}
this.reverseGeocoder_addressByLatLng(latlon, mode); this.arrayTimerIdReverseGeocoder[mode] = setInterval( instanceName + ".reverseGeocoder_interval_address2id(" + mode + ")", 100 ); clearInterval(this.timerId_geocoder);}
else
{ }
}
this.string2GPoint = function(pointStr)
{ var arrayPoint = new Array(); pointStr = pointStr.replace("(", ""); pointStr = pointStr.replace(")", ""); arrayPoint = pointStr.split(", "); return new GPoint(arrayPoint[1], arrayPoint[0]);}
this.reverseGeocoder_addressByLatLng = function(latLngObj, y)
{ if(null == this.geocoder) this.geocoder = new GClientGeocoder(); this.arrayAddressReverseGeocoder[y] = null; var instanceName = this.instanceName; var ret = null; this.geocoder.getLocations
( latLngObj, function(addresses)
{ if(addresses.Status.code != 200)
{ ret = "住所が分かりません";}
else
{ address = addresses.Placemark[0]; ret = address.address; ret = ret.replace(/^日本/, "");}
eval( instanceName + ".arrayAddressReverseGeocoder[" + y + "] = ret;" );} );}
this.reverseGeocoder_interval_address2id = function(mode)
{ var id; if(null != this.arrayAddressReverseGeocoder[mode])
{ id = 0 == mode ? "idReverseGeocoding" : "idReverseGeocoding1"; this.toId_generalPurpose(id, this.arrayAddressReverseGeocoder[mode]); clearInterval(this.arrayTimerIdReverseGeocoder[mode]);}
}
this.switch_marker_polygon = function(noPolygon)
{ this.map.clearOverlays(); this.draw_polygon(); this.put_markerBatch(noPolygon);}
this.wrap_setCenter = function(lat, lon)
{ this.map.setCenter( new GLatLng(lat, lon) );}
this.wrap_setCenter1 = function(latLonText)
{ if(!latLonText || null == latLonText || "" == latLonText) return; var array = latLonText.split(","); this.wrap_setCenter(array[0], array[1]);}
this.wrap_setZoom = function(zoom)
{ this.map.setZoom(zoom);}
this.json_disp = function(jsonUrl)
{ var instanceName = this.instanceName; var json; var fnc = function(json, instanceName)
{ for(var y = 0, cnt = json.length; y < cnt; y++)
{ if( "undefined" == typeof(json[y].iwText) || "" == json[y].iwText)
{ json[y].iwText = null;}
if(!json[y].icon)
{ if(!json[y].svLat)
{ eval( instanceName + ".set_marker(json[y].lat, json[y].lon, json[y].iwText);" );}
else
{ eval( instanceName + ".set_marker_sv(json[y].lat, json[y].lon, json[y].svLat, json[y].svLon, json[y].svYaw, json[y].svPitch, json[y].svZoom, json[y].iwText);" );}
}
else
{ if(!json[y].svLat)
{ eval( instanceName + ".set_marker_originalIcon(json[y].icon, json[y].lat, json[y].lon, json[y].iwText);" );}
else
{ eval( instanceName + ".set_marker_originalIcon_sv(json[y].icon, json[y].lat, json[y].lon, json[y].svLat, json[y].svLon, json[y].svYaw, json[y].svPitch, json[y].svZoom, json[y].iwText);" );}
}
}
eval( instanceName + ".put_markerBatch();" );}
GDownloadUrl
( jsonUrl+= "?time=" + new Date().getTime(), function(jsondata, responseCode)
{ if(200 == responseCode)
{ json= eval( "(" + jsondata + ")" ); eval( instanceName + ".remove_arrayMarker();" ); fnc(json, instanceName); eval( instanceName + ".toId_jsonPdb(json, 'pdb', 'test');" );}
else
{ alert("error::It failed in reading the json file.");}
} );}
this.display = function()
{ var instanceName = this.instanceName; this.put_control(); this.toId_latLonZoom(); this.put_markerBatch(); this.draw_polygon(); this.draw_polygon_circle(); this.draw_polyline(); this.draw_arietyOverlays();}
this.display_dragMarker = function()
{ var point = new GPoint(); this.put_control(); this.toId_latLonZoom(); this.put_makerDrag( new GPoint(this.lonMarker, this.latMarker), null, this.obtain_marker(this.iconImg_drag) ); this.toId_generalPurpose("idLatMarker", this.latMarker); this.toId_generalPurpose("idLonMarker", this.lonMarker);}
this.display_dragMarker_distance = function(markerS, markerE, flg)
{ if(!markerS) markerS = "g-markerA"; if(!markerE) markerE = "g-markerB"; if( "undefined" == typeof(flg) ) flg = true; var instanceName = this.instanceName; var arrayPoints = new Array(); var latLngObjS = new GLatLng(this.latMarker, this.lonMarker); var latLngObjE = new GLatLng(this.latMarker1, this.lonMarker1); this.put_control(); this.toId_latLonZoom(); this.put_makerDrag( new GPoint(this.lonMarker, this.latMarker), null, this.obtain_marker(markerS) ); this.put_makerDrag( new GPoint(this.lonMarker1, this.latMarker1), null, this.obtain_marker(markerE), false ); this.toId_generalPurpose("idLatMarker", this.latMarker); this.toId_generalPurpose("idLonMarker", this.lonMarker); this.toId_generalPurpose("idLatMarker1",this.latMarker1); this.toId_generalPurpose("idLonMarker1",this.lonMarker1); if(true === flg) this.reverseGeocoder_addressByLatLng(latLngObjS, 0); this.arrayTimerIdReverseGeocoder[0] = setInterval( instanceName + ".reverseGeocoder_interval_address2id(0)", 100 ); if(true === flg) this.reverseGeocoder_addressByLatLng(latLngObjE, 1); this.arrayTimerIdReverseGeocoder[1] = setInterval( instanceName + ".reverseGeocoder_interval_address2id(1)", 100 ); arrayPoints.push( new GPoint(this.lonMarker, this.latMarker) ); arrayPoints.push( new GPoint(this.lonMarker1, this.latMarker1)); this.limiter = 0; this.draw_polyline_distance(arrayPoints);}
}

