Skip to content

Instantly share code, notes, and snippets.

@st63jun
Last active December 25, 2015 11:49
Show Gist options
  • Save st63jun/6972354 to your computer and use it in GitHub Desktop.
Save st63jun/6972354 to your computer and use it in GitHub Desktop.
YOLP Local Search API
<!DOCTYPE html>
<html>
<head>
<title>Listing Spa</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://js.api.olp.yahooapis.jp/OpenLocalPlatform/V1/jsapi?appid=dj0zaiZpPU9Qc0t2NEFLTTBLMyZzPWNvbnN1bWVyc2VjcmV0Jng9MmM-"></script>
<script src="spot.js"></script>
</head>
<body>
<h3>Spot lists</h3>
<ul id="spot-lists">
</ul>
</body>
</html>
$(document).ready(function() {
var loc = new Y.LocalSearch();
loc.search("",
'132c700e0ebf5a1d386e9b725d7d1e6b', // Yahoo! ロコのカセットを使用
{
lat: '35.665662327484',
lon: '139.73091159273',
dist: 15,
sort: 'dist',
results: 50,
gc: '0418' // ジャンルコード (温泉、銭湯)
}, function(result) {
$.each(result.features, function(i, feature) {
$('#spot-lists').append("<li>" +
feature.name +
" [" +
feature.property.Genre[0].Name +
" | " +
feature.latlng.Lat + "," +
feature.latlng.Lon +
"]</li>");
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment