diff --git a/js/gpxedit.js b/js/gpxedit.js index d6a0083..773cc1a 100644 --- a/js/gpxedit.js +++ b/js/gpxedit.js @@ -363,13 +363,16 @@ function load_map() { // this is needed because popup content is created each time we open one // so, the content is lost when it's closed gpxedit.map.on('popupopen', function(e){ - var id = parseInt(e.popup.getContent().match(/layerid="(\d+)"/)[1]); + var id = e.popup._source.gpxedit_id; + //var id = parseInt(e.popup.getContent().match(/layerid="(\d+)"/)[1]); var buttonParent = $('button.popupOkButton[layerid='+id+']').parent(); buttonParent.find('input.layerName').val(gpxedit.layersData[id].name); buttonParent.find('textarea.layerDesc').val(gpxedit.layersData[id].description); buttonParent.find('textarea.layerCmt').val(gpxedit.layersData[id].comment); - buttonParent.find('select[role=symbol]').val(gpxedit.layersData[id].symbol); - buttonParent.find('select[role=symbol]').change(); + if (gpxedit.layersData[id].layer.type === 'marker'){ + buttonParent.find('select[role=symbol]').val(gpxedit.layersData[id].symbol); + buttonParent.find('select[role=symbol]').change(); + } }); } @@ -387,14 +390,17 @@ function onCreated(type, layer){ '