Hi All
I’m aware of this thread and I have already set it up (it works great) https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-using-the-places-api-from-google-maps-services
I know I can add a location to the WIX Google map by using the following (already works for me)
https://www.wix.com/corvid/reference/$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:
- Can this (multiple) be done by code?
- Also, as I can change the Icon now, can this be done by code?
- Is there an onClick for the WIX google maps icons? Similar to the google version:
marker.addListener('click', function() {
map.setZoom(8);
map.setCenter(marker.getPosition());
});
Many thanks for any help!
1 Like
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;
-
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)
-
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
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