Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noter frontend integration with map #43

Merged
merged 2 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mbgl-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<script src='./kartta-slider.js'></script>
<link href='./kartta-slider.css' rel='stylesheet' />
<script src='./mbgl-photomap.js'></script>
<script src='./mbgl-timefilter.js'></script>
<script src="./mbgl-map.js"></script>
<link rel="stylesheet" type="text/css" href="./mbgl-map.css" />
Expand Down
48 changes: 46 additions & 2 deletions mbgl-map.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,24 @@ canvas.mapboxgl-canvas.crosshair-cursor {
cursor: crosshair !important;
}

.button-photo {
border: 1px solid #aaa;
padding: 5px;
font-weight: bold;
font-size: 14px;
border-radius: 5px;
background-color: white;
}

.button-photo-active {
background-color: grey;
}

.button-photo:hover {
background-color: #eeeeee;
cursor: pointer;
}


#map-wrapper {
position: absolute;
Expand Down Expand Up @@ -159,14 +177,20 @@ canvas.mapboxgl-canvas.crosshair-cursor {

#sidebar {
position: absolute;
width: 350px;
width: 370px;
top: 0;
left: 0;
background-color: white;
background-color: #eeeeee;
padding: 0;
margin: 0;
}

#map-wrapper.sidebar-open #sidebar {
position: relative;
height: 100%;
overflow-y: auto;
}

#search-box {
padding-top: 8px;
background-color: #eeeeee;
Expand Down Expand Up @@ -236,6 +260,21 @@ canvas.mapboxgl-canvas.crosshair-cursor {
margin-left: 10px;
}

#search-results .photodiv {
margin-bottom: 1em;
}

#search-results .helpdiv {
margin-bottom: 100px;
}
#search-results .helpdiv p {
padding-top: 10px;
}

#search-results img {
border-radius: 10px;
}

#kartta-attribution {
z-index: 100001;
position: absolute;
Expand All @@ -246,3 +285,8 @@ canvas.mapboxgl-canvas.crosshair-cursor {
margin-right: 5px;
margin-bottom: 5px;
}

#search-results-results ul.unstyled {
list-style: none;
padding-inline-start: 0px ;
}
12 changes: 12 additions & 0 deletions mbgl-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ document.addEventListener("DOMContentLoaded", function(){
}
}));

map.addControl(new PhotoMapControl({
layer: "buildings",
outlineLayer: "buildings_outline",
editorUrl: "https://re.city/e",
noterUrl: "https://re.city/nf",
noterApiUrl: "https://re.city/nb"
}));


const layersToFilter = [
"water",
"buildings",
Expand Down Expand Up @@ -195,9 +204,11 @@ document.addEventListener("DOMContentLoaded", function(){
searchResultsList = document.getElementById("search-results-list");
searchResultsCloseButton = document.getElementById("search-results-close-button");
searchResultsLoading = document.getElementById("search-results-loading");
sideBarContainer = document.getElementById("map-wrapper");

function hideSearchResults() {
searchResults.classList.add('kartta-hidden');
sideBarContainer.classList.remove("sidebar-open");
}

searchResultsCloseButton.addEventListener("click", hideSearchResults);
Expand Down Expand Up @@ -244,6 +255,7 @@ document.addEventListener("DOMContentLoaded", function(){
+ '&accept-language=en-US,en';
searchResults.classList.remove('kartta-hidden');
searchResultsLoading.classList.remove("kartta-hidden");
sideBarContainer.classList.add("sidebar-open")
while (searchResultsList.firstChild) {
searchResultsList.removeChild(searchResultsList.firstChild);
}
Expand Down
Loading