Skip to content

Commit

Permalink
created global variable for browser through browserify
Browse files Browse the repository at this point in the history
  • Loading branch information
gagan-bansal committed Apr 13, 2014
1 parent 0cf0ad0 commit d1d9165
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 36 deletions.
30 changes: 13 additions & 17 deletions dist/geojson2svg.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/geojson2svg.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions examples/world.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
//(function() {
var dataURLPoly = 'http://54.255.134.125:3005/examples/data/countries.geo.json';
//var dataURL = 'http://54.255.134.125:3005/examples/data/CAN.geo.json';
var dataURLPoint = 'http://54.255.134.125:3005/examples/data/capitals.json';
var dataURLPoly = './data/countries.geo.json';
//var dataURL = './data/CAN.geo.json';
var dataURLPoint = './data/capitals.json';
getjson(dataURLPoint,drawGeoJSON);
getjson(dataURLPoly,drawGeoJSON);

function drawGeoJSON(resp) {
console.log('i am drawing');
var geojson = JSON.parse(resp);
var svgMap = document.getElementById('map');
var convertor = geojson2svg({width:800,height:800});
Expand All @@ -30,4 +28,3 @@
frag.appendChild(div.firstChild.firstChild);
return frag;
}
//})();
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geojson2svg",
"version": "0.0.1",
"version": "0.0.3",
"description": "Converts geojson to svg/path string given svg viewport size and maps extent.",
"main": "src/main.js",
"scripts": {
Expand All @@ -11,13 +11,16 @@
"geojson",
"svg"
],
"repository": {
"type": "git",
"url": "https://github.com/gagan-bansal/geojson2svg"
},
"auther": "Gagan Bansal",
"license": "MIT",
"dependencies": {
"reproject": "~0.1.1",
"deep-extend": "~0.2.8",
"clone": "~0.1.11",
"proj4": "~2.1.0"
"deep-extend": "~0.2.8",
"multigeojson": "0.0.0"
},
"devDependencies": {
"mocha": "~1.17.1",
Expand Down
8 changes: 1 addition & 7 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
var extend = require('deep-extend');
var g2svg = require('./instance.js');
var geojson2svg = function(viewportSize,options) {
if(!viewportSize) return;
return new g2svg(viewportSize,options);
};

if(typeof module !== 'undefined' && module.exports) {
module.exports = geojson2svg;
}
if(window !== 'undefined') {
window.geojson2svg = geojson2svg;
}
module.exports = geojson2svg;

0 comments on commit d1d9165

Please sign in to comment.