From c805c4cc2772a6f7669c4135b517e620df50aa1e Mon Sep 17 00:00:00 2001 From: javi Date: Fri, 11 Jul 2014 14:37:18 +0200 Subject: [PATCH] use cdn_url from windshaft when present in the response --- lib/torque/provider.windshaft.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/torque/provider.windshaft.js b/lib/torque/provider.windshaft.js index c79091a..7a07b2f 100644 --- a/lib/torque/provider.windshaft.js +++ b/lib/torque/provider.windshaft.js @@ -428,6 +428,12 @@ for(var k in opt) { self.options[k] = opt[k]; } + // use cdn_url if present + if (data.cdn_url) { + var c = self.options.cdn_url = self.options.cdn_url || {}; + c.http = data.cdn_url.http || c.http; + c.https = data.cdn_url.https || c.https; + } self.templateUrl = self.url() + "/api/v1/map/" + data.layergroupid + "/" + torque_key + "/{z}/{x}/{y}.json.torque"; self._setReady(true); } else {