Skip to content

Migration document from 1.x to 2.x is incorrect #1088

@bjornharvold

Description

@bjornharvold

The document located here: https://github.com/googlemaps/js-api-loader/blob/main/MIGRATION.md is incorrect.

setOptions({
  libraries: ['maps', 'marker', 'places']
})
await importLibrary("maps");

if I then instantiate:

const placeAutoComplete = new google.maps.places.PlaceAutocompleteElement(
      autocompleteOptions,
    );

It fails with Failed to construct 'HTMLElement': Illegal constructor.

I need to specifically importLibrary("places") for it to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions