1
0
Fork 0
forked from 0x2620/oxjs
oxjs/examples/maps/map_editor/js/example.js
2025-08-06 21:49:45 +02:00

37 lines
1,023 B
JavaScript

/*
In this example, we use Ox.MapEditor
*/
'use strict';
Ox.load(['UI', 'Geo'], function() {
var $map = Ox.MapEditor({
addPlace: function(place, callback) {
console.log("addPlace", place)
},
editPlace: function(place, callback) {
console.log("editPlace", place)
},
getMatches: function(names, callback) {
console.log("getMatches", names)
callback(23);
},
hasMatches: true, // FIXME: getMatches is enough
height: 800,
mode: 'add', // 'define',
names: null,
places: [],
removePlace: function(place, callback) {
console.log("removePlace", place)
},
selected: '',
showControls: false,
showLabels: false,
showTypes: true,
width: 600
})
.appendTo(Ox.$body);
Ox.$window.bind({resize: $map.resizeMap});
});