TopoJSON Server API in the Browser

topojson.topology({export: geojson})
window.topojson = { 
server: require(‘../node_modules/topojson/index’),
client: require(‘../node_modules/topojson/topojson.js’)
}
var gulp = require(‘gulp’);
var uglify = require(‘gulp-uglify’);
var browserify = require(‘browserify’);
var source = require(‘vinyl-source-stream’);
var buffer = require(‘vinyl-buffer’);
gulp.task(‘topojson’, function() {
return browserify([‘./src/topojsonSetup.js’])
.bundle()
.pipe(source(‘topojsonAll.js’))
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest(‘./dist/’));});
gulp.task(‘default’, [‘topojson’]);

--

--

--

Mapper | web developer/designer. Lover of all things open source and geo. Has cooked risotto in three countries.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
John J Czaplewski

John J Czaplewski

Mapper | web developer/designer. Lover of all things open source and geo. Has cooked risotto in three countries.

More from Medium

Confusion about Min-width & Max-width in Media Query in Css

Javascript: The Call Stack and Scope

Using JavaScript and window.postMessage() for Safe Cross-Domain Communication

npm vs npx