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

kosmtik-map-compare

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kosmtik-map-compare - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

36

front.js

@@ -22,3 +22,3 @@ L.K.Map.addInitHook(function () {

var builder = new L.K.FormBuilder(params, [
['active', {handler: L.K.Switch, label: 'Active'}],
['active', {handler: L.K.Switch, label: 'Active (ctrl+alt+C)'}],
['tms', {handler: L.K.Switch, label: 'TMS format.'}],

@@ -28,13 +28,16 @@ ['url', {handler: 'BlurInput', helpText: 'URL template.'}]

// TODO vertical / horizontal view
var toggle = function () {
if (params.active) {
if (!otherMap) init();
L.DomUtil.addClass(document.body, 'map-compare-on');
otherMap.invalidateSize();
this.invalidateSize();
} else {
L.DomUtil.removeClass(document.body, 'map-compare-on');
this.invalidateSize();
}
}
builder.on('synced', function (e) {
if (e.field === 'active') {
if (params.active) {
if (!otherMap) init();
L.DomUtil.addClass(document.body, 'map-compare-on');
otherMap.invalidateSize();
this.invalidateSize();
} else {
L.DomUtil.removeClass(document.body, 'map-compare-on');
this.invalidateSize();
}
L.bind(toggle, this)();
} else if (e.field === 'url' && tilelayer) {

@@ -50,3 +53,16 @@ tilelayer.setUrl(params.url);

this.sidebar.rebuild();
var shortcutCallback = function () {
params.active = !params.active;
L.bind(toggle, this)();
builder.fetchAll();
};
this.shortcuts.add({
keyCode: L.K.Keys.C,
ctrlKey: true,
altKey: true,
callback: shortcutCallback,
context: this,
description: 'Toggle map compare view'
});
});
});
{
"name": "kosmtik-map-compare",
"version": "0.0.4",
"version": "0.0.5",
"description": "Add a map to compare side-by-side with your work",

@@ -25,3 +25,3 @@ "main": "index.js",

"homepage": "https://github.com/kosmtik/kosmtik-map-compare",
"kosmtik": "~0.0.3"
"kosmtik": "~0.0.5"
}

@@ -12,4 +12,9 @@ # kosmtik-map-compare

## Config
You can add `compareUrl` key to your `project.mml` or your kosmtik `config.yml`
files to set the default URL used. Fallback to OSM default style.
## Preview
![screenshot](https://raw.github.com/kosmtik/kosmtik-map-compare/master/screenshot.png "Screenshot of Kosmtik")
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