Skip to content

TagSpaces is an offline, open source, document manager with tagging support

added ability to open gps coordinates in openstreetmap

Ilian Sapundshiev418078c7c003
diff --git a/app/components/Search.js b/app/components/Search.js
index d7445bd2a..4a42cef7f 100644
--- a/app/components/Search.js
+++ b/app/components/Search.js
@@ -65,6 +65,7 @@ import {
isPlusCode,
parseLatLon
} from '../utils/misc';
+import PlatformIO from '../services/platform-io';
type Props = {
classes: Object,
@@ -181,6 +182,13 @@ class Search extends React.Component<Props, State> {
});
};
+ openPlace = () => {
+ const { tagPlaceLat, tagPlaceLong } = this.state;
+ if (tagPlaceLat && tagPlaceLong) {
+ PlatformIO.openUrl('https://www.openstreetmap.org/#map=16/' + tagPlaceLat + '/' + tagPlaceLong);
+ }
+ };
+
startSearch = event => {
if (event.key === 'Enter' || event.keyCode === 13) {
this.executeSearch();
@@ -537,7 +545,7 @@ class Search extends React.Component<Props, State> {
InputProps={{
endAdornment: (
<InputAdornment position="end" title="GPS: 49.23276,12.43123 PlusCode: 8FRG8Q87+6X">
- <IconButton>
+ <IconButton onClick={this.openPlace}>
<PlaceIcon />
</IconButton>
</InputAdornment>