@@ -625,7 +625,12 @@ var App = (function ($, publ) {
625
625
} ) ;
626
626
coords = ol . proj . transform ( coords , 'EPSG:3857' , 'EPSG:4326' )
627
627
$ . 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
+ }
629
634
} ) ;
630
635
}
631
636
} ) ;
@@ -645,8 +650,15 @@ var App = (function ($, publ) {
645
650
coords = feature . getGeometry ( ) . getCoordinates ( ) ;
646
651
} ) ;
647
652
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
+ }
650
662
} ) ;
651
663
}
652
664
} ) ;
0 commit comments