
#Smart click map overlay code
This code works with default markers but custom ones seems not to refresh, it's maybe because I'm using Nuxt. Hello! I'm using custom markers and I'm trying to refresh the position every X seconds, currently I've faked it with a timeOut like this: this can optimize render time, but can break layout Top, bottom, left, right, center, topleft lefttop, topright, righttop, bottomleft, leftbottom, bottomright, rightbottom bottomright - the marker will be below and on the right of the location.

The alignment of the marker element relative to the location it is displayed. Postive values move the marker to down the page. The number of pixels to move the marker by in the y-direction. Postive values move the marker to the right The number of pixels to move the marker by in the x-direction. Provide an Object with lat and lng properties. Provide the latitude and longitude values that the marker should be displayed at. Import the component and use it in the components object.Īll markers into the cluster tag will be managed as a cluster automatically. Npm i vue2-gmap-custom-marker Basic Usage Specific markers offset X and Y for more control about html element displayĪlmost all API of the component is optional, just start with lon, lat property Simple positionning system for marker around the origin point Google map clustering support (see demo for exemple) Live property change allows simple interaction with coordonates and zindex of html marker element Featuresĭisplay reactive custom html into markers on google map using slot system You might look at this demo code repository for features usage and complete exemple around this plugin. In case you have troubles with this, just create the same folder with the images from the link above in public foler of your vue project (or served in /images/m1.png for exemples depending on you webserver configuration.) Demo For this plugin website demo, I had to create this folder that contains clusters images the clusters uses in vue-gmap. You might force the 5.6.2 version in your package.json for this plugin to keep compatibility until you want to switch to gmap-vue.įor those that use clusters with this plugin, the new release might break things. read this for more information about this.įor legacy projects using vue-google-maps, you have to stick to this projects tag 5.6.2. The demo for this project started using this project on. Now this project seems no more maintained and a maintained fork has started, As this is a fork, this plugin should work on it seeminglessly. This project is originally a plugin for vue-google-maps. This component is an adaptation of the Google Map V3 overlay code sample with some great ideas from angularjs google map from this component.

Click here for CSS examples.This component allows you to display custom HTML content on the map using Overlay. For example, you can change the opacity of the overlay.

You can customize the embed overlay using custom CSS. When opening the map directly in a browser or sharing the map URL, there is no use for the overlay and it is not displayed. Note that the overlay is only displayed when the map is embedded on a website. To disable the overlay: go to the editor and click on Embed > Embed Overlay. By default, the embed overlay is enabled. You can choose if you want to enable or disable the embed overlay. After a few seconds of inactivity, the overlay automatically reappears. A mouse click on the map overlay (or touch on mobile) will remove the overlay and make the map interactive. With this feature, you can choose to display a transparent overlay on the map. To avoid those issues, Mapme created a smart overlay feature. This can happen more frequently when the map uses a large portion of the web page real-estate.

On touch screens such as mobile phones, users can sometimes end up moving the map instead of moving up and down the page. const overlayProjection this.getProjection() // Retrieve the south-west and north-east coordinates of this overlay // in LatLngs and convert them to pixel coordinates. When an interactive map is embedded in a website, visitors using their mouse wheel can sometimes end up zooming the map instead of scrolling the page.
