Skip to content

Commit

Permalink
feat(place-icons): add place icon provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Immo-Be authored and usefulthink committed Dec 7, 2022
1 parent 24312a6 commit ea1e834
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions examples/05.place-icons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Marker-API Example Playground
//
// Edit the code and hit CMD + Enter to execute it.
//
// Key bindings:
//
// <Cmd> + <Return> compile typescript and execute
// <Cmd> + <S> save the code to the URL
//

import {Marker} from './lib/marker';
import {PlaceIcons} from './lib/icons';

export default (map: google.maps.Map) => {
Marker.registerIconProvider(PlaceIcons());

const m1 = new Marker();
m1.position = {lat: 53.555, lng: 10.001};
m1.scale = ({map}) => Math.max(1, Math.pow(1.45, map.zoom) / 64);
m1.map = map;
m1.icon = 'theater';
m1.color = 'white';
m1.borderColor = 'grey';

// the returned function will run before the running code is updated.
// This gives you an opportunity to clean up everything that has been added
// (don't worry aboutthe markers, they will be automatically removed from
// the map)
};

0 comments on commit ea1e834

Please sign in to comment.