To use the new version of the geowidget, add the following lines to the page headers.
<link rel="stylesheet" href="https://sandbox-global-geowidget-sdk.easypack24.net/inpost-geowidget.css"/>
<script src='https://sandbox-global-geowidget-sdk.easypack24.net/inpost-geowidget.js' defer></script>
<script>
function afterPointSelected(point) { alert('Selected point: ' + point.name); }
</script>
And then embed the custom element in the selected place
<inpost-geowidget token='token-for-geo' country='GB,PL' language='pl' config='parcelcollect'></inpost-geowidget>
The parameters are described here
The ‘country’ parameter takes the possible values given after the decimal point: BE,GB,ES,FR,IT,LU,NL,PL,PT.
The first value of the country code indicates the default location of the map when geolocation functionality is disabled on the device.
To use the new version of the geowidget, add the following lines to the page headers.
<link rel="stylesheet" href="https://sandbox-global-geowidget-sdk.easypack24.net/inpost-geowidget.css"/>
<script src='https://sandbox-global-geowidget-sdk.easypack24.net/inpost-geowidget.js' defer></script>
<script>
document.addEventListener('onpointselect', (event) => alert(event.details.name));
</script>
And then embed the custom element in the selected place
<inpost-geowidget onpoint="onpointselect" token='token-for-geo' language='pl' config='parcelcollect'></inpost-geowidget>
The parameters are described here
# | Opis | config value | Points type | Statuses | functions | payment_available | location_247 | Partner id | Filters for type |
---|---|---|---|---|---|---|---|---|---|
1 | Showing pickup points for pre-paid orders | config='parcelCollect' | parcel_locker | Operating, NonOperating, Overloaded | parcel_collect | false | false | x | All: parcel_locker Parcel lockers: parcel_locker_only Parcel point: parcel_locker_superpop |
2 | Presentation of collection points for pick-up orders | config='parcelCollectPayment' | parcel_locker | Operating, NonOperating, Overloaded | parcel_collect | true | X | x | All: parcel_locker Parcel lockers: parcel_locker_only Parcel point: parcel_locker_superpop |
3 | Presentation of collection points for PWW orders | config='parcelCollect247' | parcel_locker | Operating, NonOperating, Overloaded | parcel_collect | X | true | x | All: parcel_locker Parcel lockers: parcel_locker_only Parcel point: parcel_locker_superpop |
4 | Presentation of senders points | config='parcelSend' | parcel_locker, pop | Operating, Overloaded | parcel_send | X | X | x | All: parcel_locker, pop Parcel lockers: parcel_locker_only Parcel point: pop, parcel_locker_superpop |
5 | Presentation of InPost pickup points for pre-paid orders | config='parcelCollectInPost' | parcel_locker | Operating, NonOperating, Overloaded | parcel_collect | X | X | 0,33,61 | All: parcel_locker Parcel lockers: parcel_locker_only Parcel point: pop, parcel_locker_superpop |
6 | Presentation of InPost collection points for cash on delivery orders | config='parcelCollectPaymentInPost' | parcel_locker | Operating, NonOperating, Overloaded | parcel_collect | X | X | 0,33,61 | All: parcel_locker Parcel lockers: parcel_locker_only Parcel point: pop, parcel_locker_superpop |
7 | Presentation of APMX (Fridge modules) | config='cooledDeposit' | parcel_locker | Operating, NonOperating, Overloaded | cool_parcel_collect | X | X | X | All: parcel_locker Parcel lockers: parcel_locker_only Parcel point: pop, parcel_locker_superpop |
Example how to call api method:
<inpost-geowidget id="geowidget" onpoint="handlePointSelection" token='myTokenHere' language='pl' config='parcelCollect'></inpost-geowidget>
<script>
const geowidget = document.getElementById('geowidget');
// Listener to Geowidget init event
geowidget.addEventListener('inpost.geowidget.init', (event) => {
// Reference to api object
const api = event.detail.api;
// Call api method. Check ApiInterface for more details.
api.changePosition({ longitude: 20.318968, latitude: 49.731131 }, 16);
});
</script>
All API method are described here
Generated using TypeDoc