Browse Source

fix: use named exports instead of default (#411)

BREAKING CHANGE: This library is now using named exports instead of default.
main
Justin Poehnelt 3 years ago committed by GitHub
parent
commit
ab2214b6d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .gitignore
  2. 6
      README.md
  3. 4
      examples/basic.html
  4. 2
      examples/events.html
  5. 2
      examples/lettered.html
  6. 2
      examples/picturelabel.html
  7. 9
      rollup.config.js
  8. 4
      src/index.ts

2
.gitignore vendored

@ -226,3 +226,5 @@ $RECYCLE.BIN/ @@ -226,3 +226,5 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
.vscode

6
README.md

@ -27,11 +27,11 @@ or @@ -27,11 +27,11 @@ or
`yarn add @googlemaps/markerwithlabel`
Alternativly you may add the umd package directly to the html document using the unpkg link.
Alternatively you may add the umd package directly to the html document using the unpkg link.
`<script src="https://unpkg.com/@googlemaps/markerwithlabel/dist/index.min.js"></script>`
When adding via unpkg, the marker with labels can be accessed at `MarkerWithLabel`.
When adding via unpkg, the marker with labels can be accessed at `new markerWithLabel.MarkerWithLabel()`.
A version can be specified by using `https://unpkg.com/@googlemaps/markerwithlabel@VERSION/dist/...`.
@ -42,6 +42,8 @@ The reference documentation can be found at this [link](https://googlemaps.githu @@ -42,6 +42,8 @@ The reference documentation can be found at this [link](https://googlemaps.githu
## Example
```js
import { MarkerWithLabel } from '@googlemaps/markerwithlabel';
new MarkerWithLabel({
position: new google.maps.LatLng(49.475, -123.84),
clickable: true,

4
examples/basic.html

@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
mapTypeId: google.maps.MapTypeId.ROADMAP,
});
var marker1 = new MarkerWithLabel({
var marker1 = new markerWithLabel.MarkerWithLabel({
position: homeLatLng,
draggable: false,
clickable: false,
@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
labelStyle: { opacity: 0.75 },
});
var marker2 = new MarkerWithLabel({
var marker2 = new markerWithLabel.MarkerWithLabel({
position: new google.maps.LatLng(49.475, -123.84),
draggable: true,
map: map,

2
examples/events.html

@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
mapTypeId: google.maps.MapTypeId.ROADMAP,
});
var marker = new MarkerWithLabel({
var marker = new markerWithLabel.MarkerWithLabel({
position: homeLatLng,
draggable: true,
raiseOnDrag: true,

2
examples/lettered.html

@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
mapTypeId: google.maps.MapTypeId.ROADMAP,
});
marker = new MarkerWithLabel({
marker = new markerWithLabel.MarkerWithLabel({
position: homeLatLng,
map: map,
draggable: true,

2
examples/picturelabel.html

@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
pictureLabel = document.createElement("img");
pictureLabel.src = "home.jpg";
marker = new MarkerWithLabel({
marker = new markerWithLabel.MarkerWithLabel({
position: homeLatLng,
map: map,
draggable: true,

9
rollup.config.js

@ -40,15 +40,13 @@ export default [ @@ -40,15 +40,13 @@ export default [
file: "dist/index.umd.js",
format: "umd",
sourcemap: true,
exports: "default",
name: "MarkerWithLabel",
name: "markerWithLabel",
},
{
file: "dist/index.min.js",
format: "iife",
sourcemap: true,
exports: "default",
name: "MarkerWithLabel",
name: "markerWithLabel",
},
],
},
@ -62,7 +60,7 @@ export default [ @@ -62,7 +60,7 @@ export default [
output: {
file: "dist/index.dev.js",
format: "iife",
name: "MarkerWithLabel",
name: "markerWithLabel",
},
},
{
@ -74,7 +72,6 @@ export default [ @@ -74,7 +72,6 @@ export default [
file: "dist/index.esm.js",
format: "esm",
sourcemap: true,
name: "MarkerWithLabel",
},
},
];

4
src/index.ts

@ -14,6 +14,6 @@ @@ -14,6 +14,6 @@
* limitations under the License.
*/
import { MarkerWithLabel } from "./marker";
import { MarkerWithLabel, MarkerWithLabelOptions } from "./marker";
export default MarkerWithLabel;
export { MarkerWithLabel, MarkerWithLabelOptions };

Loading…
Cancel
Save