Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MarkerIcon type #1836

Merged
7 commits merged into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/directives/marker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class AgmMarker implements OnDestroy, OnChanges, AfterContentInit, FitBou
/**
* Icon (the URL of the image) for the foreground.
*/
@Input() iconUrl: string;
@Input() iconUrl: string | mapTypes.MarkerIcon | mapTypes.GoogleSymbol;

/**
* If true, the marker is visible
Expand Down
2 changes: 2 additions & 0 deletions packages/core/map-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export {
LatLngLiteral,
PolyMouseEvent,
MarkerLabel,
MarkerIcon,
Geocoder,
GeocoderAddressComponent,
GeocoderComponentRestrictions,
Expand Down Expand Up @@ -42,6 +43,7 @@ export {
RectangleOptions,
Marker,
MarkerOptions,
GoogleSymbol,
} from './services/google-maps-types';

/**
Expand Down
13 changes: 11 additions & 2 deletions packages/core/services/google-maps-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface Marker extends MVCObject {
setTitle(title: string): void;
setLabel(label: string | MarkerLabel): void;
setDraggable(draggable: boolean): void;
setIcon(icon: string): void;
setIcon(icon: string | MarkerIcon | GoogleSymbol): void;
setOpacity(opacity: number): void;
setVisible(visible: boolean): void;
setZIndex(zIndex: number): void;
Expand All @@ -66,7 +66,7 @@ export interface MarkerOptions {
map?: GoogleMap;
label?: string | MarkerLabel;
draggable?: boolean;
icon?: string;
icon?: string | MarkerIcon | GoogleSymbol;
opacity?: number;
visible?: boolean;
zIndex?: number;
Expand All @@ -82,6 +82,15 @@ export interface MarkerLabel {
text: string;
}

export interface MarkerIcon {
darron1217 marked this conversation as resolved.
Show resolved Hide resolved
anchor?: Point;
labelOrigin?: Point;
origin?: Point;
scaledSize?: Size;
size?: Size;
url: string;
}

export interface Circle extends MVCObject {
getBounds(): LatLngBounds;
getCenter(): LatLng;
Expand Down