From d737817528bc1de2e091bf000add2166cf9799ae Mon Sep 17 00:00:00 2001 From: j Date: Mon, 11 Aug 2025 17:19:18 +0200 Subject: [PATCH] fix place id generation in example --- examples/maps/map_editor/js/example.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/maps/map_editor/js/example.js b/examples/maps/map_editor/js/example.js index e9e9e10d..317c05b3 100644 --- a/examples/maps/map_editor/js/example.js +++ b/examples/maps/map_editor/js/example.js @@ -9,8 +9,8 @@ Ox.load(['UI', 'Geo'], function() { var places = $storage('places') || [] var $map = Ox.MapEditor({ addPlace: function(place, callback) { - console.log("addPlace", place) - place.id = Ox.encodeBase26(Ox.uid()) + place.id = Ox.encodeBase26((places.length ? Ox.max(places.map(p => Ox.decodeBase26(p.id))) : 0) + 1) + console.log("addPlace", place.id, place) places.push(place) $storage("places", places) $map.options({