-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate with a single command the last map you created
- Loading branch information
1 parent
6ffd266
commit 58c491b
Showing
7 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@import 'common.js'; | ||
|
||
function GenericMap () {} | ||
|
||
GenericMap.prototype.generateLastMap = function (context) { | ||
if (!checkCount(context)) { | ||
return; | ||
} else { | ||
if (!checkLayerType(context)) { | ||
return; | ||
} else { | ||
var layer = context.selection[0]; | ||
var lastService = getPreferences('lastservice', ''); | ||
var lastUrl = getPreferences('lasturl', ''); | ||
var lastAddress = getPreferences('lastaddress', ''); | ||
var lastZoom = getPreferences('lastzoom', ''); | ||
|
||
if (lastService && lastUrl && lastAddress && lastZoom) { | ||
fillLayerWithImage(lastUrl, layer, context, lastService); | ||
setLayerName(layer, lastAddress, lastZoom); | ||
} else { | ||
context.document.showMessage('⚠️ Please generate a map first.'); | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,14 +29,22 @@ | |
"handler": "runMapboxToken", | ||
"identifier": "scriptMapboxToken", | ||
"shortcut": "shift cmd u" | ||
}, | ||
{ | ||
"script": "main.cocoascript", | ||
"name": "Generate previous Map", | ||
"handler": "runGenericPreviousMap", | ||
"identifier": "scriptPreviousMap", | ||
"shortcut": "shift cmd p" | ||
} | ||
], | ||
"menu" : { | ||
"items" : [ | ||
"scriptGoogle", | ||
"scriptGoogleMapsKey", | ||
"scriptMapbox", | ||
"scriptMapboxToken" | ||
"scriptMapboxToken", | ||
"scriptPreviousMap" | ||
], | ||
"title" : "Map Generator" | ||
}, | ||
|
@@ -45,7 +53,7 @@ | |
"icon": "icon.png", | ||
"identifier" : "io.eduardogomez.sketch.map-generator", | ||
"appcast": "https://raw.githubusercontent.com/eddiesigner/sketch-map-generator/master/appcast.xml", | ||
"version" : "3.5.2", | ||
"version" : "3.5.3", | ||
"description" : "Sketch plugin to fill a layer with a map generated from a given location using Google Maps and Mapbox", | ||
"authorEmail" : "[email protected]", | ||
"name" : "Map Generator" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters