Skip to content

Commit 02b249a

Browse files
committed
fix: cleanup
1 parent ad043f9 commit 02b249a

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

examples/playground/src/code-samples/12b.place-details.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// title: PlaceResult using the PlaceMarker class
22

3-
import {PlaceMarker} from '@ubilabs/google-maps-marker/placemarker';
3+
import {PlaceMarker} from '@ubilabs/google-maps-marker/places';
44

55
export default (map: google.maps.Map) => {
66
res.forEach(result => {

src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
export * from './marker';
2+
export * from './marker-attributes';
23
export * from './marker-collection';
4+
export * from './position-formats';
35

46
export * as color from './color';

src/map-state-observer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class MapStateObserver {
6666
const bounds = this.map_.getBounds();
6767

6868
if (!center || !bounds) {
69-
console.error(
69+
console.debug(
7070
'MapStateObserver.handleBoundsChange(): map center and/or bounds ' +
7171
'undefined. Not updating map state.'
7272
);

src/marker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class Marker<TUserData = unknown> {
6363
private mapEventListeners_: google.maps.MapsEventListener[] = [];
6464

6565
private data_: TUserData | null = null;
66-
private markerState_: MarkerState = {visible: false, hovered: false};
66+
private markerState_: MarkerState = {hovered: false};
6767

6868
/** Attributes set by the user. */
6969
private readonly attributes_: Partial<Attributes<TUserData>> = {};
@@ -380,6 +380,7 @@ export class Marker<TUserData = unknown> {
380380
set(this: Marker, value) {
381381
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
382382
this.attributes_[key] = value;
383+
this.update();
383384
}
384385
});
385386
}
@@ -425,7 +426,6 @@ export type MarkerOptions<T> = {
425426
*/
426427
export type MarkerState = {
427428
hovered: boolean;
428-
visible: boolean;
429429
};
430430

431431
enum MarkerEvents {

src/util.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export function assertMapsApiLoaded() {
2121
if (google.maps && !google.maps.marker) {
2222
console.error(
2323
`Google Maps API was loaded without the required marker-library. ` +
24-
`To load it, add the '&libraries=marker' parameter to the API url.`
24+
`To load it, add the '&libraries=marker' parameter to the API url ` +
25+
`or use \`await google.maps.importLibrary('marker');\` before creating ` +
26+
`a marker.`
2527
);
2628
throw new Error('Google Maps Marker Library not found.');
2729
}

0 commit comments

Comments
 (0)