Skip to content
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
47 changes: 33 additions & 14 deletions src/maps/controls/controlposition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,36 @@
* limitations under the License.
*/

export enum ControlPosition {
BOTTOM_CENTER = 0.0,
BOTTOM_LEFT = 1.0,
BOTTOM_RIGHT = 2.0,
LEFT_BOTTOM = 3.0,
LEFT_CENTER = 4.0,
LEFT_TOP = 5.0,
RIGHT_BOTTOM = 6.0,
RIGHT_CENTER = 7.0,
RIGHT_TOP = 8.0,
TOP_CENTER = 9.0,
TOP_LEFT = 10.0,
TOP_RIGHT = 11.0,
}
export const ControlPosition = {
TOP_LEFT: 1,
TOP_CENTER: 2,
TOP: 2,
TOP_RIGHT: 3,
LEFT_CENTER: 4,
LEFT_TOP: 5,
LEFT: 5,
LEFT_BOTTOM: 6,
RIGHT_TOP: 7,
RIGHT: 7,
RIGHT_CENTER: 8,
RIGHT_BOTTOM: 9,
BOTTOM_LEFT: 10,
BOTTOM_CENTER: 11,
BOTTOM: 11,
BOTTOM_RIGHT: 12,
CENTER: 13,
BLOCK_START_INLINE_START: 14,
BLOCK_START_INLINE_CENTER: 15,
BLOCK_START_INLINE_END: 16,
INLINE_START_BLOCK_CENTER: 17,
INLINE_START_BLOCK_START: 18,
INLINE_START_BLOCK_END: 19,
INLINE_END_BLOCK_START: 20,
INLINE_END_BLOCK_CENTER: 21,
INLINE_END_BLOCK_END: 22,
BLOCK_END_INLINE_START: 23,
BLOCK_END_INLINE_CENTER: 24,
BLOCK_END_INLINE_END: 25,
} as const;
export type ControlPosition =
(typeof ControlPosition)[keyof typeof ControlPosition];
22 changes: 8 additions & 14 deletions src/maps/maps/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { LatLng, LatLngBounds } from "../coordinates/latlng";
import { MapsEventListener } from "../event/event";
import { MVCObject } from "../event/mvcobject";
import { FeatureLayer } from "./featurelayer";
import { ControlPosition } from "../controls/controlposition";

export class Map_ extends MVCObject implements google.maps.Map {
public controls: Array<google.maps.MVCArray<HTMLElement>>;
Expand Down Expand Up @@ -147,20 +148,13 @@ export class Map_ extends MVCObject implements google.maps.Map {
constructor(mapDiv: Element | null, opts?: google.maps.MapOptions) {
super();
this.data = new google.maps.Data();
this.controls = [
new google.maps.MVCArray<HTMLElement>(), // BOTTOM_CENTER
new google.maps.MVCArray<HTMLElement>(), // BOTTOM_LEFT
new google.maps.MVCArray<HTMLElement>(), // BOTTOM_RIGHT
new google.maps.MVCArray<HTMLElement>(), // LEFT_BOTTOM
new google.maps.MVCArray<HTMLElement>(), // LEFT_CENTER
new google.maps.MVCArray<HTMLElement>(), // LEFT_TOP
new google.maps.MVCArray<HTMLElement>(), // RIGHT_BOTTOM
new google.maps.MVCArray<HTMLElement>(), // RIGHT_CENTER
new google.maps.MVCArray<HTMLElement>(), // RIGHT_TOP
new google.maps.MVCArray<HTMLElement>(), // TOP_CENTER
new google.maps.MVCArray<HTMLElement>(), // TOP_LEFT
new google.maps.MVCArray<HTMLElement>(), // TOP_RIGHT
];

this.controls = [];

for (const [_, value] of Object.entries(ControlPosition)) {
this.controls[value] = new google.maps.MVCArray<HTMLElement>();
}

this.mapTypes = new google.maps.MVCObject();
this.overlayMapTypes = new google.maps.MVCArray();
}
Expand Down