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 cnt; var g_path_GoogleMap_getCoordinates = getGlobalPath(); var array = new Array(); array = g_path_GoogleMap_getCoordinates.split("/"); cnt = array.length; g_path_GoogleMap_getCoordinates = g_path_GoogleMap_getCoordinates.replace(array[cnt - 1], ""); var GoogleMap_getCoordinatesVer2 = function(instanceName, divName, lat, lon, zoom)
{ if( "undefined" == typeof(lat) ) lat = 34.9763729373547; if( "undefined" == typeof(lon) ) lon = 135.75041502714157; if( "undefined" == typeof(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.modeGcIw = 0; 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.version = "1.10"; 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.idGc = null; this.idDistance = null; this.strGc = ""; this.imgH; this.imgW; this.svMarkerImg = null; this.distanceUnit = "km"; this.iconImg_drag = "g-red"; this.icomImg_gc = "g-arrowSmall80"; this.errDistanceS = "始点住所"; this.errDistanceE = "終点住所"; this.arrayMarkerDrag = 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.flgGcMove = true; 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.flgReverseGeocodingInfoWindow = false; this.map = new GMap2( document.getElementById(divName) ); this.geocoder = 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.json = null; this.map.setCenter( new GLatLng(this.lat, this.lon), this.zoom ); this.set_errDistance = function(errDistanceS, errDistanceE)
{ if( "undefined" != typeof(this.errDistanceS) && null != this.errDistanceS) this.errDistanceS = errDistanceS; if( "undefined" != typeof(this.errDistanceE) && null != this.errDistanceE) this.errDistanceE = errDistanceE;}
this.set_flgLock = function(flgLock)
{ this.flgLock = flgLock;}
this.set_flgGcMove = function(flgGcMove)
{ this.flgGcMove = flgGcMove;}
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("undefined" != typeof(miniMapH) ) this.miniMapH = miniMapH; if("undefined" != typeof(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_flgReverseGeocodingInfoWindow = function(flgReverseGeocodingInfoWindow)
{ this.flgReverseGeocodingInfoWindow = flgReverseGeocodingInfoWindow;}
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_idGc = function(idGc)
{ this.idGc = idGc;}
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( "undefined" != typeof(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("undefined" != typeof(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("undefined" != typeof(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("undefined" != typeof(iwText) && null != iwText && "" != iwText)
{ this.arrayMarker[this.y]["iwText"] = iwText;}
if("undefined" != typeof(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("undefined" == typeof(svZoom) ) svZoom = 0; if("undefined" == typeof(svPitch) ) svPitch = 0; if("undefined" == typeof(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("undefined" == typeof(svZoom) ) svZoom = 0; if("undefined" == typeof(svPitch) ) svPitch = 0; if("undefined" == typeof(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)
{ var cnt; cnt = array.length; this.arrayPolygon = new Array(); for(var y = 0; 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];}
cnt = array1.length; this.arrayPolygonDetail = new Array(); for(var y = 0; 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)
{ var cnt = array.length; this.arrayPolygon_circle = new Array(); for(var y = 0; 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)
{ var cnt; cnt = array.length; this.arrayPolyline = new Array(); for(var y = 0; 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];}
cnt = array1.length; this.arrayPolylineDetail = new Array(); for(var y = 0; 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("undefined" == typeof(cross_px) ) cross_px = 30; if("undefined" == typeof(cross_td) ) cross_td = 2; if("undefined" == typeof(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_modeGcIw = function(modeGcIw)
{ this.modeGcIw = modeGcIw;}
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.get_polyline_distanc_vertex = function()
{ var cntVertex = this.polylineDistance.getVertexCount(); var str = ""; for(var y = 0; y < cntVertex; y++)
{ str+= y + "," + this.polylineDistance.getVertex(y).y + "," + this.polylineDistance.getVertex(y).x + "\n";}
return str;}
this.get_reverseGeocoding = function(idOrIw, idName, latLngObj)
{ if(null == this.geocoder) this.geocoder = new GClientGeocoder(); if( "id" == idOrIw && !!!document.getElementById(idName) )
{ return;}
var instanceName = this.instanceName; var address1 = null; var tmpFnc = function(geocoder)
{ geocoder.getLocations
( latLngObj, function(addresses)
{ if(addresses.Status.code != 200)
{ address1 = "住所が分かりません(" + latLngObj.toUrlValue() + ")";}
else
{ address = addresses.Placemark[0]; address1 = address.address; address1 = address1.replace(/^日本/, "");}
switch(idOrIw)
{ case "id": document.getElementById(idName).value = address1; break; case "iw": eval( instanceName + ".map.openInfoWindow(latLngObj, address1);" ); break;}
} );}
if("id" == idOrIw)
{ tmpFnc(this.geocoder);}
else if("iw" == idOrIw && true == this.flgReverseGeocodingInfoWindow)
{ GEvent.addListener
( this.map, "click", function(overlay, latLngObj1)
{ if( "undefined" == typeof(latLngObj1) ) return; latLngObj = latLngObj1; eval( "tmpFnc(" + instanceName + ".geocoder);" );} );}
}
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;}
}
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_latLonZoom = function()
{ var instanceName = this.instanceName; var latLngObj = this.map.getCenter(); if(null != this.idLat) document.getElementById(this.idLat).value = latLngObj.y; if(null != this.idLon) document.getElementById(this.idLon).value = latLngObj.x; if(null != this.idZoom) document.getElementById(this.idZoom).value = this.map.getZoom(); GEvent.addListener
( eval( instanceName + ".map" ), "moveend", function()
{ eval( "latLngObj = "+ instanceName + ".map.getCenter();" ); eval( "if(null != " + instanceName + ".idLat)	document.getElementById(" + instanceName + ".idLat).value	= latLngObj.y;" ); eval( "if(null != " + instanceName + ".idLon)	document.getElementById(" + instanceName + ".idLon).value	= latLngObj.x;" ); eval( "if(null != " + instanceName + ".idZoom)	document.getElementById(" + instanceName + ".idZoom).value	= " + instanceName + ".map.getZoom();" );} );}
this.toId_coordinatesMarker = function(lat, lon)
{ if
( null != this.idLatMarker &&
null != this.idLonMarker
)
{ document.getElementById(this.idLatMarker).value = lat; document.getElementById(this.idLonMarker).value = lon;}
}
this.toId_coordinatesMarker_distance = function(lat, lon)
{ if
( null != this.idLatMarker1 &&
null != this.idLonMarker1
)
{ document.getElementById(this.idLatMarker1).value = lat; document.getElementById(this.idLonMarker1).value = lon;}
}
this.toId_distance = function(flg)
{ var unit = this.polylineDistance.getLength(); if( "undefined" == typeof(flg) ) flg = true; 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;}
document.getElementById("distance").value = unit;}
else
{ document.getElementById("distance").value = "";}
}
}
this.toId_svLatLon = function(lat, lon)
{ if(null != this.idSvLat) document.getElementById(this.idSvLat).value = lat; if(null != this.idSvLon) document.getElementById(this.idSvLon).value = lon;}
this.toId_idReverseGeocoding = function(idReverseGeocoding, idReverseGeocoding1)
{ if( null != this.idReverseGeocoding && "undefined" != typeof(idReverseGeocoding) && null != idReverseGeocoding )
{ document.getElementById(this.idReverseGeocoding).value = idReverseGeocoding;}
if( null != this.idReverseGeocoding1 && "undefined" != typeof(idReverseGeocoding1) && null != idReverseGeocoding1 )
{ document.getElementById(this.idReverseGeocoding1).value = idReverseGeocoding1;}
}
this.toId_jsonPdb = function(idDiv, idPdb, text)
{ if( "undefined" == text || null == text || "" == text) text = "選択してください"; var cnt = this.json.length; var tag = ""; for(var y = 0; y < cnt; y++)
{ if( "undefined" != typeof(this.json[y].pdb) )
{ tag+= '	<option value="' + this.json[y].lat + "," + this.json[y].lon + '">' + this.json[y].pdb + "</option>\n";}
}
if("" == tag)
{ tag = "";}
else
{ tag = '<select id="' + idPdb + '" onchange="' + this.instanceName + '.wrap_setCenter1(this.value)">\n' + '	<option value="">' + text + "</option>\n" + tag + "</select>\n";}
document.getElementById(idDiv).innerHTML = tag;}
this.put_markerBatch = function(noPolygon)
{ if( "undefined" == typeof(noPolygon) ) noPolygon = null; var cnt = this.arrayMarker.length; var iconName; var icon; for(var y = 0; 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(); var instanceName = this.instanceName; var address1; var flgLock = !this.flgLock; var marker; var geocoder = this.geocoder; if( "string" == typeof(point) ) point = this.string2GPoint(point); if( "undefined" == typeof(iwText) ) iwText= null; if( "undefined" == typeof(flg) ) flg = true; 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( "if(null != " + instanceName + ".idLat)	document.getElementById(" + instanceName + ".idLat).value	= latLngObj.y;" ); eval( "if(null != " + instanceName + ".idLon)	document.getElementById(" + instanceName + ".idLon).value	= latLngObj.x;" ); var latLngObj = marker.getPoint(); if(true == flg)
{ eval( instanceName + ".toId_coordinatesMarker(latLngObj.y, latLngObj.x)" ); eval( instanceName + ".get_reverseGeocoding('id', " + instanceName + ".idReverseGeocoding, latLngObj);" );}
else
{ eval( instanceName + ".toId_coordinatesMarker_distance(latLngObj.y, latLngObj.x)" ); eval( instanceName + ".get_reverseGeocoding('id', " + instanceName + ".idReverseGeocoding1, latLngObj);" );}
} );}
this.put_svMarker = function(svLat, svLon, yaw, pitch, 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; if("undefined" != typeof(yaw) ) this.svYaw = yaw; if("undefined" != typeof(pitch) ) this.svPitch = pitch; if("undefined" != typeof(zoom) ) this.svZoom = zoom; 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()
{ var cnt = this.arrayMarker.length; for(var y = 0; y < cnt; y++)
{ this.map.removeOverlay(this.arrayMarker[y]["object"]);}
this.y = 0; this.arrayMarker= new Array();}
this.remove_markerDrag = function()
{ var cnt = this.arrayMarkerDrag.length; for(var y = 0; 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; if(null != this.idSvZoom) document.getElementById(this.idSvZoom).value = 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( "if(null != " + instanceName + ".idSvLat) document.getElementById(" + instanceName + ".idSvLat).value = location.latlng.y;" ); eval( "if(null != " + instanceName + ".idSvLon) document.getElementById(" + instanceName + ".idSvLon).value = 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( "document.getElementById(" + instanceName + ".idSvYaw).value = yaw;" );} );}
if(null != this.idSvPitch)
{ GEvent.addListener
( eval(instanceName + ".panorama"), "pitchchanged", function(pitch)
{ eval( "document.getElementById(" + instanceName + ".idSvPitch).value = pitch;" );} );}
if(null != this.idSvZoom)
{ GEvent.addListener
( eval(instanceName + ".panorama"), "zoomchanged", function(zoom)
{ eval( "document.getElementById(" + instanceName + ".idSvZoom).value = 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
( "undefined" == typeof(this.arrayMarker[y]["iwText"]) || "" == typeof(this.arrayMarker[y]["iwText"]) || null == typeof(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 y; var y2; var lat; var lon; var cnt = this.arrayPolygon.length; var arrayNo = new Array(); var arraySplit = new Array(); var arrayPoints = new Array(); if(1 > cnt) return; arrayNo = this.draw_polygonSplitArray(this.arrayPolygon, "no"); for(y = 0; y < arrayNo.length; y++)
{ arrayPoints = new Array(); lat = 0; lon = 0; for(y2 = 0; y2 < cnt; 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 cnt = array.length; var arrayRst = new Array(); for(var y = 0; 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("undefined" != typeof(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 cnt = this.arrayPolygon_circle.length; 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; 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 cnt = this.arrayPolyline.length; var arrayNo = new Array(); var arraySplit = new Array(); var arrayPoints = new Array(); if(1 > cnt) return; arrayNo = this.draw_polygonSplitArray(this.arrayPolyline, "no"); for(y = 0; y < arrayNo.length; y++)
{ arrayPoints = new Array(); lat = 0; lon = 0; for(y2 = 0; y2 < cnt; 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( "undefined" == typeof(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 tmpFnc = function(map, memberVariable)
{ if(null == memberVariable)
{ memberVariable = new GLayer(name); map.addOverlay(memberVariable);}
else
{ map.removeOverlay(memberVariable); memberVariable = null;}
return memberVariable;}
switch(name)
{ case "com.panoramio.all": this.overlay_panoramio_all= tmpFnc(this.map, this.overlay_panoramio_all); break; case "org.wikipedia.ja" : this.overlay_wikipedia_jp = tmpFnc(this.map, this.overlay_wikipedia_jp); break;}
}
this.refresh_polyline_distance = function(index)
{ var cntVertex; var latS; var lonS; var latG; var lonG; 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_coordinatesMarker(latLngObjS.y, latLngObjS.x); this.toId_coordinatesMarker_distance(latLngObjG.y, latLngObjG.x); this.get_reverseGeocoding("id", this.idReverseGeocoding, latLngObjS); this.get_reverseGeocoding("id", this.idReverseGeocoding1, latLngObjG);}
this.geocoder_moveAndMarkerList = function(str)
{ var arrayAddress = new Array(); this.flgGcMove = false; arrayAddress = str.split("\n"); for(var y = 0; y < arrayAddress.length; y++)
{ arrayAddress[y] = arrayAddress[y].replace(/[\n\r]/g, ""); if(0 == y)
{ this.geocoder_moveAndMarker(arrayAddress[y]);}
else
{ this.geocoder_moveAndMarker(arrayAddress[y], false);}
}
}
this.geocoder_moveAndMarker = function(address, flgReset)
{ if("undefined" == typeof(flgReset) ) flgReset = true; var zoom = this.map.getZoom(); var modeGcIw = this.modeGcIw; var instanceName = this.instanceName; var pointStr; var infoWindow = ""; var idGc = this.idGc; var arrayPoint = new Array(); var arrayResult = new Array(); var flgGcMove = this.flgGcMove; if(true == flgReset)
{ this.remove_markerDrag();}
if(null == this.geocoder) this.geocoder = new GClientGeocoder(); if(null != this.idGc) this.strGc = ""; this.geocoder.getLatLng
( address, function(point)
{ pointStr = String(point); pointStr = pointStr.replace("(", ""); pointStr = pointStr.replace(")", ""); arrayPoint = pointStr.split(", "); if(point)
{ switch(modeGcIw)
{ case 1: infoWindow= "<br /><br />" + "緯度：" + arrayPoint[0] + "<br />" + "緯度：" + arrayPoint[1] + "<br /><br />" + "緯度/経度：" + arrayPoint[0] + "/" + arrayPoint[1]; break;}
eval( "var icon = " + instanceName + ".obtain_marker(" + instanceName + ".icomImg_gc, point.y, point.x);" ); eval( instanceName + ".put_makerDrag('" + point + "', '" + address + infoWindow + "', icon)" ); arrayResult[0] = arrayPoint[0]; arrayResult[1] = arrayPoint[1]; if(true == flgGcMove)
{ eval( instanceName + ".map.setCenter(point, zoom);" );}
eval( instanceName + ".toId_coordinatesMarker(" + point.y + ", " + point.x + ")" ); arrayResult[0] = "○,"; arrayResult[1] = arrayPoint[0] + "," + arrayPoint[1];}
else
{ arrayResult[0] = "×,"; arrayResult[1] = "見つかりませんでした。";}
if(null != idGc)
{ eval( instanceName + ".strGc+= '" + arrayResult[0] + address + "," + arrayResult[1] + "\\r\\n'" ); eval( "document.getElementById(" + instanceName + ".idGc).value = " + instanceName + ".strGc" );}
} );}
this.geocoder_distance = function(mode, address)
{ var zoom = this.map.getZoom(); var instanceName = this.instanceName; var pointStr; var arrayPoint = new Array(); var latlon; if(null == this.geocoder) this.geocoder = new GClientGeocoder(); this.geocoder.getLatLng
( address, function(point)
{ pointStr = String(point); pointStr = pointStr.replace("(", ""); pointStr = pointStr.replace(")", ""); arrayPoint = pointStr.split(", "); if(point)
{ eval( instanceName + ".arrayMarkerDrag[" + mode + "].setPoint(point);" ); eval( instanceName + ".map.setCenter(point, zoom);" ); eval( instanceName + ".limiter = 0;" ); eval( instanceName + ".draw_polyline_distance();" ); latlon = new GLatLng(point.y, point.x)
if(0 == mode)
{ eval( instanceName + ".toId_coordinatesMarker(point.y, point.x)" ); eval( instanceName + '.get_reverseGeocoding("id", ' + instanceName + '.idReverseGeocoding, latlon);' );}
else
{ eval( instanceName + ".toId_coordinatesMarker_distance(point.y, point.x)" ); eval( instanceName + '.get_reverseGeocoding("id", ' + instanceName + '.idReverseGeocoding1, latlon);' );}
}
else
{ eval( instanceName + ".toId_distance(false);" ); if(0 == mode)
{ eval( instanceName + ".toId_coordinatesMarker('', '')" ); eval( "alert(" + instanceName + ".errDistanceS + " + "'\\n『" + address + "』\\nは見つかりませんでした。');" ); eval( instanceName + '.toId_idReverseGeocoding("");' );}
else
{ eval( instanceName + ".toId_coordinatesMarker_distance('', '')" ); eval( "alert(" + instanceName + ".errDistanceE + " + "'\\n『" + address + "』\\nは見つかりませんでした。');" ); eval( instanceName + '.toId_idReverseGeocoding(null, "");' );}
}
} );}
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.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("undefined" == 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_put_marker = function(json)
{ this.json = json; var cnt = this.json.length; this.remove_arrayMarker(); for(var y = 0; y < cnt; y++)
{ if
( "undefined" == this.json[y].iwText || "" == this.json[y].iwText || null == this.json[y].iwText
)
{ this.json[y].iwText = null;}
switch(this.json[y].type)
{ case "marker" : this.set_marker( this.json[y].lat, this.json[y].lon, this.json[y].iwText); break; case "marker_originalIcon" : this.set_marker_originalIcon( this.json[y].icon, this.json[y].lat, this.json[y].lon, this.json[y].iwText); break; case "marker_sv" : this.set_marker_sv( this.json[y].lat, this.json[y].lon, this.json[y].svLat, this.json[y].svLon, this.json[y].svYaw, this.json[y].svPitch, this.json[y].svZoom, this.json[y].iwText); break; case "marker_originalIcon_sv" : this.set_marker_originalIcon_sv( this.json[y].icon, this.json[y].lat, this.json[y].lon, this.json[y].svLat, this.json[y].svLon, this.json[y].svYaw, this.json[y].svPitch, this.json[y].svZoom, this.json[y].iwText); break;}
}
this.put_markerBatch();}
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.get_reverseGeocoding('iw');}
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_coordinatesMarker( this.latMarker, this.lonMarker);}
this.display_dragMarker_distance = function()
{ 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("g-markerS") ); this.put_makerDrag( new GPoint(this.lonMarker1, this.latMarker1), null, this.obtain_marker("g-markerG"), false ); this.toId_coordinatesMarker( this.latMarker, this.lonMarker); this.toId_coordinatesMarker_distance( this.latMarker1,this.lonMarker1); this.get_reverseGeocoding("id", this.idReverseGeocoding, latLngObjS); this.get_reverseGeocoding("id", this.idReverseGeocoding1, latLngObjE); arrayPoints.push( new GPoint(this.lonMarker, this.latMarker) ); arrayPoints.push( new GPoint(this.lonMarker1, this.latMarker1)); this.limiter = 0; this.draw_polyline_distance(arrayPoints);}
}
