Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #23 from Esri/1.0.5
Browse files Browse the repository at this point in the history
a few more tweaks before tagging 1.0.5
  • Loading branch information
jgravois authored Jun 17, 2016
2 parents f154e86 + 22aaf35 commit d6accbf
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 69 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.0.5] - 2016-06-14

### Added
* `toGeoJSON()` method accessible to all individual markers.

## [1.0.4] - 2015-09-11

### Added
Expand Down
6 changes: 3 additions & 3 deletions debug/sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map)

L.shapeMarkers.xMarker([45.505264141298525, -122.691707611084], 50).addTo(map)
var x = L.shapeMarkers.xMarker([45.505264141298525, -122.691707611084], 50).addTo(map)

L.shapeMarkers.crossMarker([45.5469954685617, -122.69840240478517], 50, {
var cross = L.shapeMarkers.crossMarker([45.5469954685617, -122.69840240478517], 50, {
color: 'red'
}).addTo(map)

L.shapeMarkers.squareMarker([45.49515737901887, -122.6450157165], 50, {
var square = L.shapeMarkers.squareMarker([45.49515737901887, -122.6450157165], 50, {
weight: 10,
color: 'green'
}).addTo(map)
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<script src="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.1/leaflet-src.js"></script>

<!-- Load shapeMarkers from CDN -->
<script src="https://cdn.jsdelivr.net/leaflet.shapemarkers/1.0.4/leaflet-shape-markers.js"></script>
<script src="https://cdn.jsdelivr.net/leaflet.shapemarkers/1.0.5/leaflet-shape-markers.js"></script>

<style>
body {margin:0;padding:0;}
Expand Down
19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "leaflet-shape-markers",
"description": "Shape markers of fixed size for point symbols",
"version": "1.0.4",
"version": "1.0.5",
"author": "Rachel Nehmer <[email protected]>",
"bugs": {
"url": "https://github.com/Esri/Leaflet.shapeMarkers/issues"
Expand All @@ -17,15 +17,19 @@
"karma": "^0.12.24",
"karma-mocha": "^0.1.0",
"karma-chai-sinon": "^0.1.3",
"karma-coverage": "douglasduteil/karma-coverage#next",
"karma-coverage": "^0.5.3",
"karma-mocha-reporter": "^0.2.5",
"karma-phantomjs-launcher": "^0.1.4",
"karma-phantomjs-launcher": "^0.2.0",
"karma-sourcemap-loader": "^0.3.5",
"semistandard": "^7.0.0",
"semistandard": "^7.0.5",
"gh-release": "^2.0.0",
"mkdirp": "^0.5.1",
"rollup": "^0.10.0",
"uglify-js": "^2.4.23"
"rollup": "^0.25.4",
"rollup-plugin-json": "^2.0.0",
"rollup-plugin-node-resolve": "^1.4.0",
"rollup-plugin-uglify": "^0.3.1",
"uglify-js": "^2.4.23",
"watch": "^0.17.1"
},
"homepage": "http://github.com/Esri/Leaflet.shapeMarkers",
"jsnext:main": "src/ShapeMarkers.js",
Expand All @@ -44,10 +48,11 @@
"scripts": {
"prepublish": "npm run build",
"prebuild": "mkdirp dist",
"build": "./scripts/build.js",
"build": "rollup -c scripts/debug.js && rollup -c scripts/production.js",
"release": "./scripts/release.sh",
"lint": "semistandard src/*.js",
"pretest": "npm run build",
"start": "watch 'npm run build' src & http-server -p 5000 -c-1 -o",
"test": "npm run lint && karma start"
}
}
28 changes: 28 additions & 0 deletions scripts/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { rollup } from 'rollup';
import json from 'rollup-plugin-json';
import nodeResolve from 'rollup-plugin-node-resolve';

var pkg = require('../package.json');
var copyright = '/* ' + pkg.name + ' - v' + pkg.version + ' - ' + new Date().toString() + '\n' +
' * Copyright (c) ' + new Date().getFullYear() + ' Environmental Systems Research Institute, Inc.\n' +
' * ' + pkg.license + ' */';

export default {
entry: 'src/ShapeMarkers.js',
moduleName: 'L.shapeMarkers',
format: 'umd',
external: ['leaflet'],
plugins: [
nodeResolve({
jsnext: true,
main: false,
browser: false,
extensions: [ '.js', '.json' ]
}),
json()
],
globals: {
'leaflet': 'L'
},
banner: copyright
}
47 changes: 0 additions & 47 deletions scripts/build.js

This file was deleted.

6 changes: 6 additions & 0 deletions scripts/debug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import config from './base.js'

config.dest = 'dist/leaflet-shape-markers-debug.js';
config.sourceMap = 'inline';

export default config;
10 changes: 10 additions & 0 deletions scripts/production.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import uglify from 'rollup-plugin-uglify';
import config from './base.js'

config.dest = 'dist/leaflet-shape-markers.js';
config.sourceMap = 'dist/leaflet-shape-markers.js.map';

// use a Regex to preserve copyright text
config.plugins.push(uglify({ output: { comments: /Institute, Inc/} }));

export default config;
13 changes: 11 additions & 2 deletions spec/CrossMarkerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ describe('CrossMarker', function () {
expect(marker.getSize()).to.eq(15);
});
});

describe('and size is set after adding it', function () {
it('takes that size', function () {
var marker = L.shapeMarkers.crossMarker([0, 0], 20);
Expand All @@ -30,7 +29,6 @@ describe('CrossMarker', function () {
expect(marker.getSize()).to.eq(15);
});
});

describe('and center is set before adding it', function () {
it('takes that center', function () {
var marker = L.shapeMarkers.crossMarker([0, 0], 20);
Expand All @@ -49,6 +47,17 @@ describe('CrossMarker', function () {
expect(marker.getLatLng().lng).to.eq(-128);
});
});
describe('and export geojson', function () {
it('using the built in method', function () {
var marker = L.shapeMarkers.crossMarker([0, 0], 20);
marker.addTo(map);
marker.setLatLng(L.latLng(44, -128));
var geojson = marker.toGeoJSON()
expect(geojson.type).to.eq('Feature');
expect(geojson.geometry.coordinates[0]).to.eq(-128);
expect(geojson.geometry.coordinates[1]).to.eq(44);
});
});
});
});
});
13 changes: 11 additions & 2 deletions spec/DiamondMarkerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ describe('DiamondMarker', function () {
expect(marker.getSize()).to.eq(15);
});
});

describe('and size is set after adding it', function () {
it('takes that size', function () {
var marker = L.shapeMarkers.diamondMarker([0, 0], 20);
Expand All @@ -30,7 +29,6 @@ describe('DiamondMarker', function () {
expect(marker.getSize()).to.eq(15);
});
});

describe('and center is set before adding it', function () {
it('takes that center', function () {
var marker = L.shapeMarkers.diamondMarker([0, 0], 20);
Expand All @@ -49,6 +47,17 @@ describe('DiamondMarker', function () {
expect(marker.getLatLng().lng).to.eq(-128);
});
});
describe('and export geojson', function () {
it('using the built in method', function () {
var marker = L.shapeMarkers.diamondMarker([0, 0], 20);
marker.addTo(map);
marker.setLatLng(L.latLng(44, -128));
var geojson = marker.toGeoJSON()
expect(geojson.type).to.eq('Feature');
expect(geojson.geometry.coordinates[0]).to.eq(-128);
expect(geojson.geometry.coordinates[1]).to.eq(44);
});
});
});
});
});
11 changes: 11 additions & 0 deletions spec/SquareMarkerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ describe('SquareMarker', function () {
expect(marker.getLatLng().lng).to.eq(-128);
});
});
describe('and export geojson', function () {
it('using the built in method', function () {
var marker = L.shapeMarkers.squareMarker([0, 0], 20);
marker.addTo(map);
marker.setLatLng(L.latLng(44, -128));
var geojson = marker.toGeoJSON()
expect(geojson.type).to.eq('Feature');
expect(geojson.geometry.coordinates[0]).to.eq(-128);
expect(geojson.geometry.coordinates[1]).to.eq(44);
});
});
});
});
});
13 changes: 11 additions & 2 deletions spec/XMarkerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ describe('XMarker', function () {
expect(marker.getSize()).to.eq(15);
});
});

describe('and size is set after adding it', function () {
it('takes that size', function () {
var marker = L.shapeMarkers.xMarker([0, 0], 20);
Expand All @@ -30,7 +29,6 @@ describe('XMarker', function () {
expect(marker.getSize()).to.eq(15);
});
});

describe('and center is set before adding it', function () {
it('takes that center', function () {
var marker = L.shapeMarkers.xMarker([0, 0], 20);
Expand All @@ -49,6 +47,17 @@ describe('XMarker', function () {
expect(marker.getLatLng().lng).to.eq(-128);
});
});
describe('and export geojson', function () {
it('using the built in method', function () {
var marker = L.shapeMarkers.xMarker([0, 0], 20);
marker.addTo(map);
marker.setLatLng(L.latLng(44, -128));
var geojson = marker.toGeoJSON()
expect(geojson.type).to.eq('Feature');
expect(geojson.geometry.coordinates[0]).to.eq(-128);
expect(geojson.geometry.coordinates[1]).to.eq(44);
});
});
});
});
});
10 changes: 5 additions & 5 deletions src/ShapeMarkers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export var VERSION = '1.0.4';
export {version as VERSION} from '../package.json';

export { crossMarker } from './CrossMarker.js';
export { xMarker } from './XMarker.js';
export { squareMarker } from './SquareMarker.js';
export { diamondMarker } from './DiamondMarker.js';
export { crossMarker } from './CrossMarker';
export { xMarker } from './XMarker';
export { squareMarker } from './SquareMarker';
export { diamondMarker } from './DiamondMarker';

0 comments on commit d6accbf

Please sign in to comment.