Skip to content

Commit 4708aee

Browse files
committed
Updates place search (hard-coded for Chiba)
1 parent 115a4c9 commit 4708aee

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

assets/javascripts/app.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,12 @@ var App = (function ($, publ) {
625625
});
626626
coords = ol.proj.transform(coords,'EPSG:3857','EPSG:4326')
627627
$.getJSON("https://***REMOVED***/reversegeocode/json/" + coords.join(",") + ",1000", function(data) {
628-
$("#issue-form #attributes label:contains('現地住所')").parent("p").children("input").val(data.result.address);
628+
if (data.result.address) {
629+
$("#issue-form #attributes label:contains('現地住所')").parent("p").children("input").val(data.result.address);
630+
}
631+
else {
632+
$("#issue-form #attributes label:contains('現地住所')").parent("p").children("input").val("---");
633+
}
629634
});
630635
}
631636
});
@@ -645,8 +650,15 @@ var App = (function ($, publ) {
645650
coords = feature.getGeometry().getCoordinates();
646651
});
647652
coords = ol.proj.transform(coords,'EPSG:3857','EPSG:4326')
648-
$.getJSON("https://***REMOVED***/reversegeocode/json/" + coords.join(",") + ",1000", function(data) {
649-
$("#issue-form #attributes label:contains('公園検索')").parent("p").children("input").val(data.result.address);
653+
$.getJSON("http://***REMOVED***/geocoder/service/reversegeocode/json/" + coords.join(",") + ",500?useaddr=true&owner=***REMOVED***&details=true", function(data) {
654+
if (data.result.address && data.result.details.id ) {
655+
$("#issue-form #attributes label:contains('公園検索')").parent("p").children("input").val(
656+
"[" + data.result.details.id + "] " + data.result.address
657+
);
658+
}
659+
else {
660+
$("#issue-form #attributes label:contains('公園検索')").parent("p").children("input").val("---");
661+
}
650662
});
651663
}
652664
});

0 commit comments

Comments
 (0)