Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mapiris
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Duchateau Fabien
mapiris
Commits
0041a673
Commit
0041a673
authored
6 years ago
by
Duchateau Fabien
Browse files
Options
Downloads
Patches
Plain Diff
minor modif parameters
parent
1679ebb0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mapiris/static/js/carto.js
+5
-3
5 additions, 3 deletions
mapiris/static/js/carto.js
mapiris/static/js/utils.js
+3
-3
3 additions, 3 deletions
mapiris/static/js/utils.js
with
8 additions
and
6 deletions
mapiris/static/js/carto.js
+
5
−
3
View file @
0041a673
...
@@ -79,17 +79,19 @@ function resetHighlightAll() {
...
@@ -79,17 +79,19 @@ function resetHighlightAll() {
* @param {geojson} geojson .
* @param {geojson} geojson .
* @param {event} events .
* @param {event} events .
* @param {object} style .
* @param {object} style .
* @param {string} typeMethod . (specify the method which caused this display, ex "searchBounds", "searchCode", "searchName")
* @param {function} callback .
* @param {function} callback .
*/
*/
function
addLayerFromGeoJSON
(
geojson
,
events
,
style
){
function
addLayerFromGeoJSON
(
geojson
,
events
,
style
,
typeMethod
){
if
(
irisLayer
!=
=
null
)
{
// if already displayed iris, remove them
if
(
irisLayer
!=
null
)
{
// if already displayed iris, remove them
removeLayer
(
irisLayer
);
removeLayer
(
irisLayer
);
}
}
if
(
geojson
!=
null
)
{
if
(
geojson
!=
null
)
{
irisLayer
=
new
L
.
geoJSON
(
geojson
,
{
onEachFeature
:
events
});
irisLayer
=
new
L
.
geoJSON
(
geojson
,
{
onEachFeature
:
events
});
irisLayer
.
setStyle
(
style
);
irisLayer
.
setStyle
(
style
);
irisLayer
.
addTo
(
map
);
irisLayer
.
addTo
(
map
);
map
.
fitBounds
(
irisLayer
.
getBounds
());
// zoom on the displayed iris
if
(
typeMethod
!=
"
searchBounds
"
)
// if searchBounds (zoom), fitBounds() will decrease the zoom, thus reloading searchBounds...
map
.
fitBounds
(
irisLayer
.
getBounds
());
// zoom on the displayed iris
}
}
// todo add markers ?
// todo add markers ?
return
irisLayer
;
return
irisLayer
;
...
...
This diff is collapsed.
Click to expand it.
mapiris/static/js/utils.js
+
3
−
3
View file @
0041a673
...
@@ -27,7 +27,7 @@ function getIrisFromCode(e) {
...
@@ -27,7 +27,7 @@ function getIrisFromCode(e) {
contentType
:
'
application/json;charset=UTF-8
'
,
contentType
:
'
application/json;charset=UTF-8
'
,
success
:
function
(
result
){
success
:
function
(
result
){
jsonResult
=
JSON
.
parse
(
result
);
jsonResult
=
JSON
.
parse
(
result
);
irisLayer
=
addLayerFromGeoJSON
(
jsonResult
[
'
geojson
'
],
eventsIRIS
,
styleDisplayedIris
);
irisLayer
=
addLayerFromGeoJSON
(
jsonResult
[
'
geojson
'
],
eventsIRIS
,
styleDisplayedIris
,
"
searchCode
"
);
refreshMessages
();
refreshMessages
();
},
},
error
:
function
(
result
,
textStatus
,
errorThrown
)
{
error
:
function
(
result
,
textStatus
,
errorThrown
)
{
...
@@ -52,7 +52,7 @@ function getIrisFromName(e) {
...
@@ -52,7 +52,7 @@ function getIrisFromName(e) {
contentType
:
'
application/json;charset=UTF-8
'
,
contentType
:
'
application/json;charset=UTF-8
'
,
success
:
function
(
result
){
success
:
function
(
result
){
jsonResult
=
JSON
.
parse
(
result
);
jsonResult
=
JSON
.
parse
(
result
);
irisLayer
=
addLayerFromGeoJSON
(
jsonResult
[
'
geojson
'
],
eventsIRIS
,
styleDisplayedIris
);
irisLayer
=
addLayerFromGeoJSON
(
jsonResult
[
'
geojson
'
],
eventsIRIS
,
styleDisplayedIris
,
"
searchName
"
);
refreshMessages
();
refreshMessages
();
},
},
error
:
function
(
result
,
textStatus
,
errorThrown
)
{
error
:
function
(
result
,
textStatus
,
errorThrown
)
{
...
@@ -81,7 +81,7 @@ function getIrisForBounds(areaBounds) {
...
@@ -81,7 +81,7 @@ function getIrisForBounds(areaBounds) {
contentType
:
'
application/json;charset=UTF-8
'
,
contentType
:
'
application/json;charset=UTF-8
'
,
success
:
function
(
result
){
success
:
function
(
result
){
jsonResult
=
JSON
.
parse
(
result
);
jsonResult
=
JSON
.
parse
(
result
);
irisLayer
=
addLayerFromGeoJSON
(
jsonResult
[
'
geojson
'
],
eventsIRIS
,
styleDisplayedIris
);
irisLayer
=
addLayerFromGeoJSON
(
jsonResult
[
'
geojson
'
],
eventsIRIS
,
styleDisplayedIris
,
"
searchBounds
"
);
refreshMessages
();
refreshMessages
();
},
},
error
:
function
(
result
,
textStatus
,
errorThrown
)
{
error
:
function
(
result
,
textStatus
,
errorThrown
)
{
...
...
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