1
0
Fork 0
forked from 0x2620/oxjs

use Ox.Log

This commit is contained in:
j 2011-11-04 16:54:28 +01:00
commit dce2843303
50 changed files with 276 additions and 276 deletions

View file

@ -326,7 +326,7 @@ Ox.ListMap = function(options, self) {
self.$areaKmInput.options({value: Ox.formatArea(data.area)});
},
changeplaceend: function(data) {
//Ox.print('ssP', self.selectedPlace);
//Ox.Log('Map', 'ssP', self.selectedPlace);
var isResult = self.selectedPlace[0] == '_';
!isResult && editPlace([
'lat', 'lng', 'south', 'west', 'north', 'east', 'area'
@ -766,7 +766,7 @@ Ox.ListMap = function(options, self) {
function removePlace() {
var index;
Ox.print('REMOVE PLACE', self.selectedPlace, index)
Ox.Log('Map', 'REMOVE PLACE', self.selectedPlace, index)
if (!self.isAsync) {
// fixme: doesn't call self.options.removePlace!
index = Ox.getPositionById(self.options.places, self.selectedPlace);
@ -893,7 +893,7 @@ Ox.ListMap = function(options, self) {
resizeMap <f> resizeMap
@*/
that.resizeMap = function() {
Ox.print('Ox.ListMap.resizeMap()')
Ox.Log('Map', 'Ox.ListMap.resizeMap()')
self.$map.resizeMap();
return that;
};

View file

@ -457,7 +457,7 @@ Ox.Map = function(options, self) {
function addPlaceToMap(place) {
// via find, click, shift-click, or new place button
Ox.print('addPlaceToMap', place)
Ox.Log('Map', 'addPlaceToMap', place)
var exists = false;
if (!place) {
var bounds = self.map.getBounds(),
@ -504,12 +504,12 @@ Ox.Map = function(options, self) {
Ox.extend(place, data);
self.options.selected = place.id;
place.countryCode = country ? country.code : '';
Ox.print('addP2P', data, place);
Ox.Log('Map', 'addP2P', data, place);
place.marker.update();
self.places.push(place);
self.resultPlace = null;
that.triggerEvent('addplace', place)
//Ox.print('SSSS', self.options.selected)
//Ox.Log('Map', 'SSSS', self.options.selected)
}
function boundsChanged() {
@ -528,7 +528,7 @@ Ox.Map = function(options, self) {
function centerChanged() {
var tooltip = $('.OxMapMarkerTooltip');
if (tooltip.length) {
Ox.print('??', tooltip[0].className, $(tooltip[0]).data('oxid'));
Ox.Log('Map', '??', tooltip[0].className, $(tooltip[0]).data('oxid'));
Ox.UI.elements[$(tooltip[0]).data('oxid')].hide();
}
self.center = self.map.getCenter();
@ -568,7 +568,7 @@ Ox.Map = function(options, self) {
}
function constructZoomInput() {
//Ox.print('constructZoomInput', self.minZoom, self.maxZoom)
//Ox.Log('Map', 'constructZoomInput', self.minZoom, self.maxZoom)
if (self.options.zoombar) {
self.$zoomInput && self.$zoomInput.removeElement();
self.$zoomInput = Ox.Range({
@ -677,19 +677,19 @@ Ox.Map = function(options, self) {
if (!place && self.resultPlace && self.resultPlace.id == id) {
place = self.resultPlace;
}
//Ox.print('getPlaceById', id, place)
//Ox.Log('Map', 'getPlaceById', id, place)
return place;
}
function getPlaceByLatLng(latlng, bounds, callback) {
// gets the largest place at latlng that would fit in bounds
//Ox.print('ll b', latlng, bounds)
//Ox.Log('Map', 'll b', latlng, bounds)
var callback = arguments.length == 3 ? callback : bounds,
bounds = arguments.length == 3 ? bounds : null;
self.geocoder.geocode({
latLng: latlng
}, function(results, status) {
//Ox.print('results', results)
//Ox.Log('Map', 'results', results)
var length = results.length;
if (status == google.maps.GeocoderStatus.OK) {
if (bounds) {
@ -715,7 +715,7 @@ Ox.Map = function(options, self) {
results: results
});
} else {
Ox.print('geocode failed:', status);
Ox.Log('Map', 'geocode failed:', status);
callback(null);
}
});
@ -737,7 +737,7 @@ Ox.Map = function(options, self) {
results: results
});
} else {
Ox.print('geocode failed:', status);
Ox.Log('Map', 'geocode failed:', status);
callback(null);
}
});
@ -780,7 +780,7 @@ Ox.Map = function(options, self) {
getMapBounds(function(mapBounds) {
Ox.print('init', mapBounds.getSouthWest(), mapBounds.getNorthEast(), mapBounds.getCenter())
Ox.Log('Map', 'init', mapBounds.getSouthWest(), mapBounds.getNorthEast(), mapBounds.getCenter())
self.elevationService = new google.maps.ElevationService();
self.geocoder = new google.maps.Geocoder();
@ -871,7 +871,7 @@ Ox.Map = function(options, self) {
function mapChanged() {
// gets called after panning or zooming
Ox.print('mapChanged');
Ox.Log('Map', 'mapChanged');
if (self.boundsChanged) {
var bounds = self.map.getBounds(),
southWest = bounds.getSouthWest(),
@ -915,7 +915,7 @@ Ox.Map = function(options, self) {
range: [0, self.options.maxMarkers],
sort: [{key: 'area', operator: '-'}]
}, function(result) {
Ox.print('RESULT', result)
Ox.Log('Map', 'RESULT', result)
var ids = [];
result.data.items.forEach(function(item, i) {
var place = getPlaceById(item.id);
@ -1017,7 +1017,7 @@ Ox.Map = function(options, self) {
}).join(', ');
}
function getType(types) {
Ox.print('getType', types)
Ox.Log('Map', 'getType', types)
// see http://code.google.com/apis/maps/documentation/javascript/services.html#GeocodingAddressTypes
var strings = {
'country': ['country'],
@ -1087,7 +1087,7 @@ Ox.Map = function(options, self) {
var place = getSelectedPlace();
place.id = '_' + place.id;
self.options.selected = place.id;
//Ox.print('removePlace', Ox.getObjectById(self.places, place.id))
//Ox.Log('Map', 'removePlace', Ox.getObjectById(self.places, place.id))
self.places.splice(Ox.getPositionById(self.places, place.id), 1);
self.resultPlace && self.resultPlace.remove();
self.resultPlace = place;
@ -1095,7 +1095,7 @@ Ox.Map = function(options, self) {
}
function reset() {
//Ox.print(self.map.getZoom(), self.zoom);
//Ox.Log('Map', self.map.getZoom(), self.zoom);
self.map.getZoom() == self.zoom ?
self.map.panTo(self.center) :
self.map.fitBounds(self.bounds);
@ -1103,7 +1103,7 @@ Ox.Map = function(options, self) {
function resizeMap() {
/*
Ox.print('resizeMap', self.options.width, self.options.height);
Ox.Log('Map', 'resizeMap', self.options.width, self.options.height);
var center = self.map.getCenter();
self.mapHeight = getMapHeight();
self.minZoom = getMinZoom();
@ -1124,7 +1124,7 @@ Ox.Map = function(options, self) {
// id can be null (deselect)
var place,
selected = getSelectedMarker();
Ox.print('Ox.Map selectPlace()', id, selected);
Ox.Log('Map', 'Ox.Map selectPlace()', id, selected);
if (id != selected) {
place = getPlaceById(selected);
place && place.deselect();
@ -1210,7 +1210,7 @@ Ox.Map = function(options, self) {
}
function setStatus() {
//Ox.print('setStatus()', self.options.selected)
//Ox.Log('Map', 'setStatus()', self.options.selected)
var code, country, disabled, place, title;
if (self.options.statusbar) {
place = getSelectedPlace();
@ -1238,7 +1238,7 @@ Ox.Map = function(options, self) {
title: title
});
}
//Ox.print('STATUS DONE');
//Ox.Log('Map', 'STATUS DONE');
}
function spansGlobe() {
@ -1319,7 +1319,7 @@ Ox.Map = function(options, self) {
}
function undo() {
Ox.print('Map undo')
Ox.Log('Map', 'Map undo')
var place = getSelectedPlace();
place.editing && place.undo();
}
@ -1440,7 +1440,7 @@ Ox.Map = function(options, self) {
that.resizeMap = function() {
/*
Ox.print('resizeMap', self.options.width, self.options.height);
Ox.Log('Map', 'resizeMap', self.options.width, self.options.height);
var center = self.map.getCenter();
self.mapHeight = getMapHeight();
self.minZoom = getMinZoom();
@ -1457,11 +1457,11 @@ Ox.Map = function(options, self) {
*/
/*
Ox.print('Ox.Map.resizeMap()');
Ox.Log('Map', 'Ox.Map.resizeMap()');
var center = self.map.getCenter();
self.options.height = that.$element.height();
self.options.width = that.$element.width();
Ox.print(self.options.width, self.options.height)
Ox.Log('Map', self.options.width, self.options.height)
self.$map.css({
height: self.mapHeight + 'px',
width: self.options.width + 'px'
@ -1494,7 +1494,7 @@ Ox.Map = function(options, self) {
that.value = function(id, key, value) {
// fixme: should be like the corresponding List/TextList/etc value function
Ox.print('Map.value', id, key, value)
Ox.Log('Map', 'Map.value', id, key, value)
getPlaceById(id).options(key, value);
}

View file

@ -119,7 +119,7 @@ Ox.MapMarker = function(options) {
} else if (that.place.east > 180) {
that.place.east -= 360;
}
Ox.print('west', that.place.west, 'east', that.place.east, 'span', span);
Ox.Log('Map', 'west', that.place.west, 'east', that.place.east, 'span', span);
that.place.update();
that.marker.setOptions({
position: that.place.center
@ -201,7 +201,7 @@ Ox.MapMarker = function(options) {
// workaround to prevent marker from appearing twice
// after setting draggable from true to false (google maps bug)
var fix = that.marker.getDraggable() && !that.place.editing;
//Ox.print('setOptions, that.map: ', that.map)
//Ox.Log('Map', 'setOptions, that.map: ', that.map)
if (that.map.options('showTypes')) {
that.color = typeColor[that.place.type];
that.size = 8;

View file

@ -53,7 +53,7 @@ Ox.MapMarkerImage = (function() {
new google.maps.Point(0, 0),
new google.maps.Point(r, r)
);
//Ox.print(options, 'index', index)
//Ox.Log('Map', options, 'index', index)
}
return cache[index];

View file

@ -155,7 +155,7 @@ Ox.MapPlace = function(options) {
options = Ox.makeObject(arguments);
Ox.forEach(options, function(value, key) {
that[key] = value;
Ox.print('that.' + key, '=', value, '......')
Ox.Log('Map', 'that.' + key, '=', value, '......')
});
update(true);
};

View file

@ -80,7 +80,7 @@ Ox.MapRectangle = function(options, self) {
@*/
that.deselect = function() {
setOptions();
Ox.print('MARKERS', that.markers)
Ox.Log('Map', 'MARKERS', that.markers)
Ox.forEach(that.markers, function(marker) {
marker.remove();
});
@ -109,7 +109,7 @@ Ox.MapRectangle = function(options, self) {
update <f> udpate
@*/
that.update = function() {
Ox.print('UPDATE...')
Ox.Log('Map', 'UPDATE...')
that.rectangle.setOptions({
bounds: that.place.bounds
});

View file

@ -47,7 +47,7 @@ Ox.MapRectangleMarker = function(options, self) {
function drag(e) {
// fixme: implement shift+drag (center stays the same)
Ox.print(e.pixel.x, e.pixel.y)
Ox.Log('Map', e.pixel.x, e.pixel.y)
var lat = Ox.limit(e.latLng.lat(), Ox.MIN_LATITUDE, Ox.MAX_LATITUDE),
lng = e.latLng.lng();
that.drag = {
@ -66,8 +66,8 @@ Ox.MapRectangleMarker = function(options, self) {
if (that.position.indexOf('e') > -1) {
that.place.east = lng;
}
//Ox.print('west', that.place.west, 'east', that.place.east);
//Ox.print('south', that.place.south, 'north', that.place.north);
//Ox.Log('Map', 'west', that.place.west, 'east', that.place.east);
//Ox.Log('Map', 'south', that.place.south, 'north', that.place.north);
that.place.update();
that.place.marker.update();
that.place.rectangle.update();