Browse Source

Add icon changing on type changing in poi editor

poi-dev
Léo Serre 11 months ago
parent
commit
5034763a18
3 changed files with 13 additions and 1 deletions
  1. +1
    -0
      .gitignore
  2. +1
    -1
      views/d.poi.edit.html
  3. +11
    -0
      views/js/d.poi_map.js

+ 1
- 0
.gitignore View File

@ -1,6 +1,7 @@
/includes/config.php
/medias/*
/_maps
_ressources/dump.sql
*.sublime-project
*.sublime-workspace
*.log

+ 1
- 1
views/d.poi.edit.html View File

@ -14,7 +14,7 @@
<i id="slide-icon" class="fas fa-chevron-up"></i>
<form class="form" action="<?=$config['rel_root_folder']?>wiki/<?=$poi->permalink?>/edit" method="post">
<br>
<div class="flex_line">
<div class="flex_line" id="type_selector">
<? foreach($poi_types as $type) { ?>
<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>


+ 11
- 0
views/js/d.poi_map.js View File

@ -56,4 +56,15 @@ $( document ).ready(function() {
$("#lat").val(e.latlng.lat);
$("#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…
Cancel
Save