{"id":3108,"date":"2013-10-24T13:53:49","date_gmt":"2013-10-24T04:53:49","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=3108"},"modified":"2013-12-29T22:43:09","modified_gmt":"2013-12-29T13:43:09","slug":"post-3108","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/google-map-api\/3108","title":{"rendered":"[GMaps API v3] \u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u5185\u306e\u8981\u7d20\u306b\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u3092\u8a2d\u5b9a\u3067\u304d\u306a\u3044\u5834\u5408\u306e\u5bfe\u5fdc"},"content":{"rendered":"<p>\u4e88\u60f3\u5916\u306e\u3068\u3053\u308d\u3067\u5f15\u3063\u304b\u304b\u3063\u305f\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u30e1\u30e2\u3002<\/p>\n<p>Google Maps API\u306e\u4ed5\u69d8\u3092\u3088\u304f\u7406\u89e3\u3067\u304d\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u306a\u306b\u304b\u52d8\u9055\u3044\u3057\u3066\u3044\u308b\u306e\u304b\u3082\u3057\u308c\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3067\u8a2d\u7f6e\u3057\u305f\u8981\u7d20\u306b\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u3092\u8a2d\u5b9a\u3067\u304d\u305a\u306b\u56f0\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"lang:xhtml decode:true \" >&lt;body&gt;\r\n    &lt;div id=&quot;map_canvas&quot;&gt;&lt;\/div&gt;\r\n    &lt;div id=&quot;CustomControl_Block&quot;&gt;\r\n        &lt;input id=&quot;SearchAddress&quot; type=&quot;text&quot; placeholder=&quot;\u4f4f\u6240\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044&quot;&gt;&lt;\/input&gt;&lt;button id=&quot;SearchAddressRun&quot;&gt;\u79fb\u52d5&lt;\/button&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/body&gt;\r\n<\/pre>\n<pre class=\"lang:js mark:16-18 decode:true \" >function initialize() {\r\n    var mapDiv = document.getElementById(&quot;map_canvas&quot;);\r\n    var mapObj = new google.maps.Map(mapDiv, {\r\n            center : new google.maps.LatLng(36.322356, 139.013057),\r\n            zoom : 15,\r\n            mapTypeId : google.maps.MapTypeId.ROADMAP\r\n    });\r\n    \r\n    \/\/\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u8a2d\u7f6e\r\n    var controlDiv = document.createElement('div');\r\n    var CustomControl_block = document.getElementById(&quot;CustomControl_Block&quot;);\r\n    controlDiv.appendChild(CustomControl_block);\r\n    mapObj.controls[google.maps.ControlPosition.LEFT_BOTTOM].push(controlDiv);\r\n\r\n    \/\/\u3053\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3060\u3068\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u3092\u8a2d\u5b9a\u3067\u304d\u306a\u3044\r\n    document.getElementById(&quot;SearchAddressBtn&quot;).addEventListener('click', function() {\r\n        alert(document.getElementById(&quot;SearchAddress&quot;).value); \r\n    });\r\n              \r\n}\r\n\r\ngoogle.maps.event.addDomListener(window, &quot;load&quot;, initialize); \r\n<\/pre>\n<p>\u3053\u308c\u3060\u3068\u3001\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u3082\u4f55\u3082\u53cd\u5fdc\u3057\u306a\u3044 orz<br \/>\n\u3069\u3046\u3082\u3001div\u8981\u7d20\u304c\u53d6\u5f97\u3055\u308c\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3068\u3057\u3066\u914d\u7f6e\u3055\u308c\u308b\u307e\u3067\u306e\u9593\u306bgetElementById\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u3044\u30bf\u30a4\u30df\u30f3\u30b0\u304c\u3042\u308a\u3001\u3053\u306e\u307e\u307e\u3067\u306f\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u306e\u8a2d\u7f6e\u304c\u3067\u304d\u306a\u3044\u3063\u307d\u3044\u3067\u3059\u3002<br \/>\n\u3068\u308a\u3042\u3048\u305a\u3001\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306b\u6307\u5b9a\u3057\u305f\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u307e\u3067\u5f85\u3063\u3066\u304b\u3089\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u3092\u8a2d\u7f6e\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3089\u89e3\u6c7a\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"lang:js mark:15 decode:true \" >    \/\/\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u304c\u8868\u793a\u3055\u308c\u308b\u307e\u3067\u5f85\u3064   \r\n    !(function waiteCustomContorlDisplayed(){\r\n           setTimeout(function(){\r\n               \/\/\u30d5\u30a9\u30fc\u30e0\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u304b\u30c1\u30a7\u30c3\u30af\r\n               if(document.getElementById(&quot;CustomControl_Block&quot;)){\r\n                   \r\n                   \/\/\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u304b\u3089\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u3092\u8a2d\u5b9a                \r\n                    document.getElementById(&quot;SearchAddressBtn&quot;).addEventListener(&quot;click&quot;, function(){\r\n                        alert(document.getElementById(&quot;SearchAddress&quot;).value);     \r\n                    });\r\n                   \r\n               }else{\r\n                   waiteCustomContorlDisplayed(); \/\/\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u307e\u3067\u30eb\u30fc\u30d7\r\n               }\r\n           }, 500);\r\n       })();         \r\n<\/pre>\n<p><a href=\"http:\/\/shimz.me\/example\/gmapv3\/CustomControl\/index.html\">example<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e88\u60f3\u5916\u306e\u3068\u3053\u308d\u3067\u5f15\u3063\u304b\u304b\u3063\u305f\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u30e1\u30e2\u3002&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-3108","post","type-post","status-publish","format-standard","hentry","category-google-map-api"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3108","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=3108"}],"version-history":[{"count":1,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3108\/revisions"}],"predecessor-version":[{"id":3262,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3108\/revisions\/3262"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=3108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=3108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=3108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}