Commit 0000783a authored by ncastejon's avatar ncastejon
Browse files

Fix the routing for the copy map feature in table-map

parent 06e36a9b
......@@ -2189,9 +2189,9 @@
"integrity": "sha512-lXKMA/U43Fi1UnMkVYdNuEu0cGLo4JSWFUcnEyzNXkdpmDFic+d8H9oiaRoLbPiuGTC5SNoHMCP24T5544gnlQ=="
},
"bulma-tooltip": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/bulma-tooltip/-/bulma-tooltip-2.0.2.tgz",
"integrity": "sha512-xsqWeWV7tsUn3uH04SqJeP7/CyC1RaDVIyVzr4/sIO3friIIOi7L6jc5g7qUwDxuBQl72yH/yRPuefpXoQ4hWg=="
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/bulma-tooltip/-/bulma-tooltip-3.0.2.tgz",
"integrity": "sha512-CsT3APjhlZScskFg38n8HYL8oYNUHQtcu4sz6ERarxkUpBRbk9v0h/5KAvXeKapVSn2dp9l7bOGit5SECP8EWQ=="
},
"bytes": {
"version": "3.0.0",
......
......@@ -125,7 +125,8 @@ export class DatasetDetailComponent implements OnInit, OnDestroy {
if (this.hasTable || this.hasMap) {
this._router.navigate([
`/${AppRoutes.datasets.uri}/${this._datasetDetailService.dataset.slug}/${AppRoutes.data.uri}`,
]);
// tslint:disable-next-line: align
], { queryParamsHandling: 'preserve' });
} else {
this._router.navigate([
`/${AppRoutes.datasets.uri}/${this._datasetDetailService.dataset.slug}/${AppRoutes.info.uri}`,
......@@ -136,7 +137,9 @@ export class DatasetDetailComponent implements OnInit, OnDestroy {
this._router.navigate([
// tslint:disable-next-line: max-line-length
`/${AppRoutes.datasets.uri}/${this._datasetDetailService.dataset.slug}/${this._route.snapshot.firstChild.url[0]}`,
]);
],
// tslint:disable-next-line: align
{ queryParamsHandling: 'preserve' });
}
// Emit event to indicate to child component that the dataset has changed
......
......@@ -49,7 +49,8 @@
<div class="copy-map">
<input type="text" class="input" id="mapUrlCopy" [value]="mapUrl()" #mapUrlElement>
<button class="button is-medium" type="button" (click)="copyMaplink(mapUrlElement)">
<button class="button is-medium has-tooltip-left tooltip" type="button" (click)="copyMaplink(mapUrlElement)"
[attr.data-tooltip]="shareMessage">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20">
<path fill="#818080" fill-rule="evenodd"
d="M1.852 7.777a2.619 2.619 0 0 1 0-3.703l2.222-2.222a2.619 2.619 0 0 1 3.704 0l2.963 2.963a2.619 2.619 0 0 1 0 3.703l-.37.37.74.741.37-.37a2.619 2.619 0 0 1 3.704 0l2.963 2.963a2.619 2.619 0 0 1 0 3.704l-2.222 2.222a2.619 2.619 0 0 1-3.704 0L9.26 15.185a2.619 2.619 0 0 1 0-3.704l.37-.37-.74-.741-.37.37a2.619 2.619 0 0 1-3.704 0L1.852 7.777zm7.037-.37l-.74-.74a1.048 1.048 0 0 0-1.482 1.48l.74.742-.37.37a.524.524 0 0 1-.74 0L3.332 6.296a.524.524 0 0 1 0-.74l2.223-2.223a.524.524 0 0 1 .74 0L9.26 6.296a.524.524 0 0 1 0 .74l-.37.371zm2.222 5.185l-.37.37a.524.524 0 0 0 0 .742l2.963 2.962a.524.524 0 0 0 .74 0l2.223-2.222a.524.524 0 0 0 0-.74l-2.963-2.963a.524.524 0 0 0-.741 0l-.37.37.74.74a1.047 1.047 0 1 1-1.481 1.482l-.74-.74z"
......
......@@ -52,6 +52,7 @@ export class MapComponent implements OnInit, OnDestroy {
) { }
ngOnInit() {
this.shareMessage = geosource.mapMessages.share;
// Geolocation availability in the browser
if ('geolocation' in navigator) {
......@@ -158,9 +159,9 @@ export class MapComponent implements OnInit, OnDestroy {
};
// Check if in the url we have map options
const urlSplited = window.location.href.split('#');
const urlSplited = window.location.href.split('?map=');
const url = urlSplited[0];
const parameters = urlSplited.length > 1 ? urlSplited[1].split('/') : [];
const parameters = urlSplited.length > 1 ? decodeURIComponent(urlSplited[1]).split('/') : [];
// The order of parameters are:
// 0: zoom level
// 1: latitude
......
......@@ -470,7 +470,7 @@ export class MapService {
// Generate the url with map options
// http://hostName#zoom/latitude/longitude/bearing/pitch/selectedBaseLayerId
getPermalinkUrl() {
return `${this.url}#${this._map.getZoom()}/${this._map.getCenter().lat}/${this._map.getCenter().lng}` +
return `${this.url}?map=${this._map.getZoom()}/${this._map.getCenter().lat}/${this._map.getCenter().lng}` +
`/${this._map.getBearing()}/${this._map.getPitch()}/${this.selectedBaseLayer.id}`;
}
......
......@@ -4,7 +4,7 @@
@import '~scss/init_bulma.scss';
@import '../node_modules/bulma-slider/dist/css/bulma-slider.sass';
@import '../node_modules/bulma-checkradio/dist/css/bulma-checkradio.sass';
@import '../node_modules/bulma-tooltip/dist/css/bulma-tooltip.sass';
@import '../node_modules/bulma-tooltip/dist/css/bulma-tooltip.min.css';
@import '../node_modules/hamburgers/_sass/hamburgers/hamburgers.scss';
html {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment