Multiple locations on WIX Googlemaps

Hi All

I’m aware of this thread and I have already set it up (it works great)

I know I can add a location to the WIX Google map by using the following (already works for me)$w.GoogleMap.html

$w("#myGoogleMap").location = {
                                "latitude": 37.77065,
                                "longitude": -122.387301,
                                "description":"Wix Office"

I have now also noticed I can add multiple locations to the WIX google map. A couple of things:

  1. Can this (multiple) be done by code?
  2. Also, as I can change the Icon now, can this be done by code?
  3. Is there an onClick for the WIX google maps icons? Similar to the google version:
marker.addListener('click', function() {

Many thanks for any help!

1 Like

Have you seen the example for this?

Hi @givemeawhisky Many thanks for the message. The link is for a very similar thread as the one I pinned.

It works great for me and I’ve done exactly what I need for it. However there are two things I’m hoping to achieve;

  1. I’m wanting the HMTL box to stretch full screen and the WIX google map allows this but the HTML frame doesn’t (unless you know of a workaround for it)

  2. The WIX google map doesn’t cost me through my google API to generate the map. I was hoping they had linked it all together.

If you have anymore links I’ve missed, please send them across! Many thanks

For the fullscreen option, you can look at using the html component and the allowFullScreen function and see if it works for your needs here.$w.HtmlComponent.html#allowFullScreen

There are previous posts about this too.

Also, what do you mean with the ‘doesn’t cost me’ part?

The example is using a Google Map API key that belongs to Wix, you need to add your own key here for it to work.

Replace the string GOOGLE_MAP_API_KEY in the HtmlComponent code with your own API key. See the forum post Secure a Google Maps API key in an HtmlComponent for details on how to protect your API key.

I probably worded that slightly wrongly, I meant the element WIX google maps can be stretched full width. Not full screen.

If I set the location to a WIX google map using the WIX API code I mentioned in my first post, I don’t need a google API key.

If I can set multiple markers to a WIX google map, then I wouldn’t need the google API key and HTML element (which (if you hit the limit) would start costing per map generation).

I was just looking for alternatives. Granted, you have to use the Google API key a lot to start getting charged, but I was just planning ahead.

being able to display multiple locations by code on the same map would be a great add!! Please wix