Skip to content

Commit

Permalink
merge: absorb-geo into dev
Browse files Browse the repository at this point in the history
Fixes #359
  • Loading branch information
arildm committed Sep 12, 2024
2 parents 088d72b + 74deabd commit de2c8b4
Show file tree
Hide file tree
Showing 8 changed files with 638 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- `$rootScope`
- Auth module
- services (`backend`, `compare-searches`, `lexicons`, `searches`, `utils`)
- Map code from `korp-geo` has moved into this codebase [#359](https://github.com/spraakbanken/korp-frontend/issues/359)

### Changed

Expand Down
1 change: 0 additions & 1 deletion app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ require("rickshaw/rickshaw.css")

require("leaflet/dist/leaflet.css")
require("leaflet.markercluster/dist/MarkerCluster.css")
require("geokorp/dist/styles/geokorp.css")
require("components-jqueryui/themes/smoothness/jquery-ui.min.css")
require("./styles/_bootstrap-custom.scss")

Expand Down
19 changes: 9 additions & 10 deletions app/scripts/components/dynamic_tabs/map-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import angular from "angular"
import { html } from "@/util"
import "@/components/korp-error"
import "@/components/result-map"
import "@/directives/tab-spinner"

angular.module("korpApp").directive("mapTabs", () => ({
Expand Down Expand Up @@ -36,16 +37,14 @@ angular.module("korpApp").directive("mapTabs", () => ({
>
</div>
</div>
<sb-map
sb-center="center"
sb-markers="markerGroups"
sb-show-time="showTime"
sb-base-layer="mapSettings.baseLayer"
sb-marker-callback="newKWICSearch"
sb-selected-groups="selectedGroups"
sb-rest-color="restColor"
sb-use-clustering="useClustering"
></sb-map>
<result-map
center="center"
markers="markerGroups"
marker-callback="newKWICSearch"
selected-groups="selectedGroups"
rest-color="restColor"
use-clustering="useClustering"
></result-map>
</div>
</div>
</uib-tab>
Expand Down
465 changes: 465 additions & 0 deletions app/scripts/components/result-map.js

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions app/scripts/korp.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import angular from "angular"
import "angular-ui-bootstrap"
import "angular-spinner"
import "angular-ui-sortable"
import "geokorp/dist/scripts/geokorp"
import "geokorp/dist/scripts/geokorp-templates"
import "angular-dynamic-locale"
import "angular-filter"

Expand Down Expand Up @@ -36,7 +34,6 @@ const korpApp = angular.module("korpApp", [
"uib/template/popover/popover-template.html",
"angularSpinner",
"ui.sortable",
"sbMap",
"tmh.dynamicLocale",
"angular.filter",
])
Expand Down
134 changes: 134 additions & 0 deletions app/styles/map.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
result-map {
padding: 8px;

.leaflet-div-icon {
background: none;
border: none;
}

.cluster-geokorp-marker-group {
position: absolute;
bottom: 0;
width: 40px;
}

.cluster-geokorp-marker {
width: 10px;
border-radius: 1px;
display: inline-block;
}

.marker-top .geokorp-multi-marker {
vertical-align: top;
}

.marker-middle .geokorp-multi-marker {
vertical-align: middle;
}

.marker-bottom .geokorp-multi-marker {
vertical-align: bottom;
}

.geokorp-multi-marker {
opacity: 0.85;
display: inline-block;
}

.geokorp-marker {
opacity: 0.93;
}

.cluster-text {
font-weight: bold;
}

.cluster-icon {
border-radius: 15px;
width: 30px !important;
height: 30px !important;
z-index: 400;
position: absolute;
padding-top: 5px;
padding-left: 1px;
}

.leaflet-marker-icon.leaflet-div-icon.leaflet-clickable {
border: none;
background-color: transparent;
}

.leaflet-popup-content-wrapper {
border-radius: 4px;
background-color: #f6f6f6;
background-image: linear-gradient(to bottom, #fff, #e6e6e6);
background-repeat: repeat-x;
}

.leaflet-popup-tip {
background-color: #e6e6e6;
}

.leaflet-bar a:link,
.leaflet-bar a:visited {
color: black;
}

.swatch {
width: 10px;
height: 10px;
display: inline-block;
margin-right: 5px;
}

.marker-cluster-small {
background-color: rgba(136, 220, 168, 0.6);
}

.marker-cluster-small div {
background-color: rgba(136, 220, 168, 0.6);
}

.map {
border: 1px solid black;
position: relative;
height: 522px;
}

.map-container {
height: 520px;
}

.map-outer-container {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}

.hover-info-container {
margin: 5px;
border-radius: 5px;
width: 200px;
height: 500px;
overflow: auto;
position: absolute;
top: 0;
right: 0;
z-index: 800;
opacity: 1;
transition: opacity 500ms;
}

.hover-info {
z-index: 10;
background-color: #f6f6f6;
background-image: linear-gradient(to bottom, #fff, #e6e6e6);
background-repeat: repeat-x;
padding: 10px;
margin: 10px;
border-radius: 4px;
cursor: pointer;
}
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"@types/angular-dynamic-locale": "^0.1.35",
"@types/angular-ui-bootstrap": "^1.0.7",
"@types/jqueryui": "^1.12.23",
"@types/leaflet": "^1.9.12",
"@types/leaflet-providers": "^1.2.4",
"@types/leaflet.markercluster": "^1.5.4",
"angular": "1.8.3",
"angular-dynamic-locale": "0.1.38",
"angular-filter": "0.5.17",
Expand All @@ -16,7 +19,6 @@
"chart.js": "^4.4.3",
"comma-separated-values": "3.6.4",
"components-jqueryui": "1.12.1",
"geokorp": "spraakbanken/geokorp#1.5.0",
"jquery": "3.6.3",
"js-yaml": "^4.1.0",
"leaflet": "^1.9.3",
Expand Down
30 changes: 26 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@
"@types/qs" "*"
"@types/serve-static" "*"

"@types/geojson@*":
version "7946.0.14"
resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.14.tgz#319b63ad6df705ee2a65a73ef042c8271e696613"
integrity sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==

"@types/html-minifier-terser@^6.0.0":
version "6.1.0"
resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#4fc33a00c1d0c16987b1a20cf92d20614c55ac35"
Expand Down Expand Up @@ -303,6 +308,27 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3"
integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==

"@types/leaflet-providers@^1.2.4":
version "1.2.4"
resolved "https://registry.yarnpkg.com/@types/leaflet-providers/-/leaflet-providers-1.2.4.tgz#284e8a197d4c2dbfeda436842e03b2adb502be16"
integrity sha512-4wYEpreixp+G5t510s202eQ5eubOmxHevIfCNrzUZbzp50XQsC9lSetX7MnPl3ANRJnUBbCWOzZ9EQFiH0Jm+g==
dependencies:
"@types/leaflet" "*"

"@types/leaflet.markercluster@^1.5.4":
version "1.5.4"
resolved "https://registry.yarnpkg.com/@types/leaflet.markercluster/-/leaflet.markercluster-1.5.4.tgz#2ab43417cf3f6a42d0f1baf4e1c8f659cf1dc3a1"
integrity sha512-tfMP8J62+wfsVLDLGh5Zh1JZxijCaBmVsMAX78MkLPwvPitmZZtSin5aWOVRhZrCS+pEOZwNzexbfWXlY+7yjg==
dependencies:
"@types/leaflet" "*"

"@types/leaflet@*", "@types/leaflet@^1.9.12":
version "1.9.12"
resolved "https://registry.yarnpkg.com/@types/leaflet/-/leaflet-1.9.12.tgz#a6626a0b3fba36fd34723d6e95b22e8024781ad6"
integrity sha512-BK7XS+NyRI291HIo0HCfE18Lp8oA30H1gpi1tf0mF3TgiCEzanQjOqNZ4x126SXzzi2oNSZhZ5axJp1k0iM6jg==
dependencies:
"@types/geojson" "*"

"@types/lodash@^4.14.118":
version "4.14.191"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.191.tgz#09511e7f7cba275acd8b419ddac8da9a6a79e2fa"
Expand Down Expand Up @@ -1946,10 +1972,6 @@ function-bind@^1.1.1:
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==

geokorp@spraakbanken/geokorp#1.5.0:
version "1.5.0"
resolved "https://codeload.github.com/spraakbanken/geokorp/tar.gz/fa2e6b802d60723cbf5ebb10fb45f320c4b13893"

get-caller-file@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
Expand Down

0 comments on commit de2c8b4

Please sign in to comment.