Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

ol-mapbox-style

Package Overview
Dependencies
Maintainers
1
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ol-mapbox-style - npm Package Compare versions

Comparing version 2.6.5 to 2.6.6

25

index.js

@@ -218,3 +218,3 @@ /*

function processStyle(glStyle, map, baseUrl, path, accessToken) {
function processStyle(glStyle, map, baseUrl, host, path, accessToken) {
var view = map.getView();

@@ -233,4 +233,8 @@ if ('center' in glStyle && !view.getCenter()) {

}
if (glStyle.sprite && glStyle.sprite.indexOf('mapbox://') == 0) {
glStyle.sprite = baseUrl + '/sprite' + accessToken;
if (glStyle.sprite) {
if (glStyle.sprite.indexOf('mapbox://') == 0) {
glStyle.sprite = baseUrl + '/sprite' + accessToken;
} else if (glStyle.sprite.indexOf('http') != 0) {
glStyle.sprite = host + path + glStyle.sprite + accessToken;
}
}

@@ -310,2 +314,10 @@

if (tilejson.getState() == 'ready') {
var tileJSONDoc = tilejson.getTileJSON();
var tiles = Array.isArray(tileJSONDoc.tiles) ? tileJSONDoc.tiles : [tileJSONDoc.tiles];
for (var i = 0, ii = tiles.length; i < ii; ++i) {
var tile = tiles[i];
if (tile.indexOf('http' != 0)) {
tiles[i] = glSource.url + tile;
}
}
layer.setSource(new VectorTileSource({

@@ -315,3 +327,3 @@ attributions: tilejson.getAttributions(),

tileGrid: tilejson.getTileGrid(),
tileUrlFunction: tilejson.getTileUrlFunction()
urls: tiles
}));

@@ -395,3 +407,3 @@ Observable.unByKey(key);

var accessToken, baseUrl, path;
var accessToken, baseUrl, host, path;

@@ -415,5 +427,6 @@ if (!(map instanceof Map)) {

path = a.pathname.split('/').slice(0, -1).join('/') + '/';
host = style.substr(0, style.indexOf(path));
xhr.addEventListener('load', function() {
var glStyle = JSON.parse(xhr.responseText);
processStyle(glStyle, map, baseUrl, path, accessToken);
processStyle(glStyle, map, baseUrl, host, path, accessToken);
});

@@ -420,0 +433,0 @@ xhr.addEventListener('error', function() {

{
"name": "ol-mapbox-style",
"version": "2.6.5",
"version": "2.6.6",
"description": "Create OpenLayers maps from Mapbox Style objects",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc