Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
iberculturaviva
iberculturaviva-mapas
Commits
8121a64f
Commit
8121a64f
authored
5 years ago
by
Bruno Martin
Browse files
Options
Download
Email Patches
Plain Diff
customize map tile using wikipedia osm tile to set language part 2
parent
a3ce2f4e
master
develop
v1.12.3
v1.12.2
v1.12.1
v1.12.0
v1.11.0
v1.10.0
v1.9.17
v1.9.16
v1.9.15
v1.9.14
v1.9.13
v1.9.12
v1.9.11
v1.9.10
v1.9.9
v1.9.8
v1.9.7
v1.9.6
v1.9.5
v1.9.4
v1.9.3
v1.9.2
v1.9.1
v1.9.0
v1.8.0
v1.7.10
v1.7.9
v1.7.8
v1.7.7
v1.7.6
v1.7.5
v1.7.4
v1.7.3
v1.7.2
v1.7.1
v1.7.0
v1.6.0
v1.5.2
v1.5.1
v1.5.0
v1.4.11
v1.4.10
v1.4.9
v1.4.8
v1.4.7
v1.4.6
v1.4.5
v1.4.4
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.3.7
v1.3.6
v1.3.5
v1.3.4
No related merge requests found
Pipeline
#7619
passed with stages
in 37 seconds
Changes
2
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1562 additions
and
0 deletions
+1562
-0
themes/IberCulturaViva/assets/js/mapasculturais.js
themes/IberCulturaViva/assets/js/mapasculturais.js
+1438
-0
themes/IberCulturaViva/assets/js/single-subsite.js
themes/IberCulturaViva/assets/js/single-subsite.js
+124
-0
No files found.
themes/IberCulturaViva/assets/js/mapasculturais.js
0 → 100644
View file @
8121a64f
This diff is collapsed.
Click to expand it.
themes/IberCulturaViva/assets/js/single-subsite.js
0 → 100644
View file @
8121a64f
$
(
function
(){
var
$mapContainer
=
$
(
'
#subsite-map
'
);
var
mapsDefaults
=
MapasCulturais
.
mapsDefaults
;
var
obj
=
MapasCulturais
.
entity
.
object
;
var
config
=
{
zoomControl
:
false
,
zoomMax
:
obj
.
zoom_max
||
mapsDefaults
.
zoomMax
,
zoomMin
:
obj
.
zoom_min
||
mapsDefaults
.
zoomMin
,
zoom
:
obj
.
zoom_default
||
mapsDefaults
.
zoomDefault
,
center
:
new
L
.
LatLng
(
obj
.
latitude
||
mapsDefaults
.
latitude
,
obj
.
longitude
||
mapsDefaults
.
longitude
)
};
var
openStreetMap
=
L
.
tileLayer
(
'
https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png?lang=gn
'
,
{
attribution
:
'
Dados e Imagens © <a href="http://www.openstreetmap.org/copyright">Contrib. OpenStreetMap</a>,
'
,
maxZoom
:
config
.
zoomMax
,
minZoom
:
config
.
zoomMin
});
var
map
=
new
L
.
Map
(
'
subsite-map
'
,
config
).
addLayer
(
openStreetMap
);
(
new
L
.
Control
.
Zoom
({
position
:
'
bottomright
'
})).
addTo
(
map
);
var
setState
=
function
(
event
){
var
center
=
map
.
getCenter
();
var
zoom
=
event
.
target
.
_zoom
;
$
(
'
#latitude
'
).
editable
(
'
setValue
'
,
center
.
lat
);
$
(
'
#longitude
'
).
editable
(
'
setValue
'
,
center
.
lng
);
$
(
'
#zoom_default
'
).
editable
(
'
setValue
'
,
zoom
);
};
// $('#latitude, #longitude, #zoom_default').editable('disabled')
map
.
on
(
'
zoomend
'
,
setState
);
map
.
on
(
'
moveend
'
,
setState
);
$
(
'
#tab-mapa
'
).
on
(
'
click
'
,
function
(){
setTimeout
(
function
(){
map
.
invalidateSize
();
},
50
)
})
$
(
'
.js-editable.js-color
'
).
on
(
'
save
'
,
function
(
e
,
editable
){
var
$this
=
$
(
this
);
$this
.
css
(
'
background-color
'
,
editable
.
newValue
);
}).
each
(
function
(){
var
color
=
$
(
this
).
text
();
if
(
color
){
$
(
this
).
css
(
'
background-color
'
,
color
);
}
});
var
interval
=
setInterval
(
function
(){
$
(
'
.js-editable.js-color
'
).
removeClass
(
'
editable-unsaved editable-bg-transition
'
);
},
10
);
$
(
'
.js-editable--subsite-text
'
).
on
(
'
shown
'
,
function
(
e
,
editable
){
var
$this
=
$
(
this
);
var
prop
=
$this
.
data
(
'
edit
'
);
var
examples
=
$this
.
data
(
'
examples
'
);
var
val
=
$this
.
editable
(
'
getValue
'
)[
prop
];
var
parents
=
editable
.
input
.
$input
.
parents
();
var
labels
=
MapasCulturais
.
gettext
.
entityApp
;
setTimeout
(
function
(){
var
$container
=
$
(
parents
[
parents
.
length
-
1
]);
$container
.
width
(
$container
.
width
());
if
(
examples
&&
editable
.
input
.
$input
.
parent
().
find
(
'
.examples
'
)){
examples
=
'
"
'
+
examples
.
join
(
'
", "
'
)
+
'
"
'
;
editable
.
input
.
$input
.
after
(
'
<div class="examples hltip"><strong>
'
+
labels
[
'
examples
'
]
+
'
</strong>
'
+
examples
+
'
</div>
'
);
}
},
5
);
if
(
val
===
''
){
editable
.
input
.
$input
.
val
(
$this
.
data
(
'
placeholder
'
));
}
}).
on
(
'
save
'
,
function
(
e
,
params
)
{
var
$this
=
$
(
this
);
if
(
params
.
newValue
===
$this
.
data
(
'
placeholder
'
)){
$
(
this
).
removeClass
(
'
editable-unsaved
'
);
params
.
newValue
=
''
;
params
.
submitValue
=
''
;
}
return
;
});
$
(
'
.show-all input
'
).
on
(
'
change
'
,
function
(){
if
(
this
.
checked
){
$
(
this
).
parents
(
'
section.filter-section
'
).
find
(
'
p.js-text-config.hidden
'
).
removeClass
(
'
hidden
'
);
}
else
{
$
(
this
).
parents
(
'
section.filter-section
'
).
find
(
'
p.js-text-config.js-optional
'
).
addClass
(
'
hidden
'
);
}
});
function
searchByKeyword
(){
var
keyword
=
$
(
'
.js-subsite-map-search--input
'
).
val
();
MapasCulturais
.
geocoder
.
geocode
({
fullAddress
:
keyword
},
function
(
r
){
map
.
setView
(
r
);
});
}
$
(
'
.js-subsite-map-search--button
'
).
on
(
'
click
'
,
function
(
e
){
searchByKeyword
();
});
$
(
'
.js-subsite-map-search--input
'
).
on
(
'
keypress
'
,
function
(
e
){
if
(
e
.
keyCode
===
13
){
searchByKeyword
();
}
});
});
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment