{"id":157897,"date":"2013-02-15T13:29:50","date_gmt":"2013-02-15T04:29:50","guid":{"rendered":"https:\/\/ja.wordpress.org\/support\/2013\/02\/15\/ajax%e3%81%a7php%e3%81%ab%e5%80%a4%e3%82%92%e6%b8%a1%e3%81%97%e3%81%a6%e5%87%ba%e5%8a%9b%e3%81%97%e3%81%9f%e3%81%84%e3%81%ae%e3%81%a7%e3%81%99%e3%81%8c%e2%80%a6\/"},"modified":"2013-02-15T13:29:50","modified_gmt":"2013-02-15T04:29:50","slug":"ajax%e3%81%a7php%e3%81%ab%e5%80%a4%e3%82%92%e6%b8%a1%e3%81%97%e3%81%a6%e5%87%ba%e5%8a%9b%e3%81%97%e3%81%9f%e3%81%84%e3%81%ae%e3%81%a7%e3%81%99%e3%81%8c%e2%80%a6","status":"closed","type":"topic","link":"https:\/\/ja.wordpress.org\/support\/topic\/ajax%e3%81%a7php%e3%81%ab%e5%80%a4%e3%82%92%e6%b8%a1%e3%81%97%e3%81%a6%e5%87%ba%e5%8a%9b%e3%81%97%e3%81%9f%e3%81%84%e3%81%ae%e3%81%a7%e3%81%99%e3%81%8c%e2%80%a6\/","title":{"rendered":"ajax\u3067php\u306b\u5024\u3092\u6e21\u3057\u3066\u51fa\u529b\u3057\u305f\u3044\u306e\u3067\u3059\u304c\u2026"},"content":{"rendered":"<p>WP\u30d3\u30ae\u30ca\u30fc\u306eBeat\u3068\u7533\u3057\u307e\u3059\u3002<br \/>\n\u8cea\u554f\u3055\u305b\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<p>Yahoo!\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308bYOLP<br \/>\n\uff08Yahoo! Open Local Platform\uff09\u3068\u3044\u3046\u5730\u56f3\u306b\u95a2\u3059\u308bAPI\u3092\u5229\u7528\u3057\u3066\u3001<br \/>\n\u73fe\u5728\u5730\u70b9\u304b\u3089\u306e\u76ee\u7684\u5730\u307e\u3067\u306e\u884c\u304d\u65b9\u3092\u53d6\u5f97\u3057\u3066\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u969b\u306b\u76ee\u7684\u5730\u307e\u3067\u25cb\u25cb\u30e1\u30fc\u30c8\u30eb\u3068\u8868\u793a\u3055\u308c\u308b\u5024\u3092\u3001<br \/>\njQuery\u306eajax\u6a5f\u80fd\u3092\u4f7f\u3063\u3066WP\u5074\u306b\u6e21\u3057\u3001<br \/>\n\u305d\u306e\u5024\u3092\u4f7f\u3063\u3066\u8ddd\u96e2\u304c\u8fd1\u3044\u9806\u306b\u5165\u308c\u66ff\u3048\u2026<br \/>\n\u7b49\u3092\u64cd\u4f5c\u3057\u305f\u3044\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305aYOLP\u304b\u3089\u5024\u3092\u53d6\u5f97\u3092\u5b8c\u4e86\u3057\u305f\u4e0a\u3067\u3001<br \/>\nPHP\u3067\u51fa\u529b\u3092\u958b\u59cb\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001<br \/>\n\u305d\u306e\u3088\u3046\u306a\u6280\u8853\u7684\u306b\u5b9f\u73fe\u53ef\u80fd\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p> `<br \/>\n&lt;!DOCTYPE html&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;meta charset=&#8221;UTF-8&#8243;&gt;<br \/>\n&lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width, initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no&#8221;&gt;<br \/>\n&lt;meta name=&#8221;apple-mobile-web-app-capable&#8221; content=&#8221;yes&#8221;&gt;<br \/>\n&lt;title&gt;\u30de\u30af\u3069\u3053&lt;\/title&gt;<br \/>\n&lt;style type=&#8221;text\/css&#8221;&gt;<br \/>\nhtml, body, div{<br \/>\n    margin:0; padding:0;<br \/>\n}<br \/>\na{<br \/>\n    color:#fff; font-weight:bold;<br \/>\n}<br \/>\ndiv#label{<br \/>\n    z-index:2;<br \/>\n    padding:8px;<br \/>\n    overflow:hidden;<br \/>\n    color: #fff;<br \/>\n    background-color: #000;<br \/>\n    background-image: -webkit-gradient(<br \/>\n        linear,<br \/>\n        0% 0%,<br \/>\n        0% 100%,<br \/>\n        from(rgba(155, 155, 155, 0.1)),<br \/>\n        to(rgba(255, 255, 255, 0.5)),<br \/>\n        color-stop(.5,rgba(155, 155, 155, 0.2)),<br \/>\n        color-stop(.5,rgba(255, 255, 255, 0.1))<br \/>\n    );<br \/>\n    border-radius: 8px;<br \/>\n    opacity: .7;<br \/>\n}<br \/>\ndiv#title{<br \/>\n    font-size:14pt;<br \/>\n    font-weight:bold;<br \/>\n    line-height:1.2em;<br \/>\n    width:100%;<br \/>\n    overflow:hidden;<br \/>\n}<br \/>\ndiv#desc{<br \/>\n    font-size:9pt;<br \/>\n    font-weight:normal;<br \/>\n    line-height:9pt;<br \/>\n    overflow:hidden;<br \/>\n}<br \/>\n&lt;\/style&gt;<br \/>\n&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<br \/>\n&lt;div id=&#8221;container&#8221; style=&#8221;width:100%; height:100%; position:relative;&#8221;&gt;<br \/>\n&lt;div id=&#8221;map&#8221; style=&#8221;width:100%; height:100%;&#8221;&gt;&lt;\/div&gt;<br \/>\n&lt;div id=&#8221;label&#8221; style=&#8221;position:absolute; bottom:4px; right:4px; width:92%; height:64px&#8221;&gt;<br \/>\n&lt;div id=&#8221;title&#8221;&gt;\u30de\u30af\u3069\u3053&lt;\/div&gt;<br \/>\n&lt;div id=&#8221;desc&#8221;&gt;always I&#8217;m lovin&#8217;it&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/body&gt;<\/p>\n<p>&lt;script src=&#8221;http:\/\/js.api.olp.yahooapis.jp\/OpenLocalPlatform\/V1\/jsapi?appid=dj0zaiZpPXEyMkYzTjZqU0hvVSZkPVlXazlaWFpsWlROdk16QW1jR285TUEtLSZzPWNvbnN1bWVyc2VjcmV0Jng9YTI-&#8220;&gt;&lt;\/script&gt;<br \/>\n&lt;script src=&#8221;http:\/\/code.jquery.com\/jquery-latest.js&#8221;&gt;&lt;\/script&gt;<br \/>\n&lt;script&gt;<br \/>\njQuery(document).ready(function($){<br \/>\n    \/\/resize container<br \/>\n    $(&#8216;#container&#8217;).css({height: parseInt($(window).height(), 10)});<\/p>\n<p>    \/\/initialize map<br \/>\n    var map = new Y.Map(&#8220;map&#8221;);<br \/>\n    map.addControl(new Y.ZoomControl());<br \/>\n    map.drawMap(new Y.LatLng(34.6812,135.2022), 14, Y.LayerSetId.NORMAL);<\/p>\n<p>    \/\/main<br \/>\n    if(navigator.geolocation){<br \/>\n        navigator.geolocation.getCurrentPosition(function(pos){<br \/>\n            var latlng = new Y.LatLng(pos.coords.latitude,pos.coords.longitude);<br \/>\n            searchNearestMcDonald(latlng);<br \/>\n        });<br \/>\n    }<\/p>\n<p>    \/\/search nearest McDonald<br \/>\n    var searchNearestMcDonald = function(latlng){<br \/>\n        $.ajax({<br \/>\n            url: &#8220;http:\/\/search.olp.yahooapis.jp\/OpenLocalPlatform\/V1\/localSearch&#8221;,<br \/>\n            dataType: &#8220;jsonp&#8221;,<br \/>\n            data:{<br \/>\n                appid: &#8220;dj0zaiZpPXEyMkYzTjZqU0hvVSZkPVlXazlaWFpsWlROdk16QW1jR285TUEtLSZzPWNvbnN1bWVyc2VjcmV0Jng9YTI-&#8220;,<br \/>\n                cid: &#8220;d115e2a62c8f28cb03a493dc407fa03f&#8221;,<br \/>\n                results: 1,<br \/>\n                lat: latlng.lat(),<br \/>\n                lon: latlng.lng(),<br \/>\n                sort: &#8220;dist&#8221;,<br \/>\n                output: &#8220;json&#8221;<br \/>\n            },<br \/>\n            success: function(result){<br \/>\n                updateRoute(latlng, result);<br \/>\n            }<br \/>\n        });<br \/>\n    }<\/p>\n<p>    \/\/update Route<br \/>\n    var plugin = null;<br \/>\n    var updateRoute = function(latlng, result){<br \/>\n        var coords = result.Feature[0].Geometry.Coordinates.split(&#8220;,&#8221;);<br \/>\n        if(plugin){<br \/>\n            map.removePlugin(plugin);<br \/>\n        }<br \/>\n        plugin = new Y.RouteSearchPlugin({latlngs:[<br \/>\n            latlng,<br \/>\n            new Y.LatLng(coords[1],coords[0])<br \/>\n        ]});<br \/>\n        map.addPlugin(plugin);<\/p>\n<p>        var name = result.Feature[0].Name;<br \/>\n        var address = result.Feature[0].Property.Address;<br \/>\n        var tel = result.Feature[0].Property.Tel1;<br \/>\n        var simplename = name.replace(&#8216;\u30de\u30af\u30c9\u30ca\u30eb\u30c9&#8217;,&#8221;);<br \/>\n        var distance = (plugin.estimateDistance() * 1000) + &#8216;m&#8217;;<br \/>\n        $(&#8216;#title&#8217;).html(simplename + &#8216;(&#8216; +  distance + &#8216;)&#8217;);<br \/>\n        $(&#8216;#desc&#8217;).html(address + &#8216;&lt;br \/&gt;&lt;a href=&#8221;tel:&#8217; + tel + &#8216;&#8221;&gt;&#8217; + tel + &#8216;&lt;\/a&gt;&#8217;);<br \/>\n    }<br \/>\n});<br \/>\n&lt;\/script&gt;<br \/>\n&lt;\/html&gt;<br \/>\n`<br \/>\n\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u306f<br \/>\n\u6700\u5bc4\u306e\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u306e\u5e97\u540d\u3084\u884c\u304d\u65b9\u3001\u8ddd\u96e2\u3092\u8868\u793a\u3059\u308b\u30bd\u30fc\u30b9\u3067\u3059\u3002<\/p>\n<p>\u3053\u3061\u3089\u3067\u51fa\u529b\u3055\u308c\u308b\u8ddd\u96e2\u3092WP\u5074\u306b\u6e21\u3057\u3001<br \/>\n\u51fa\u529b\u3057\u305f\u3044\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u81ea\u5206\u7684\u306b\u306f\u304b\u306a\u308a\u96e3\u3057\u3044\u554f\u984c\u304b\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001<br \/>\n\u5206\u304b\u308b\u30b3\u30fc\u30c9\u30de\u30b9\u30bf\u30fc\u306a\u65b9\u304c\u3044\u3089\u3063\u3057\u3083\u3044\u307e\u3057\u305f\u3089\u3001<br \/>\n\u3054\u6559\u793a\u9802\u3051\u308b\u3068\u5e78\u3044\u3067\u3059\u3002<br \/>\n\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"template":"","class_list":["post-157897","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/157897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/157897\/revisions"}],"wp:attachment":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=157897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}