Skip to content

Commit

Permalink
fix: rename packages in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
usefulthink committed Feb 21, 2023
1 parent 3e65b8a commit 63810a9
Show file tree
Hide file tree
Showing 22 changed files with 34 additions and 101 deletions.
68 changes: 0 additions & 68 deletions examples/playground/examples.html

This file was deleted.

4 changes: 2 additions & 2 deletions examples/playground/src/code-samples/00.default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// <Cmd> + <S> save the code to the URL
//

import {Marker} from '@ubilabs/google-maps-marker';
import {MaterialIcons} from '@ubilabs/google-maps-marker/icons';
import {Marker} from '@googlemaps/marker';
import {MaterialIcons} from '@googlemaps/marker/icons';

export default (map: google.maps.Map) => {
Marker.registerIconProvider(MaterialIcons());
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/src/code-samples/01.simple-marker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// title: create marker and add it to the map
import {Marker} from '@ubilabs/google-maps-marker';
import {Marker} from '@googlemaps/marker';

export default (map: google.maps.Map) => {
const m1 = new Marker();
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/src/code-samples/02.update-position.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// title: specifying and updating position
import {Marker} from '@ubilabs/google-maps-marker';
import {Marker} from '@googlemaps/marker';

export default (map: google.maps.Map) => {
// position can be speecified in a number of different formats:
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/src/code-samples/03.pin-styling.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// title: simple marker customizations: color
import {Marker} from '@ubilabs/google-maps-marker';
import {Marker} from '@googlemaps/marker';

export default (map: google.maps.Map) => {
const m1 = new Marker({map, position: {lat: 50, lng: 10}});
Expand Down
7 changes: 2 additions & 5 deletions examples/playground/src/code-samples/04.pin-icons.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// title: simple marker customizations: icons
import {Marker} from '@ubilabs/google-maps-marker';
import {
MaterialIcons,
MaterialIconsStyle
} from '@ubilabs/google-maps-marker/icons';
import {Marker} from '@googlemaps/marker';
import {MaterialIcons, MaterialIconsStyle} from '@googlemaps/marker/icons';

export default (map: google.maps.Map) => {
// first we need to register the icon-provider, which is a function that knows how to create the kind of dom-element needed for an icon-set
Expand Down
4 changes: 2 additions & 2 deletions examples/playground/src/code-samples/04b.places-icons.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// title: simple marker customizations: Google Maps Places API icons

import {Marker} from '@ubilabs/google-maps-marker';
import {PlaceIcons} from '@ubilabs/google-maps-marker/icons';
import {Marker} from '@googlemaps/marker';
import {PlaceIcons} from '@googlemaps/marker/icons';

export default (map: google.maps.Map) => {
Marker.registerIconProvider(PlaceIcons());
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/src/code-samples/05.hover-styling.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// title: marker interactivity: hover
import {Marker} from '@ubilabs/google-maps-marker';
import {Marker} from '@googlemaps/marker';

export default (map: google.maps.Map) => {
const position = {lat: 53.5, lng: 10};
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/src/code-samples/06.click-events.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// title: marker interactivity: click events
import {Marker} from '@ubilabs/google-maps-marker';
import {Marker} from '@googlemaps/marker';

export default (map: google.maps.Map) => {
const marker = new Marker({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// title: multiple markers / single selection (w/ user-data)
import {Marker} from '@ubilabs/google-maps-marker';
import {Marker} from '@googlemaps/marker';

function rnd(min: number, max: number) {
return min + Math.random() * (max - min);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// title: multiple markers / single selection (alternative w/ 'style objects')
import {Attributes, Marker} from '@ubilabs/google-maps-marker';
import {Attributes, Marker} from '@googlemaps/marker';

function rnd(min: number, max: number) {
return min + Math.random() * (max - min);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// title: dynamic attributes depending on each other

import {Marker} from '@ubilabs/google-maps-marker';
import {Marker} from '@googlemaps/marker';

// dynamic attributes can be written to reliably depend on the current value
// of another attribute, for example to make colors depend on the icon shown
Expand Down
4 changes: 2 additions & 2 deletions examples/playground/src/code-samples/09.draggable-manual.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// title: draggable markers / update position after drag
import {Marker} from '@ubilabs/google-maps-marker';
import {MaterialIcons} from '@ubilabs/google-maps-marker/icons';
import {Marker} from '@googlemaps/marker';
import {MaterialIcons} from '@googlemaps/marker/icons';

export default (map: google.maps.Map) => {
Marker.registerIconProvider(MaterialIcons());
Expand Down
8 changes: 2 additions & 6 deletions examples/playground/src/code-samples/10.marker-collection.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
// title: basic marker collection

import {
CollisionBehavior,
Marker,
MarkerCollection
} from '@ubilabs/google-maps-marker';
import {MaterialIcons} from '@ubilabs/google-maps-marker/icons';
import {CollisionBehavior, Marker, MarkerCollection} from '@googlemaps/marker';
import {MaterialIcons} from '@googlemaps/marker/icons';

type MyData = {
id: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/* eslint-disable @typescript-eslint/no-misused-promises */

import {MarkerCollection} from '@ubilabs/google-maps-marker';
import {MarkerCollection} from '@googlemaps/marker';

type MyData = {
id: number;
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/src/code-samples/12.place-details.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// title: simple marker for google places API PlaceResult
import {Marker} from '@ubilabs/google-maps-marker';
import {Marker} from '@googlemaps/marker';

export default (map: google.maps.Map) => {
const marker = new Marker<google.maps.places.PlaceResult>({
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/src/code-samples/12b.place-details.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// title: PlaceResult using the PlaceMarker class

import {PlaceMarker} from '@ubilabs/google-maps-marker/places';
import {PlaceMarker} from '@googlemaps/marker/places';

export default (map: google.maps.Map) => {
res.forEach(result => {
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/src/code-samples/13.html-marker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// title: dynamic html marker

import {Marker} from '@ubilabs/google-maps-marker';
import {Marker} from '@googlemaps/marker';

export default (map: google.maps.Map) => {
// create a stylesheet to be used by the marker
Expand Down
1 change: 1 addition & 0 deletions examples/playground/src/run-playground-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async function loadModules() {
const moduleCallback = moduleCallbacks[
src.replace('./', '../../../src/') + '.ts'
] as () => Promise<object>;

modules[src.replace('.', packageName)] = await moduleCallback();
}

Expand Down
4 changes: 2 additions & 2 deletions examples/playground/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"moduleResolution": "node",
"baseUrl": "./",
"paths": {
"@ubilabs/google-maps-marker": ["../../src/index.ts"],
"@ubilabs/google-maps-marker/*": ["../../src/*"]
"@googlemaps/marker": ["../../src/index.ts"],
"@googlemaps/marker/*": ["../../src/*"]
},
"typeRoots": ["./types", "./node_modules/@types"],
"importsNotUsedAsValues": "error",
Expand Down
5 changes: 5 additions & 0 deletions examples/playground/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export default defineConfig(({mode}) => {
examples: resolve(__dirname, './examples.html')
}
}
},
resolve: {
alias: {
'@googlemaps/marker': resolve(__dirname, '../../src')
}
}
};
});
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"compilerOptions": {
"module": "ES2020",
"target": "ES2020",
"moduleResolution": "nodenext",
"moduleResolution": "node",
"esModuleInterop": true,
"paths": {
"@googlemaps/marker": ["./src/index.ts"]
},
"noEmit": true,
"strict": true,
"skipLibCheck": true
"skipLibCheck": true,
"sourceMap": true,
"inlineSourceMap": true
}
}

0 comments on commit 63810a9

Please sign in to comment.