Forum

Thread tagged as: Problem, Events

Google maps problem with content custom

Hi!

I have maps in events. Then I try to show multiple event details on frontpage with events_custom and with specific template.

It's called three times:

                    <?php       
                        perch_events_custom(array(                                          
                            'filter'=>'eventDateTime',
                            'match'=>'gte',
                            'value'=>date('Y-m-d'),
                            'sort'=>'eventDateTime',
                            'sort-order'=>'desc',
                            'count'=> 3,
                            'template'=>'front_page_3.html'
                        ));
                    ?>

In the template I have:

<div class="front_map"><perch:events id="place_map" type="map" label="Address" zoom="15" /></div>

... for some reason I get in the console:

Failed to load resource: the server responded with a status of 403 (Forbidden)

Any ideas how to fix this? I have regular javascript API enabled from google and the map works fine in the event page. I tried republishing, but didn't help.

Thanks!

Karri Karttunen

Karri Karttunen 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you sure your Google Maps API key is correctly configured at the Google end of things?

Hi, Drew.

Pretty sure. It just uses the javascript api, right?

That's logging all the back end stuff as well as visits on individual events pages. So the maps show correctly. I'm not sure if there's some sort of limitation on how many maps can one page show. There's three now, but I don't think this is the case.

Drew McLellan

Drew McLellan 2638 points
Perch Support

It uses the JavaScript API and the Static Maps API.

Yep, they are on.

Strange thing is that it doesn't show the "oops"-layer on top. The map is grey, but you can see the marker: https://www.puritas.fi/

Drew McLellan

Drew McLellan 2638 points
Perch Support

What do you mean by "oops" layer? The maps look fine to me.

I mean normally when the api is not on, Google puts on top of the map something like "Ooops, the map cannot be shown... etc.".

But you can actually see the three little maps on the front page? That's very bizarre. I tried also with my cell from different ip and didn't see them. Nor can I see them on IE, FF or Chrome.

Just the map box, with the red map pointer, but no map. When I zoom in / out of the map then it shows.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Hello, again.

It was about CSS. This is what I had:

.front_map .cmsmap{
width: 100%;
height: 0;
padding-bottom: 100%;
border-radius: 200px;
}

Changed it to a bit more conservative:

.front_map .cmsmap{
width: 100%;
height: 300px;
border-radius: 200px;
}

Still in Chrome for some reason the border-radius doesn't work any more. I did this a couple of years ago and then everything was fine.

Thanks for the assist!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok - I'm not sure we can help with that issue.