Use strings rather than RegExps in replace
This commit is contained in:
1 parent
215d1ec8db
commit
caf67ac5ba
1 file changed
+3
-3
@@ -20,9 +20,9 @@ ol.TileUrlFunction.createFromTemplate = function(template) {
|
||||
if (goog.isNull(tileCoord)) {
|
||||
return undefined;
|
||||
} else {
|
||||
return template.replace(/\{z\}/, tileCoord.z)
|
||||
.replace(/\{x\}/, tileCoord.x)
|
||||
.replace(/\{y\}/, tileCoord.y);
|
||||
return template.replace('{z}', tileCoord.z)
|
||||
.replace('{x}', tileCoord.x)
|
||||
.replace('{y}', tileCoord.y);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user