forked from 0x2620/oxjs
improve listmap editing functionality
This commit is contained in:
parent
2996bc9e8b
commit
e80b7bd8e3
8 changed files with 105 additions and 33 deletions
|
|
@ -873,7 +873,7 @@ Ox.Map = function(options, self) {
|
|||
var metersPerPixel = getMetersPerPixel();
|
||||
Ox.forEach(self.scaleMeters, function(meters) {
|
||||
var scaleWidth = Math.round(meters / metersPerPixel);
|
||||
if (scaleWidth <= 256) {
|
||||
if (scaleWidth <= self.options.width / 2 - 4) {
|
||||
self.$scaleLabel
|
||||
.options({
|
||||
title: '\u2190 ' + (
|
||||
|
|
@ -881,7 +881,7 @@ Ox.Map = function(options, self) {
|
|||
) + 'm \u2192'
|
||||
})
|
||||
.css({
|
||||
width: (scaleWidth - 10) + 'px'
|
||||
width: (scaleWidth - 16) + 'px'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1030,6 +1030,10 @@ Ox.Map = function(options, self) {
|
|||
}
|
||||
};
|
||||
|
||||
that.addPlace = function() {
|
||||
addPlaceToMap(getSelectedPlace());
|
||||
};
|
||||
|
||||
that.getKey = function() {
|
||||
var key = null;
|
||||
if (self.shiftKey) {
|
||||
|
|
@ -1057,6 +1061,10 @@ Ox.Map = function(options, self) {
|
|||
});
|
||||
};
|
||||
|
||||
that.newPlace = function() {
|
||||
addPlaceToMap();
|
||||
};
|
||||
|
||||
that.panToPlace = function() {
|
||||
Ox.print('panToPlace:', self.options.selected)
|
||||
var place = getSelectedPlace();
|
||||
|
|
@ -1108,6 +1116,13 @@ Ox.Map = function(options, self) {
|
|||
return that;
|
||||
}
|
||||
|
||||
that.value = function(id, key, value) {
|
||||
// fixme: should be like the corresponding List/TextList/etc value function
|
||||
Ox.print('Map.value', id, key, value)
|
||||
getPlaceById(id)[key] = value;
|
||||
Ox.print('...', getPlaceById(id))
|
||||
}
|
||||
|
||||
that.zoomToPlace = function() {
|
||||
Ox.print('zoomToPlace')
|
||||
var place = getSelectedPlace();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue