use cdn_url from windshaft when present in the response

This commit is contained in:
javi 2014-07-11 14:37:18 +02:00
parent e8ff4d6ea3
commit c805c4cc27

View File

@ -428,6 +428,12 @@
for(var k in opt) { for(var k in opt) {
self.options[k] = opt[k]; 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.templateUrl = self.url() + "/api/v1/map/" + data.layergroupid + "/" + torque_key + "/{z}/{x}/{y}.json.torque";
self._setReady(true); self._setReady(true);
} else { } else {