{"id":3601,"date":"2014-07-02T10:27:08","date_gmt":"2014-07-02T01:27:08","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=3601"},"modified":"2014-07-02T10:29:14","modified_gmt":"2014-07-02T01:29:14","slug":"post-3601","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/google-map-api\/3601","title":{"rendered":"\u30b9\u30c8\u30ea\u30fc\u30c8\u30d3\u30e5\u30fc\u306e\u30ab\u30e1\u30e9\u306e\u5411\u304d\u3092\u81ea\u52d5\u7684\u306b\u8abf\u6574\u3059\u308b"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/07\/streetviewcamera20140701.jpg\" alt=\"streetviewcamerapov\" width=\"300\" height=\"505\" class=\"aligncenter size-full wp-image-3600\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/07\/streetviewcamera20140701.jpg 300w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/07\/streetviewcamera20140701-89x150.jpg 89w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u307e\u3041\u3001\u4e0a\u8a18\u306e\u753b\u50cf\u3067\u5168\u3066\u8aac\u660e\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3002<\/p>\n<p>Google \u306e\u30b9\u30c8\u30ea\u30fc\u30c8\u30d3\u30e5\u30fc\u306f\u7def\u5ea6\u7d4c\u5ea6\u3092\u6e21\u3059\u3068\u3001\u305d\u306e\u4f4d\u7f6e\u304b\u3089\u4e00\u756a\u8fd1\u3044\u30b9\u30c8\u30ea\u30fc\u30c8\u30d3\u30e5\u30fc\u5bfe\u5fdc\u30a8\u30ea\u30a2\u3092\u691c\u51fa\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\u6642\u3001\u30ab\u30e1\u30e9\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u65b9\u5411\u3092\u5411\u3044\u3066\u3044\u308b\u306e\u3067\u3001\u5bfe\u8c61\u7269\u304c\u5199\u3063\u3066\u3044\u308b\u3068\u306f\u9650\u3089\u305a\u3001\u30de\u30a6\u30b9\u3067\u30b0\u30ea\u30b0\u30ea\u52d5\u304b\u3057\u3066\u898b\u306a\u3044\u3068\u5bfe\u8c61\u7269\u304c\u898b\u3048\u307e\u305b\u3093\u3002<br \/>\n\u3053\u308c\u3092\u3001\u691c\u51fa\u3055\u308c\u305f\u5bfe\u5fdc\u30a8\u30ea\u30a2\u304b\u3089\u5143\u306e\u5bfe\u8c61\u7269\u3078\u306e\u7def\u5ea6\u7d4c\u5ea6\u306e\u65b9\u5411\u3078\u3001\u30b9\u30c8\u30d3\u30e5\u30fc\u306e\u30ab\u30e1\u30e9\u3092\u81ea\u50cd\u7684\u306b\u5411\u3051\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\nGoogle Maps API\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u3066\uff12\u5730\u70b9\u9593\u306e\u65b9\u5411\u3092\u8a08\u7b97\u3057\u3001\u30b9\u30c8\u30ea\u30fc\u30c8\u30d3\u30e5\u30fc\u306e\u30ab\u30e1\u30e9\u306e\u5411\u304d\u3092\u5bfe\u8c61\u7269\u3078\u3068\u5411\u3051\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u4f5c\u3063\u3066\u307f\u305f\u7269<\/h2>\n<p>\u30aa\u30fc\u30d7\u30f3\u30c7\u30fc\u30bf\u3068\u3057\u3066\u516c\u958b\u3055\u308c\u3066\u3044\u308b<a href=\"http:\/\/www.city.muroran.lg.jp\/main\/org2260\/odlib.php\">\u5ba4\u862d\u5e02\u306e\u300c\u7802\u7bb1\u300d\u306e\u4f4d\u7f6e\u60c5\u5831<\/a>\u3092\u4f7f\u3063\u3066\u30c7\u30e2\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u30b9\u30c8\u30ea\u30fc\u30c8\u30d3\u30e5\u30fc\u304b\u3089\u53d6\u5f97\u3057\u305f\u753b\u50cf\u306b\u7802\u7bb1\u304c\u6620\u3063\u3066\u3044\u308c\u3070\u3001\u30ab\u30e1\u30e9\u304c\u6b63\u3057\u304f\u5bfe\u8c61\u7269\u306e\u65b9\u5411\u3078\u5411\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/shimz.me\/example\/gmapv3\/streetview\/muroran_sbako\/index.html\">example<\/a><\/p>\n<p>\u7802\u7bb1\u306f\u3053\u308c\u2193<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/07\/sunabako.jpg\" alt=\"sunabako\" width=\"90\" height=\"81\" class=\"alignnone size-full wp-image-3604\" \/><\/p>\n<p>\u691c\u51fa\u3055\u308c\u308b\u30b9\u30c8\u30ea\u30fc\u30c8\u30d3\u30e5\u30fc\u5bfe\u5fdc\u30dd\u30a4\u30f3\u30c8\u5834\u6240\u306b\u3088\u3063\u3066\u306f\u3001\u5bfe\u8c61\u7269\u3068\u30b9\u30c8\u30ea\u30fc\u30c8\u30d3\u30e5\u30fc\u30dd\u30a4\u30f3\u30c8\u306e\u9593\u306b\u5730\u7269\u304c\u631f\u307e\u3063\u3066\u3066\u3001\u898b\u3048\u306a\u304b\u3063\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h3>\n<pre class=\"lang:js decode:true \" >window.onhashchange  = getSubakoPhoto;\r\ngetSubakoPhoto();\r\n\r\nfunction getSubakoPhoto() {\r\n\r\n\td3.selectAll(\".pagerlink\").remove();\r\n\td3.selectAll(\".subakoraw\").remove();\r\n\t\r\n\t\/\/pager\u51e6\u7406\r\n\tvar page = +location.hash.replace(\"#\", \"\");\r\n\tif (typeof page != \"number\") page = 0;\r\n\tvar endpage = page+20;\r\n\t\t\r\n\t\r\n\td3.json(\"subako.geojson\", function(geojson){\r\n\t\tvar sbako_table = d3.select('#stage');\r\n\t\t\r\n\t\tvar pageNumber = d3.range(0, geojson.features.length, 20);\r\n\t\t\/\/pager\u8a2d\u7f6e\r\n\t\td3.select(\"#pager\")\r\n\t\t\t.selectAll(\"pagerlink\")\r\n\t\t\t.data(pageNumber)\r\n\t\t\t.enter()\r\n\t\t\t.append(\"a\")\r\n\t\t\t.attr({\r\n\t\t\t\t\"class\":\"pagerlink\",\r\n\t\t\t\t\"href\": function(d){ return \"http:\/\/shimz.me\/example\/gmapv3\/streetview\/muroran_sbako\/index.html#\" + d }\r\n\t\t\t})\r\n\t\t\t.style(\"margin\", \"5px\")\r\n\t\t\t.text(function(d, i){ return i })\r\n\t\t\t.on(\"click\", function(d){\r\n\t\t\t\tlocation.href = \"http:\/\/shimz.me\/example\/gmapv3\/streetview\/muroran_sbako\/index.html#\" + d ;\r\n\t\t\t})\r\n\r\n\t\tsetTimeout(function(){\r\n\t\t\t\t   loop(geojson.features.slice(page, endpage))\r\n\t\t} , 500);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tfunction loop(features){\r\n\t\t\tvar div = sbako_table.append(\"div\").attr(\"class\", \"subakoraw\");\r\n\t\t\tvar raw = features.pop();\t\t\t\r\n\t\t\tvar latlng = raw.geometry.coordinates;\r\n\r\n\t\t\tgetStreetViewPov(\r\n\t\t\t\t{\r\n\t\t\t\t\tlat:latlng[1] ,\r\n\t\t\t\t\tlng:latlng[0]\r\n\t\t\t\t},\r\n\t\t\t\tfunction(stv){\r\n\t\t\t\t\t\/\/street view image url \u3092\u53d6\u5f97\u3057img\u306esrc\u306b\u8a2d\u5b9a\r\n\t\t\t\t\tdiv.append(\"img\")\r\n\t\t\t\t\t\t.attr(\"src\", \"http:\/\/maps.googleapis.com\/maps\/api\/streetview?size=300x200&amp;location=\"+stv.lat+\",\"+stv.lng+\"&amp;heading=\"+stv.heading+\"&amp;pitch=\"+stv.pov.pitch+\"&amp;sensor=false\");\r\n\t\t\t\t\tdiv.append(\"p\").text(raw.properties[\"\u6574\u7406\u756a\u53f7\"]);\r\n\t\t\t\t\tdiv.append(\"a\")\r\n\t\t\t\t\t\t.attr({\r\n\t\t\t\t\t\t\t\"href\": \"https:\/\/www.google.com\/maps\/place\/\"+latlng[1]+\",\"+latlng[0],\r\n\t\t\t\t\t\t\t\"target\": \"_blank\"\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.text(\"lat:\"+latlng[1]+\" lng:\"+latlng[0]);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\tif (features.length &gt; 0) setTimeout(function(){\r\n\t\t\t\tloop(features);\r\n\t\t\t}, 500);\r\n\t\t\r\n\t\t}\r\n\t})\r\n\t\r\n\t\/* street view \u521d\u671f\u5316 *\/\r\n\tvar panoOptions = {\r\n\t\tpanControl: false,\r\n\t\taddressControl: false,\r\n\t\tlinksControl: false,\r\n\t\tzoomControlOptions: false\r\n\t};\r\n\tvar pano = new  google.maps.StreetViewPanorama(document.getElementById('streetview'), panoOptions);\r\n\tvar service = new google.maps.StreetViewService;\r\n\r\n\t\r\n\t\/\/heading,pov\u53d6\u5f97\r\n\tfunction getStreetViewPov(arg , callback) {\r\n\t\t\/\/\u5bfe\u8c61\u7269\u7def\u5ea6\u7d4c\u5ea6\u8a2d\u5b9a\r\n\t\tvar lookTo = new google.maps.LatLng(arg.lat, arg.lng); \r\n\t\tpano.setPosition(lookTo);\r\n\t\r\n\t\tservice.getPanoramaByLocation(pano.getPosition(), 50, function(panoData) {\r\n\t\t\tif (panoData != null) {\r\n\t\t\t\t\/\/\u691c\u51fa\u3055\u308c\u305fstreetview\u5bfe\u5fdc\u4f4d\u7f6e(\u7def\u5ea6\u7d4c\u5ea6)\u3092\u53d6\u5f97\r\n\t\t\t\tvar panoCenter = panoData.location.latLng;\r\n\t\t\t\t\/\/\uff12\u5730\u70b9\u9593(streetview\u5bfe\u5fdc\u4f4d\u7f6e\u3068\u5bfe\u8c61\u7269\u306e\u7def\u5ea6\u7d4c\u5ea6)\u306e\u65b9\u5411\u3092\u8a08\u7b97\r\n\t\t\t\tvar heading = google.maps.geometry.spherical.computeHeading(panoCenter, lookTo);\r\n\t\t\t\t\/\/pov\u3092\u53d6\u5f97\r\n\t\t\t\tvar pov = pano.getPov();\r\n\t\t\t\t\r\n\t\t\t\t\/\/\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u306e\u5f15\u6570\u3068\u3057\u3066\u53d6\u5f97\u3057\u305f\u5024\u3092\u6e21\u3059\r\n\t\t\t\tcallback({heading:heading, pov:pov, lat:arg.lat, lng:arg.lng});\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log('not found StreetView point'); \r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n};<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u307e\u3041\u3001\u4e0a\u8a18\u306e\u753b\u50cf\u3067\u5168\u3066\u8aac\u660e\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3002 Go&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3600,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-3601","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\/3601","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=3601"}],"version-history":[{"count":0,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3601\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/3600"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=3601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=3601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=3601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}