File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -634,6 +634,25 @@ var App = (function ($, publ) {
634
634
districtInput . val ( "" ) ;
635
635
}
636
636
} ) ;
637
+ } else {
638
+ // GEOCODE ADDRESS AND ADD ICON TO MAP
639
+ if ( $ ( "button.btn-geocode" ) . prev ( "input" ) . val ( ) != "" ) {
640
+ coords = $ ( "button.btn-geocode" ) . prev ( "input" ) . val ( )
641
+ $ . getJSON ( "https://***REMOVED***/geocode/json/" + coords , function ( data ) {
642
+ if ( data . result . coordinates ) {
643
+ var feature = new ol . Feature ( {
644
+ geometry : new ol . geom . Point (
645
+ ol . proj . fromLonLat ( Object . values ( data . result . coordinates ) , 'EPSG:3857' , 'EPSG:4326' )
646
+ )
647
+ } ) ;
648
+ vector . getSource ( ) . getFeatures ( ) . push ( feature )
649
+ publ . updateForm ( vector . getSource ( ) . getFeatures ( ) ) ;
650
+ publ . zoomToExtent ( ) ;
651
+ }
652
+ } )
653
+ } else {
654
+ alert ( "Address is empty!" )
655
+ }
637
656
}
638
657
} ) ;
639
658
You can’t perform that action at this time.
0 commit comments