forked from 0x2620/oxjs
use Ox.Log
This commit is contained in:
parent
92d25b6776
commit
dce2843303
50 changed files with 276 additions and 276 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue