Map embeds not working

Hi All.

We have been using the embed functionality for maps and graphs for several years now and it has been working brilliantly. However, we recently updated our instance to version 2.40.3 and have experienced issues with the map embeds. The graphs continue to work well, but the maps’ architecture seems to have changed, changing the map embed process.

Is there any updated documentation or any new guidelines for embedding maps onto external websites that we could look at? I have checked the documentation but couldn’t find anything. Alternatively, if there isn’t something available, does anyone have any advice or guidelines for us to follow?

Any guidance would be appreciated.

Thanks!

1 Like

Hi @Terence_Scott

I will reshare this but it would have a great help if you included more technical details such as errors, screenshots, and how the embeds are being implemented. Even a “working example” and not “working example” could be helpful.

Thanks!

1 Like

Hi @Gassim

Apologies for the delay.

Previously, we had been using something along the lines of the following for the map embeds:

<div class="dhis2-chart" data-chart-id="{{ id }}" id="{{ id }}"></div>

<script>
    chartPlugin.url = base;
    chartPlugin.username = username;
    chartPlugin.password = password;
    chartPlugin.loadingIndicator = loading;

    chartPlugin.load([{
        "id": "{{ id }}",
        "el": "{{ id }}",
        "url": base
    }]);
</script>

The name of the plugin varies by item type, so for maps we use mapPlugin.

This is roughly following the guide someone uploaded to the community https://community.dhis2.org/uploads/short-url/tqT7wJwPprGkIuTIOrukNFhKEVO.pdf

However, with recent versions these plugins don’t seem to be accessible in the bundled JS source so we’re stuck using ones from older DHIS2 version.

I am not sure if that is enough to work with, but hope that it can help to clarify our issue.

Thanks!

1 Like

Hi @Terence_Scott

I’m looking into the idea you are sharing and it looks like something that is ages ago compared to the newest features. Have you looked into web portals through the API? DHIS2 as a platform - DHIS2 Documentation