Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nos Hs2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Språksamlingane
stadnamn
Nos Hs2023
Commits
7e6806a4
Commit
7e6806a4
authored
6 years ago
by
Esko Ikkala
Browse files
Options
Downloads
Patches
Plain Diff
Fix creation place map popups
parent
17bfded4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/client/components/LeafletMap.js
+16
-3
16 additions, 3 deletions
src/client/components/LeafletMap.js
src/client/components/Manuscripts.js
+1
-0
1 addition, 0 deletions
src/client/components/Manuscripts.js
with
17 additions
and
3 deletions
src/client/components/LeafletMap.js
+
16
−
3
View file @
7e6806a4
...
@@ -109,7 +109,7 @@ class LeafletMap extends React.Component {
...
@@ -109,7 +109,7 @@ class LeafletMap extends React.Component {
}
}
componentDidUpdate
({
results
,
mapMode
})
{
componentDidUpdate
({
results
,
place
,
mapMode
})
{
// check if results data or mapMode have changed
// check if results data or mapMode have changed
if
(
this
.
props
.
results
!==
results
||
this
.
props
.
mapMode
!==
mapMode
)
{
if
(
this
.
props
.
results
!==
results
||
this
.
props
.
mapMode
!==
mapMode
)
{
...
@@ -119,8 +119,21 @@ class LeafletMap extends React.Component {
...
@@ -119,8 +119,21 @@ class LeafletMap extends React.Component {
this
.
updateMarkers
(
this
.
props
.
results
);
this
.
updateMarkers
(
this
.
props
.
results
);
}
}
}
}
if
(
this
.
props
.
place
!==
place
)
{
this
.
markers
[
this
.
props
.
place
.
id
.
replace
(
'
http://ldf.fi/mmm/place/
'
,
''
)]
.
bindPopup
(
this
.
createPopUpContent
(
this
.
props
.
place
),
{
maxHeight
:
300
,
maxWidth
:
400
,
minWidth
:
400
,
//closeButton: false,
})
.
openPopup
();
}
}
}
updateMarkers
(
results
)
{
updateMarkers
(
results
)
{
this
.
resultMarkerLayer
.
clearLayers
();
this
.
resultMarkerLayer
.
clearLayers
();
this
.
markers
=
{};
this
.
markers
=
{};
...
@@ -193,7 +206,6 @@ class LeafletMap extends React.Component {
...
@@ -193,7 +206,6 @@ class LeafletMap extends React.Component {
};
};
createPopUpContent
(
result
)
{
createPopUpContent
(
result
)
{
// console.log(result)
let
popUpTemplate
=
`<h3><a target="_blank" rel="noopener noreferrer" href=
${
result
.
sdbmLink
}
>
${
result
.
prefLabel
}
</a></p></h3>`
;
let
popUpTemplate
=
`<h3><a target="_blank" rel="noopener noreferrer" href=
${
result
.
sdbmLink
}
>
${
result
.
prefLabel
}
</a></p></h3>`
;
if
(
has
(
result
,
'
source
'
))
{
if
(
has
(
result
,
'
source
'
))
{
popUpTemplate
+=
`<p>Place authority: <a target="_blank" rel="noopener noreferrer" href=
${
result
.
source
}
>
${
result
.
source
}
</a></p>`
;
popUpTemplate
+=
`<p>Place authority: <a target="_blank" rel="noopener noreferrer" href=
${
result
.
source
}
>
${
result
.
source
}
</a></p>`
;
...
@@ -253,7 +265,8 @@ LeafletMap.propTypes = {
...
@@ -253,7 +265,8 @@ LeafletMap.propTypes = {
fetchPlaces
:
PropTypes
.
func
.
isRequired
,
fetchPlaces
:
PropTypes
.
func
.
isRequired
,
fetchPlace
:
PropTypes
.
func
.
isRequired
,
fetchPlace
:
PropTypes
.
func
.
isRequired
,
results
:
PropTypes
.
array
.
isRequired
,
results
:
PropTypes
.
array
.
isRequired
,
mapMode
:
PropTypes
.
string
.
isRequired
mapMode
:
PropTypes
.
string
.
isRequired
,
place
:
PropTypes
.
object
.
isRequired
,
};
};
export
default
LeafletMap
;
export
default
LeafletMap
;
This diff is collapsed.
Click to expand it.
src/client/components/Manuscripts.js
+
1
−
0
View file @
7e6806a4
...
@@ -34,6 +34,7 @@ let Manuscripts = props => {
...
@@ -34,6 +34,7 @@ let Manuscripts = props => {
fetchPlaces
=
{
props
.
fetchPlaces
}
fetchPlaces
=
{
props
.
fetchPlaces
}
fetchPlace
=
{
props
.
fetchPlace
}
fetchPlace
=
{
props
.
fetchPlace
}
results
=
{
props
.
search
.
places
}
results
=
{
props
.
search
.
places
}
place
=
{
props
.
search
.
place
}
mapMode
=
'
cluster
'
mapMode
=
'
cluster
'
/>
}
/>
}
/
>
/
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment