{"id":3542,"date":"2014-05-29T10:31:19","date_gmt":"2014-05-29T01:31:19","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=3542"},"modified":"2014-05-29T10:31:50","modified_gmt":"2014-05-29T01:31:50","slug":"post-3542","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/google-map-api\/3542","title":{"rendered":"Google \u30b9\u30c8\u30ea\u30fc\u30c8\u30d3\u30e5\u30fc\u3092\u30d1\u30ce\u30e9\u30de\u753b\u50cf\u3068\u3057\u3066\u8868\u793a\u3059\u308b\u300cGSVPano.js\u300d"},"content":{"rendered":"<p><a href=\"http:\/\/shimz.me\/example\/gmapv3\/GSVpano\/02\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/05\/gsvpano.jpg\" alt=\"gsvpano\" width=\"590\" height=\"547\" class=\"aligncenter border size-full wp-image-3543\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/05\/gsvpano.jpg 590w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/05\/gsvpano-162x150.jpg 162w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/shimz.me\/example\/gmapv3\/GSVpano\/02\/\">example<\/a><\/p>\n<p>\u300cGSVPano.js\u300d\u3092\u4f7f\u3046\u3068\u3001\u30b9\u30c8\u30ea\u30fc\u30c8\u30d3\u30e5\u30fc\u306e\u753b\u50cf\u3092\u4f7f\u7528\u3057\u305f\u30d1\u30ce\u30e9\u30de(<a href=\"https:\/\/developers.google.com\/maps\/documentation\/javascript\/streetview?hl=ja#CustomStreetView\">\u30ab\u30b9\u30bf\u30e0\u30b9\u30c8\u30ea\u30fc\u30c8\u30d3\u30e5\u30fc\u30d1\u30ce\u30e9\u30de<\/a>)\u3092\u7c21\u5358\u306b\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b5\u30f3\u30d7\u30eb<\/h2>\n<pre class=\"lang:js decode:true \" >\r\nvar messageDiv = document.getElementById( 'messageDiv' );\r\nvar errorDiv = document.getElementById( 'errorDiv' );\r\n\r\nfunction showError( message ) {\r\n\terrorDiv.innerHTML = message;\r\n}\r\n\r\nfunction showMessage( message ) {\r\n\tmessageDiv.innerHTML += message;\r\n}\r\n\t\r\nwindow.addEventListener( 'load', function() {\r\n\r\n\t\/*GSVpano\u3000\u30e1\u30c3\u30bb\u30fc\u30b8\u51fa\u529b\u8a2d\u5b9a*\/\r\n\tshowMessage( 'Starting...<br\/>' );\r\n\t\r\n\tloader = new GSVPANO.PanoLoader( {\r\n\t\tzoom: 1\r\n\t} );\r\n\t\r\n\tloader.onSizeChange = function() { \r\n\t\tshowMessage( 'Size changed' );\r\n\t};\r\n\t;\r\n\t\r\n\tloader.onPanoramaData = function( result ) {\r\n\t\tshowMessage( 'Panorama OK.<br\/>Load started' );\r\n\t}\r\n\t\r\n\tloader.onNoPanoramaData = function( status ) {\r\n\t\tshowError(\"\u30b9\u30c8\u30ea\u30fc\u30c8\u30d3\u30e5\u30fc\u975e\u5bfe\u5fdc\u30a8\u30ea\u30a2\u3067\u3059: \" + status);\r\n\t}\r\n\r\n\tloader.onProgress = function( p ) {\r\n\t\tshowMessage( '.' );\r\n\t};\r\n\t\r\n\tloader.onError = function( message ) {\r\n\t\tshowMessage( 'Error: ' + message );\r\n\t};\r\n\t\r\n\tloader.onPanoramaLoad = function() {\r\n\t\t\r\n\t\tshowMessage( ' finished.<br\/>' );\r\n\t\tdocument.querySelector(\"#GSVPano\").appendChild( this.canvas );\r\n\t\tshowMessage( 'Panorama loaded, street view data ' + this.copyright + '.<br\/>' );\r\n\t\t\r\n\t};\r\n\t\r\n\r\n\t\/\/ Google Maps API \u8a2d\u5b9a\r\n\tvar mapDiv = document.getElementById(\"map_canvas\");\r\n\tvar map = new google.maps.Map(mapDiv, {\r\n\t\tcenter : new google.maps.LatLng(36.322356, 139.013057),\r\n\t\tnavigationControl: true,\r\n\t\tdraggableCursor: 'crosshair',draggingCursor: 'move',\r\n\t\tzoom : 15,\r\n\t\tmapTypeId : google.maps.MapTypeId.ROADMAP\t\t\r\n\t});\r\n\t\r\n\t\/\/\u30af\u30ea\u30c3\u30af\u30a4\u30d9\u30f3\u30c8\u8a2d\u5b9a\r\n\tgoogle.maps.event.addListener(map, 'click', function(event){\r\n\t\tconsole.log(event.latLng);\r\n\t\tmessageDiv.innerHTML = \"\";\r\n\t\terrorDiv.innerHTML = \"\";\r\n\t\tloader.load(event.latLng); \/\/\u30d1\u30ce\u30e9\u30de\u3092\u8868\u793a  \t\r\n\t});\r\n\t\r\n});<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>example \u300cGSVPano.js\u300d\u3092\u4f7f\u3046\u3068\u3001&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3543,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-3542","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-map-api","has-post-thumbnail-archive"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/comments?post=3542"}],"version-history":[{"count":0,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3542\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/3543"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=3542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=3542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=3542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}