inocan-group / vue3-google-map

A set of composable components for easy use of Google Maps in your Vue 3 projects.
https://vue3-google-map.com
MIT License
264 stars 50 forks source link

Add support for AdvancedMarker #199

Open halvtomat opened 4 months ago

halvtomat commented 4 months ago

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 commented 4 months ago

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

ScreamZ commented 4 months ago

Screenshot 2024-03-07 at 11 33 37

For more details

Molanda commented 2 months ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

luisfrancajr commented 1 month ago

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

Indre87 commented 5 days ago

Any updates on this with MarkerCluster?