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 support for AdvancedMarker #199

Closed
halvtomat opened this issue Feb 22, 2024 · 10 comments · Fixed by #263
Closed

Add support for AdvancedMarker #199

halvtomat opened this issue Feb 22, 2024 · 10 comments · Fixed by #263
Labels
feature request New feature

Comments

@halvtomat
Copy link
Contributor

halvtomat commented Feb 22, 2024

The google maps Marker element is deprecated as of February 2023, Advanced marker is the new better version.

Read more about Advanced marker here

@HusamElbashir
Copy link
Collaborator

Thanks for the heads up! We'll try and work that into our plans.

@ScreamZ
Copy link

ScreamZ commented Mar 7, 2024

Screenshot 2024-03-07 at 11 33 37

For more details

@Molanda
Copy link

Molanda commented May 3, 2024

I was able to use the AdvancedMarkerElement by adding marker to the libraries prop.

<GoogleMap :libraries="['marker']" ...

Once I did that, I was able to add the marker as follows (see the Advanced Usage section).

const marker = new this.refMap.api.marker.AdvancedMarkerElement({
  map: this.refMap.map,
  position: {
    lat: -25.363,
    lng: 131.044,
  },
});

@HusamElbashir marker should be added to the list of libraries to avoid any TypeScript warnings...

libraries: {
  type: Array as PropType<("drawing" | "geometry" | "localContext" | "places" | "visualization" | "marker")[]>,
  default: () => ["places"],
},

Thank you for putting the component together!

@allaghi
Copy link

allaghi commented May 15, 2024

I was able to use the AdvancedMarkerElement by adding marker to the libraries prop.

<GoogleMap :libraries="['marker']" ...

Once I did that, I was able to add the marker as follows (see the Advanced Usage section).

const marker = new this.refMap.api.marker.AdvancedMarkerElement({
  map: this.refMap.map,
  position: {
    lat: -25.363,
    lng: 131.044,
  },
});

@HusamElbashir marker should be added to the list of libraries to avoid any TypeScript warnings...

libraries: {
  type: Array as PropType<("drawing" | "geometry" | "localContext" | "places" | "visualization" | "marker")[]>,
  default: () => ["places"],
},

Thank you for putting the component together!

Could you please show us the full example how you solve it ?

Thanks in advance.

@oawebdev
Copy link

I was able to use the AdvancedMarkerElement by adding marker to the libraries prop.

<GoogleMap :libraries="['marker']" ...

Once I did that, I was able to add the marker as follows (see the Advanced Usage section).

const marker = new this.refMap.api.marker.AdvancedMarkerElement({
  map: this.refMap.map,
  position: {
    lat: -25.363,
    lng: 131.044,
  },
});

@HusamElbashir marker should be added to the list of libraries to avoid any TypeScript warnings...

libraries: {
  type: Array as PropType<("drawing" | "geometry" | "localContext" | "places" | "visualization" | "marker")[]>,
  default: () => ["places"],
},

Thank you for putting the component together!

Hello! How to use it with MarkerCluster component?

@sbautista05
Copy link

Hello, any update on this new feature? Thank you :)

@luisfrancajr
Copy link

Hello, is there any way to use MarkerCluster with advanced marker?

@Indre87
Copy link

Indre87 commented Jul 1, 2024

Any updates on this with MarkerCluster?

@VictorBalbo
Copy link
Contributor

VictorBalbo commented Jul 12, 2024

I created a PR to add the new AdvancedMarker component: #263
To be honest the new component doesn't seem to bring any big changes, the only thing I saw different was the option to custumize the pin without actually replacing it by an image, and also removed a lot of events and options that existed in the old component (like the property for animation, which now have to be done by hand). But at least it stops the anoying warnings and can easily replace the Marker component

@HusamElbashir HusamElbashir linked a pull request Jul 19, 2024 that will close this issue
@HusamElbashir
Copy link
Collaborator

Released in v0.21.0. Thanks to @VictorBalbo for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants