Instructions for uploading DHL maps on a website

'In order to embed the map, you must enclose it as iframe on the website:

<iframe src="https://parcelshop.dhl.pl/mapa"></iframe>

In order to embed a country map with foreign ParcelShops or PackStations, you must enclose it as iframe on the website:

<iframe src="https://parcelshop.dhl.pl/mapa?country=DE&ptype=packStation"></iframe>

where:
country = country symbol, e.g. DE, BE, AT...
ptype = parcelshop or packstation (default parcelshop)

In order to capture the selection of the corresponding service point form the map, calling the function window.postMessage must be supported on the website. Below is an example of JavaScript code to process such an event:

<script type="text/javascript" nonce="GZvTGEgQDqha2sdJ9hLz4wLn">
    /*<![CDATA[*/
    function listenMessage(msg) {
 
        if(jQuery.type(msg.data)=='object'){
            var point = msg.data;
        }else{
            var point = JSON.parse(msg.data);
        }
 
        alert(point.sap);
    }
    if (window.addEventListener) {
        window.addEventListener("message", listenMessage, false);
    } else {
        window.attachEvent("onmessage", listenMessage);
    }
    /*]]>*/
</script>

In the above code, change the content of the listenMessage function so that the service point selection is properly handled on the website. The data about the service point is transmitted in the msg.data variable. It is a text in JSON format which, when c

  • sap – sap no,
  • name – product name,
  • zip – postal code,
  • city – city,
  • This mechanism is supported by the following browsers: IE8+, FF3.0+, CHROME 1.0+, OPERA 9.5+