Search code examples
typo3typo3-6.2.xtypo3-extensions

TYPO3 WEC_Map Extension <script> Tag not inserted in HTML


I’m using Typo3 (Version 6.2.14) and upgraded WEC_Map to version 3.1.3 because I saw a warning on my map which says that I need to use an API key for Google Maps.

So I’ve generated an API key for "Maps Static API" and inserted it in WEC Map Admin. (I’ve used the same key for Browser API Key and Server API Key. Only difference is that I’ve added the secret for the Browser API Key separated by a comma.)

If I’ve visit my FE User Map in the backend the map is showing. In the frontend instead I get the following error: " There doesn't seem to be anything to display. Make sure the map is configured correctly and there are users or markers set".

Inspecting the source code I saw that the script tag to maps.googleapis.com is not generated. It looks like this is causing the issue, but I don't know why it is happening.

I hope that someone using a similar setup can point me into the right direction.

Thank you guys. (It would be nice if someone could add the Tag for WEC_Map)


Solution

  • Ok I resolved this. The problem was that I was using the userGroups setting to filter the map markers by multiple user groups.

    plugin.tx_wecmap_pi2 {
        height = 500
        width = 500
        showDirections = 1
        prefillAddress = 0
        initialMapType = G_HYBRID_MAP
        controls.mapControlSize = large
        controls.showOverviewMap = 1
        controls.showMapType = 1
        controls.showScale = 1
        userGroups = 2,3,5
        pid = 2,3,5 # <-- This uses a AND condition
    }
    

    Since this setting is using an AND condition under the hood I received the error "There doesn't seem to be anything to display. Make sure the map is configured correctly and there are users or markers set"

    In fact I opened a feature request for this 3 years ago. Unfortunately the feature request never made it into the plugin. But Jan Bartels posted a workaround as reply to the feature request. This workaround got lost while updating the extension.

    Also recomment to the extension authors to make it more clear in their documentation that the property userGroups uses a AND condition.