{"id":3103,"date":"2013-10-21T10:44:59","date_gmt":"2013-10-21T01:44:59","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=3103"},"modified":"2020-08-19T17:52:48","modified_gmt":"2020-08-19T08:52:48","slug":"post-3103","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/google-map-api\/3103","title":{"rendered":"Google Maps API\u3067\u7def\u5ea6\u7d4c\u5ea6\u3092\u5143\u306b\u30d7\u30ed\u30c3\u30c8\u3057\u305f\u30de\u30fc\u30ab\u30fc\u306e\u4f4d\u7f6e\u304c\u305a\u308c\u308b\uff08\u6e2c\u5730\u7cfb\u5909\u63db\uff09"},"content":{"rendered":"<p>\u67d0\u793e\u306eAPI\u304b\u3089\u53d6\u5f97\u3057\u305f\u7269\u4ef6\u30c7\u30fc\u30bf\u306e\u7def\u5ea6\u7d4c\u5ea6\u3092\u5143\u306bGoogle Map\u4e0a\u306b\u30d7\u30ed\u30c3\u30c8\u3059\u308b\u3060\u3051\u306e\u7c21\u5358\u306a\u304a\u4ed5\u4e8b\u2026\u2026\u3068\u601d\u3063\u3066\u3044\u305f\u3089\u7269\u4ef6\u304c\u5ddd\u306e\u3069\u771f\u3093\u4e2d\u306b\u6d6e\u304b\u3093\u3067\u304a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2013\/10\/Proj4js.jpg\" alt=\"Proj4js\" width=\"602\" height=\"346\" class=\"aligncenter size-full wp-image-3104\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2013\/10\/Proj4js.jpg 602w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2013\/10\/Proj4js-261x150.jpg 261w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/p>\n<p>\u5b8c\u5168\u306b\u30ba\u30ec\u30c6\u30fc\u30e9\u3002<\/p>\n<p>\u7269\u4ef6\u30c7\u30fc\u30bf\u306b\u8a18\u9332\u3055\u308c\u3066\u3044\u308b\u7def\u5ea6\u7d4c\u5ea6\u304c\u304a\u305d\u3089\u304f\u300c\u65e5\u672c\u6e2c\u5730\u7cfb\u300d\u3044\u3046\u3084\u3064\u306a\u3093\u3060\u308d\u3046\u306a\u3068\u601d\u3044\u3064\u3064\u3001\u4e00\u5fdc\u78ba\u8a8d\u3057\u3066\u304a\u3053\u3046\u304b\u3068\u30b5\u30dd\u30fc\u30c8\u306b\u9023\u7d61\u3057\u305f\u3068\u3053\u308d\u300c\u6e2c\u5730\u7cfb\u3001\u306f\u3041\uff1f\u3000\u304a\u524d\u4f55\u8a00\u3063\u3066\u3093\u306e\uff1f\u300d\u3050\u3089\u3044\u306e\u30ea\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u8fd4\u3063\u3066\u304d\u305f\u306e\u3067\u3001\u4ed5\u65b9\u304c\u306a\u304f\u9069\u5f53\u306b\u3044\u308d\u3044\u308d\u8a66\u3057\u3066\u4f55\u3068\u304b\u3059\u308b\u3053\u3068\u306b\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u300cEPSG:4301\u300d\u304b\u3089\u300cEPSG:4326\u300d\u306b\u5909\u63db\u3059\u308c\u3070\u4e0a\u624b\u304f\u884c\u304f\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3063\u3066\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u6e2c\u5730\u7cfb\u306e\u5909\u63db\u306b\u306f\u4ee5\u4e0b\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/trac.osgeo.org\/proj4js\/\">Proj4js<\/a><\/p>\n<h2>\u30b5\u30f3\u30d7\u30eb<\/h2>\n<pre class=\"lang:js decode:true \" >\/\/\u65e5\u672c\u6e2c\u5730\u7cfb\u306e\u5ba3\u8a00\nProj4js.defs['EPSG:4301'] = &quot;+proj=longlat +ellps=bessel +towgs84=-146.336,506.832,680.254,0,0,0,0 + no_defs&quot;;    \n\n\/\/Proj4js\u30a8\u30e9\u30fc\u767a\u751f\u6642\u306e\u52d5\u4f5c\u3092\u767b\u9332\nProj4.reportError = function(msg) {console.log(msg);}\n\n\/\/\u65e5\u672c\u6e2c\u5730\u7cfb\u304b\u3089\u4e16\u754c\u6e2c\u5730\u7cfb\u3078\u306e\u5909\u63db\u95a2\u6570\nfunction transformJ2W(lon,lat){\n    var source = new Proj4.Proj('EPSG:4301'); \n    var dest = new Proj4.Proj('EPSG:4326');\n    var p = Proj4.transform(source, dest, [lon, lat]); \n    return p;\n}\n\n\/\/\u65e5\u672c\u6e2c\u5730\u7cfb\u304b\u3089\u4e16\u754c\u6e2c\u5730\u7cfb\u3078\u306e\u5909\u63db\nvar j2w = transformJ2W(long, lat);\u3000\/\/\u5909\u63db\nconsole.log([j2w.y, j2w.x]) \/\/\u5909\u63db\u3057\u305f\u5024\u3092\u51fa\u529b<\/pre>\n<p>\u3068\u308a\u3042\u3048\u305a\u30011000\u4ef6\u307b\u3069\u8a66\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u307e\u3041\u3001\u8a31\u5bb9\u7bc4\u56f2\u3067\u306f\u306a\u3044\u304b\u3068\u3044\u3046\u3068\u3053\u308d\u307e\u3067\u30ba\u30ec\u304c\u76f4\u3063\u305f\u306e\u3067\u826f\u3057\u3068\u3057\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u67d0\u793e\u306eAPI\u304b\u3089\u53d6\u5f97\u3057\u305f\u7269\u4ef6\u30c7\u30fc\u30bf\u306e\u7def\u5ea6\u7d4c\u5ea6\u3092\u5143\u306b&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3104,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-3103","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\/3103","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=3103"}],"version-history":[{"count":0,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3103\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/3104"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=3103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=3103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=3103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}