Comments (5)
Very helpful
a small gift : vuejs/awesome-vue#3568
from x5-gmaps.
Thanks 😊
Good question. I don't have a specific example of this, but if you go to the example page it would be either "Markers with Options" or a combination of "Markers with Options" and "DOM Elements / Popup":
-
The simplest (and maybe best) is to detect the click and open a modal over the map. The cost is something pops up over the map and not where you clicked. The advantage is you can have much more space to show information (which is good if you have a lot), and it's always in the same position, so the user is never lost.
-
The other option is when a marker is clicked, you create a "Popup"
<gmaps-popup>
at that location and you can put anything you want in there. The first issue is that if the popup is too big it doesn't look good. The other issue is if someone clicks on a marker near the edge of the map, you will need to do something different because the popup may not be completely visible.
If you have another idea you'd like to share, or a specific question about this, I'm happy to try and help.
from x5-gmaps.
Finally I did it here is the code may be will help someone
<template>
<div style="height: 70vh">
<gmaps-map :options="mapOptions">
<gmaps-info-window v-for="marker in markers" :key="marker.id" :options="marker">
<div class="text-center">
<img :src="marker.user.avatar" alt="" width="48" class="img-thumbnail rounded-circle">
<p class="m-0">{{ marker.user.name }}</p>
<a :href="marker.user.public_path">See profile</a>
</div>
</gmaps-info-window>
</gmaps-map>
</div>
</template>
from x5-gmaps.
@kossa just note that the InfoWindow is actually a Google Maps component in a Vue wrapper. The issue with the InfoWindow is that close button. The only way to hide it is with a CSS hack which is pretty messy, so that's why I made the <gmaps-popup>
component (which doesn't have the close button).
Yours looks good, and if you're happy, so am I; but if you want to remove the close button, use <gmaps-popup>
instead 😉
from x5-gmaps.
from x5-gmaps.
Related Issues (20)
- Detect marker dragend HOT 2
- Getting Cannot read properties of undefined (reading 'toSpan') error HOT 8
- Loading Google Maps JavaScript API needs a callback HOT 6
- Module parse failed: Unexpected token (24:32) HOT 6
- Change pin colors HOT 3
- As of February 21st, 2024, google.maps.Marker is deprecated HOT 1
- How can draw in map HOT 3
- How to remove Google's places from map HOT 4
- Cluster markers HOT 7
- Info Window for Marker HOT 3
- Can't use MarkerLabel interface on Cluster Markers HOT 1
- Add support for idle event on Maps component HOT 1
- Incorrect type for Marker.label
- Cluster component does not bind the `options` prop on Marker component HOT 1
- Cluster not zooming in on click when fully zoomed out
- Fix cluster thrashing while dragging map HOT 5
- Modal problem in HOT 1
- [Question] Abbreviate cardinal direction for autocomplete service HOT 2
- How to change Marker origin HOT 2
- Using Marker Cluster with popup HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x5-gmaps.