Bliska Paczka Widget

v5.15

Allows user to pick Bliska Paczka point of service on interactive map with several extra features.

See demo page.

Migration from version v4

Migration from version v3

See options for more details.

Migration from version v2

See options for more details.

Installation

In order to install Bliska Paczka Widget on your web page include following code snippets in head section of your html document:

Script:

<script type="text/javascript" src="https://widget.bliskapaczka.pl/v5.15/main.js"></script>

Stylesheet:

<link rel="stylesheet" href="https://widget.bliskapaczka.pl/v5.15/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.

Example of usage

<div id="bpWidget" style="height: 800px; width: 1024px;"></div>
BPWidget.init(
    document.getElementById('bpWidget'),
    {
        googleMapApiKey: 'AIzaSyCUyydNCGhxGi5GIt5z5I-X6hofzptsRjE',
        callback: function(point) {
            console.log('point code:', point,code);
            console.log('point operator:', point.operator);
        },
        posType: 'DELIVERY',
        codOnly: false
    }
);

Responsive behavior

Bliska Paczka Widget changes its look depending of given width. Breakpoints: 992px, 768px, 576px.

See our demo for details.

Options

googleMapApiKey

(string) [required]

Google Maps API key that will be used for displaying the map widget.

Example: AIzaSyCUyydNCGhxGi5GIt5z5I-X6hofzptsRjE

Be careful! Example google map key is provided for testing purposes only.


operators

({operator: string, price?: number}[]) [optional]

Indicates operators that will be available on widget. 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:

Option operators as value takes array of objects with following properties:

Example: [{operator: "RUCH", price: 5}, {operator: "INPOST", price: 5}].


posType

(string) [optional]

Filter displayed points by scope.

Options: 'DELIVERY', 'POSTING'.


codOnly

(boolean) [optional]

Show only points with cash on delivery available.


showCod

(boolean) [optional]

Show cash on delivery filter in the widget header. If codOnly is true the checkbox is disabled.


callback

(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"
        }
    }
}

selectedPos

({code: string, operator: string}) [optional]

Point that will be selected on map initialization.

Example: {"code": "123-456", "operator": "RUCH"}.


initialAddress

(string) [optional]

Address that will be visible on map by default. This option is ignored when selectedPos option is present.


userDataQuery

(string) [optional]

User address that will be available for search with special button.


externalSearch

(HTMLInputElement) [optional]

External input element that will be used as map search.


readyCallback

(function(): void) [optional]

Callback function executed when map loading is finished.


mapOptions

(google.maps.MapOptions) [optional]

Google map options. See google reference for details.


testMode

(boolean) [optional]

Change point source to sandbox-bliskapaczka.pl environment. Default: false

betaRendering

(boolean) [optional]

Starts Google Maps with new beta renderer Default: false

mapOnly

(boolean) [optional]

Allows to show map without search or filters. Default: false

Versioning

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" />

Releases