Merge pull request #14590 from CartoDB/use-tomtom-v3

Use TomTom geocoder in carto.js v3
pull/14605/head
Elena Torró 6 years ago committed by GitHub
commit b5e6dd5fed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,7 +10,7 @@ sudo make install
=======
### Features
* You can configure your API key for the search bar, powered by TomTom, with `geocoder.tomtom.search_bar_api_key` (#14578).
* You can configure your API key for the search bar, powered by TomTom, both in Editor and Builder, with `geocoder.tomtom.search_bar_api_key` (#14578).
- /viz endpoint supports ordering by :estimated_row_count and :privacy ([#14320](https://github.com/CartoDB/cartodb/issues/14320))
- /viz endpoint supports multiple ordering ([#14372](https://github.com/CartoDB/cartodb/issues/14372))
- /viz endpoint supports ordering by :favorited ([#14372](https://github.com/CartoDB/cartodb/issues/14372))

@ -1,3 +1,3 @@
{
"version": "1.0.1"
"version": "1.0.2"
}

@ -1 +1 @@
Subproject commit 7ddec0dd6a563e4a7f3532855d807f9782b5b2c1
Subproject commit 0843288cca8571f0b00a37ebfe442360c312b011

@ -1,6 +1,6 @@
// cartodb.js version: 3.15.19
// uncompressed version: cartodb.uncompressed.js
// sha: 887fbbc3a227fb349e314a95290ba9af92afaa8d
// sha: 0843288cca8571f0b00a37ebfe442360c312b011
(function() {
var define; // Undefine define (require.js), see https://github.com/CartoDB/cartodb.js/issues/543
var root = this;
@ -27055,53 +27055,53 @@ cdb.geo.geocoder.TOMTOM = {
var bestCandidate = rawResponse.results[0];
return [{
boundingbox: _getBoundingBox(bestCandidate),
center: _getCenter(bestCandidate),
type: _getType(bestCandidate)
boundingbox: this._getBoundingBox(bestCandidate),
center: this._getCenter(bestCandidate),
type: this._getType(bestCandidate)
}];
}
};
},
/**
* TomTom returns { lon, lat } while we use [lat, lon]
*/
function _getCenter(result) {
return [result.position.lat, result.position.lon];
}
/**
* TomTom returns { lon, lat } while we use [lat, lon]
*/
_getCenter: function (result) {
return [result.position.lat, result.position.lon];
},
/**
* Transform the feature type into a well known enum.
*/
function _getType(result) {
var type = result.type;
/**
* Transform the feature type into a well known enum.
*/
_getType: function (result) {
var type = result.type;
if (TYPES[type]) {
if (type === 'Geography' && result.entityType) {
type = type + ':' + result.entityType;
if (this.TYPES[type]) {
if (type === 'Geography' && result.entityType) {
type = type + ':' + result.entityType;
}
return this.TYPES[type];
}
return TYPES[type];
}
return 'default';
}
return 'default';
},
/**
* Transform the feature bbox into a carto.js well known format.
*/
function _getBoundingBox(result) {
if (!result.viewport) {
return;
}
var upperLeft = result.viewport.topLeftPoint;
var bottomRight = result.viewport.btmRightPoint;
/**
* Transform the feature bbox into a carto.js well known format.
*/
_getBoundingBox: function (result) {
if (!result.viewport) {
return;
}
var upperLeft = result.viewport.topLeftPoint;
var bottomRight = result.viewport.btmRightPoint;
return {
south: bottomRight.lat,
west: upperLeft.lon,
north: upperLeft.lat,
east: bottomRight.lon
};
}cdb.geo.geocoder.YAHOO = {
return {
south: bottomRight.lat,
west: upperLeft.lon,
north: upperLeft.lat,
east: bottomRight.lon
};
}
};cdb.geo.geocoder.YAHOO = {
keys: {
app_id: 'nLQPTdTV34FB9L3yK2dCXydWXRv3ZKzyu_BdCSrmCBAM1HgGErsCyCbBbVP2Yg--'
},

Loading…
Cancel
Save