v6.4
Allows user to pick Bliska Paczka point of service on interactive map with several extra features.
See demo page.
DPD
is available now by default. You can adjust operators display with operators
option.See options for more details.
Option googleMapApiKey
is now mandatory. For testing purposes you can use example key.
Options selectedOperator
, disabledOperators
, and prices
were replaced with universal operators
option.
See options for more details.
In order to install Bliska Paczka Widget on your web page include following code snippets in head
section of your html document:
<script type="text/javascript" src="https://widget.bliskapaczka.pl/v6.4/main.js"></script>
<link rel="stylesheet" href="https://widget.bliskapaczka.pl/v6.4/main.css" />
Bliska Paczka Widget will be available through object assigned to global variable BPWidget
.
To initialize widget use method:
BPWidget::init(element: HTMLElement, options: BPWidgetOptionsObject): void
Widget will be displayed in given html element. Element has to have width
and height
defined and should be displayed on page when map is initialized.
<div id="bpWidget" style="height: 800px; width: 1024px;"></div>
BPWidget.init(
document.getElementById('bpWidget'),
{
callback: function(point) {
console.log('point code:', point,code);
console.log('point operator:', point.operator);
},
posType: 'DELIVERY',
codOnly: false
}
);
Bliska Paczka Widget changes its look depending of given width. Breakpoints: 992px, 768px, 576px.
See our demo for details.
({operator: string, price?: number, checked?: boolean}[]
) [optional]
Indicates operators that will be available on widget, by setting 'checked' option you can select which one are 'activated'. Also provides interface for displaying shipment prices for each operator. By default all operators fully supported in this version of widget are available with no prices displayed. You can use this property to display prices, limit end user operator selection options or add operators not supported by default in this widget version.
Names and code names of operators fully supported in this widget version:
'RUCH'
'INPOST'
'POCZTA'
'DPD'
'UPS'
'FEDEX'
Option operators
as value takes array of objects with following properties:
Example: [{operator: "RUCH", price: 5}, {operator: "INPOST", price: 5}]
.
({brand: string, price?: number}[]
) [optional]
Indicates brands that will be available on widget, by setting 'checked' option you can select which one are 'activated'. Also provides interface for displaying shipment prices for each brand. By default all brands fully supported in this version of widget are available with no prices displayed. You can use this property to display prices, limit end user brand selection options or add brands not supported by default in this widget version.
Names and code names of operators fully supported in this widget version:
'RUCH'
'INPOST'
'ZABKA'
'FRESH_MARKET'
'POCZTA_POLSKA'
'ORLEN'
'DPD'
'UPS'
'KOLPORTER'
'DHL'
Option brands
as value takes array of objects with following properties:
Example: [{brand: "RUCH", price: 5}, {brand: "INPOST", price: 5}]
.
(string
) [optional]
Filter displayed points by scope.
Options: 'DELIVERY'
, 'POSTING'
.
(boolean
) [optional]
Show only points with cash on delivery available.
(boolean
) [optional]
Show cash on delivery filter in the widget header. If codOnly
is true the checkbox is disabled.
(function(pos): void
) [optional]
Callback function executed when user pick point on the widget. It is invoked with point object as argument.
Example callback argument:
{
"code": "AB-234-567",
"operator": "POCZTA",
"brand":"ORLEN",
"description": "Stacja benzynowa",
"street": "Testowa 2",
"postalCode": "12-345",
"city": "Testowe",
"province": "Test",
"latitude": "51.08464"
"longitude": "17.02478",
"cod":false
"openingHoursMap": {
"WEDNESDAY": {
"from": "09:00",
"to": "12:00"
},
"MONDAY": {
"from": "09:00",
"to": "12:00"
},
"THURSDAY": {
"from": "09:00",
"to": "12:00"},
"SUNDAY": {
"from": "02:00",
"to": "02:22"
},
"FRIDAY": {
"from": "09:00",
"to": "12:00"
},
"TUESDAY": {
"from": "09:00",
"to": "12:00"
}
}
}
({code: string, operator: string}
) [optional]
Point that will be selected on map initialization.
Example: {"code": "123-456", "operator": "RUCH"}
.
(string
) [optional]
Address that will be visible on map by default.
This option is ignored when selectedPos
option is present.
(function(): void
) [optional]
Callback function executed when map loading is finished.
({center: { lat: number, lng: number}, zoom: number, gestureHandling: boolean}
) [optional]
Open street maps map options.
Example: center: { lat: 52.226376, lng: 21.009979 }, zoom: 6, gestureHandling: true
.
(boolean
) [optional]
Change point source to sandbox-bliskapaczka.pl environment.
Default: false
(boolean
) [optional]
Allows to show map without search or filters.
Default: false
In order to automatically follow minor releases use chosen major version in resource url, e.g.
<script type="text/javascript" src="https://widget.bliskapaczka.pl/v3/main.js"></script>
<link rel="stylesheet" href="https://widget.bliskapaczka.pl/v3/main.css" />