MAPG-119 view and JS adaptations for new map creation

This commit is contained in:
Bence Pőcze 2020-06-10 23:15:02 +02:00
parent 6fc83c9459
commit 947ce6b183
2 changed files with 8 additions and 3 deletions

View File

@ -291,6 +291,11 @@
MapEditor.replacePlaceIdsToReal(this.response.added); MapEditor.replacePlaceIdsToReal(this.response.added);
if (mapId === 0) {
mapId = this.response.mapId;
window.history.replaceState(null, '', '/admin/mapEditor/' + mapId);
}
MapEditor.added = {}; MapEditor.added = {};
MapEditor.edited = {}; MapEditor.edited = {};
MapEditor.deleted = {}; MapEditor.deleted = {};
@ -370,7 +375,7 @@
ppi: highResData.ppi, ppi: highResData.ppi,
tileSize: highResData.tileSize, tileSize: highResData.tileSize,
zoomOffset: highResData.zoomOffset, zoomOffset: highResData.zoomOffset,
minZoom: 0, minZoom: 2,
maxZoom: 20 maxZoom: 20
}).addTo(MapEditor.map); }).addTo(MapEditor.map);

View File

@ -62,9 +62,9 @@
</div> </div>
<script> <script>
var tileUrl = '<?= $_ENV['LEAFLET_TILESERVER_URL'] ?>'; var tileUrl = '<?= $_ENV['LEAFLET_TILESERVER_URL'] ?>';
var mapId = '<?= $mapId ?>'; var mapId = <?= $mapId ?>;
var mapBounds = <?= json_encode($bounds) ?>; var mapBounds = <?= json_encode($bounds) ?>;
var places = <?= json_encode($places) ?>; var places = <?= json_encode($places, JSON_FORCE_OBJECT) ?>;
</script> </script>
<script src="/static/node_modules/leaflet/dist/leaflet.js"></script> <script src="/static/node_modules/leaflet/dist/leaflet.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=<?= $_ENV['GOOGLE_MAPS_JS_API_KEY'] ?>"></script> <script src="https://maps.googleapis.com/maps/api/js?key=<?= $_ENV['GOOGLE_MAPS_JS_API_KEY'] ?>"></script>