Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adressensuche via Such-API geocodr realisiert
- Loading branch information
1 parent
05d6aa6
commit 3631ea1
Showing
21 changed files
with
53 additions
and
1,708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
class Place | ||
include ActiveModel::Model | ||
|
||
attr_accessor :label, :bbox | ||
attr_accessor :type, :properties, :geometry | ||
|
||
def as_json(options = {}) | ||
{ id: bbox, label: label } | ||
{ label: properties['objektgruppe'] == 'Gemeindeteil' ? properties['_title_'].split(', ')[-1] : properties['abkuerzung'].blank? ? properties['_title_'].split(', ')[-1] : properties['_title_'].split(', ')[-1] + ' (' + properties['abkuerzung'] + ')', bbox: geometry['type'] == 'Point' ? [geometry['coordinates'][0],geometry['coordinates'][1],geometry['coordinates'][0],geometry['coordinates'][1]] : [geometry['coordinates'][0][0][0],geometry['coordinates'][0][0][1],geometry['coordinates'][0][2][0],geometry['coordinates'][0][2][1]] } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.