Skip to content
Open
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
27 changes: 22 additions & 5 deletions src/app/catalunya-gmap-monument.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class MonumentBuilder {
// Override in the case that we have Barcelona, Barcelona, Barcelona to only Barcelona
if ((municipi && poblacio && provincia) && (municipi === poblacio) && (poblacio === provincia)) {
address = municipi;
}else{
} else {
address += provincia
}
}
Expand Down Expand Up @@ -271,17 +271,34 @@ class MonumentBuilder {
icon: this._getIcon(type, category, this.styleType1),
icon2: this._getIcon(type, category, this.styleType2),
category: category, // (building type Slug-Name)
categoryName: categoryName
categoryName: categoryName,
comarca: edifici.comarca
};
}

_addEdifici(id, arrayName, category, categoryName, type) {
if (arrayName.length > 0) {
_addEdifici(id, arrayName, category, categoryName, type, comarca) {
let add_building = true;


// Check type building
if (typeof gmap_type_filter !== 'undefined' && gmap_type_filter.length > 0 && !(gmap_type_filter.includes(category))) {
add_building = false;
}

if (arrayName.length > 0 && add_building) {

//Add Marker to the Map
arrayName.forEach((building, index) => {
let allowed_comarca = true;
const opt = this._extract(building, category, categoryName, index, type);
this.mapManager.addMarker(opt);

// check Comarca
if (typeof gmap_comarca_filter !== 'undefined' && gmap_comarca_filter.length > 0 && !(gmap_comarca_filter.includes(opt.comarca))) {
allowed_comarca = false;
}
if (allowed_comarca) {
this.mapManager.addMarker(opt);
}
})

//Add Icon related to the map to the map menu
Expand Down
7 changes: 6 additions & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@

<link href="https://fonts.googleapis.com/css?family=Droid+Serif" rel="stylesheet">
<link href="css/catalunya-gmap.css" rel="stylesheet" type="text/css">

<script type="application/javascript">
var gmap_type_filter = []
var gmap_comarca_filter = []
</script>
</head>

<body>
Expand Down Expand Up @@ -47,7 +52,7 @@ <h2>No hi ha cap edificaci&oacute; disponible per aquesta comcarca</h2></div>
<footer>
<script src="js/jquery-3.2.1.min.js" type="text/javascript"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/catalunya-gmap-path.js" type="text/javascript"></script>
<script src="js/catalunya-gmap-path.json" type="text/javascript"></script>
<script src="js/catalunya-gmap.min.js" type="text/javascript"></script>
</footer>

Expand Down
1 change: 0 additions & 1 deletion web/js/catalunya-gmap-path.js

This file was deleted.

1 change: 1 addition & 0 deletions web/js/catalunya-gmap-path.json

Large diffs are not rendered by default.