Add icon changing on type changing in poi editor
This commit is contained in:
parent
91c9517dac
commit
5034763a18
|
@ -1,6 +1,7 @@
|
||||||
/includes/config.php
|
/includes/config.php
|
||||||
/medias/*
|
/medias/*
|
||||||
/_maps
|
/_maps
|
||||||
|
_ressources/dump.sql
|
||||||
*.sublime-project
|
*.sublime-project
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
*.log
|
*.log
|
|
@ -14,7 +14,7 @@
|
||||||
<i id="slide-icon" class="fas fa-chevron-up"></i>
|
<i id="slide-icon" class="fas fa-chevron-up"></i>
|
||||||
<form class="form" action="<?=$config['rel_root_folder']?>wiki/<?=$poi->permalink?>/edit" method="post">
|
<form class="form" action="<?=$config['rel_root_folder']?>wiki/<?=$poi->permalink?>/edit" method="post">
|
||||||
<br>
|
<br>
|
||||||
<div class="flex_line">
|
<div class="flex_line" id="type_selector">
|
||||||
<? foreach($poi_types as $type) { ?>
|
<? foreach($poi_types as $type) { ?>
|
||||||
<input type="radio" name="poi_type" value="<?=$type[3]?>" id="<?=$type[3]?>">
|
<input type="radio" name="poi_type" value="<?=$type[3]?>" id="<?=$type[3]?>">
|
||||||
<label for="<?=$type[3]?>"><img src="<?=$config['views_url']?>img/<?=$type[3]?>.svg"><br><?=$type[0]?></label>
|
<label for="<?=$type[3]?>"><img src="<?=$config['views_url']?>img/<?=$type[3]?>.svg"><br><?=$type[0]?></label>
|
||||||
|
|
|
@ -56,4 +56,15 @@ $( document ).ready(function() {
|
||||||
$("#lat").val(e.latlng.lat);
|
$("#lat").val(e.latlng.lat);
|
||||||
$("#lon").val(e.latlng.lng);
|
$("#lon").val(e.latlng.lng);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
var poiicon = L.icon({
|
||||||
|
iconSize: [24, 24],
|
||||||
|
iconAnchor: [12, 12]
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#type_selector label").click(function(e) {
|
||||||
|
console.log(e);
|
||||||
|
poiicon.options.iconUrl = e.currentTarget.firstChild.currentSrc;
|
||||||
|
poi_layer.setIcon(poiicon);
|
||||||
|
})
|
||||||
});
|
});
|
Loading…
Reference in New Issue