v1.4
Allows user to pick Bliska Paczka point of service on interactive map with several extra features.
See demo page.
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="http://widget.bliskapaczka.pl/v1.4/main.js"></script>
<link rel="stylesheet" href="http://widget.bliskapaczka.pl/v1.4/main.css" />
Bliska Paczka Widget will be available through global variable BPWidget
.
BPWidget
object exposes one method:
init(element: HTMLElement, options?: BPWidgetOptionsObject): void
Widget will be displayed in given html element. Element has to have width
and height
defined.
Widget options are optional.
<div id="bpWidget" style="height: 800px; width: 1024px;"></div>
BPWidget.init(
document.getElementById('bpWidget'),
{
callback: function(posCode, posOperator) {
console.log('BPWidget callback:', posCode, posOperator)
},
posType: 'DELIVERY'
}
);
(string
) [optional]
Filter displayed points by scope.
Options: 'DELIVERY'
, 'POSTING'
.
(function(string, string): void
) [optional]
Callback function executed when user pick point on the widget. It is invoked with point code and point operator as arguments.
(string
) [optional]
Operator that will be available as the only one. Cannot be used with disabledOperators
option.
Options: 'RUCH'
, 'INPOST'
, 'POCZTA'
.
(string[]
) [optional]
Operators that will be disabled. Cannot be used with selectedOperator
option.
Options: 'RUCH'
, 'INPOST'
, 'POCZTA'
.
(string
) [optional]
User address that will be available for search with special button.
(map<string, number>
) [optional]
Prices that will be shown to user for given Operator string.
Options: 'RUCH'
, 'INPOST'
, 'POCZTA'
.
Example: {"RUCH": 10.55, "INPOST": 5.55, "POCZTA": 4.44}
(string
) [optional]
Google Maps API key that wil be used for displaying the map widget.
(map<string, boolean>
) [optional]
Modules that will be enabled/disabled in widget.
All enabled by default.
Options: 'search'
, 'list'
, 'filters'
.
Example: {"search": true, "list": false, "filters": true}
(HTMLInputElement
) [optional]
External input element that will be used as map search.
(function(): void
) [optional]
Callback function executed when map loading is finished.
(google.maps.MapOptions
) [optional]
Google map options.
See google reference for details.
In order to automatically follow minor releases use chosen major version in resource url, e.g.
<script type="text/javascript" src="http://widget.bliskapaczka.pl/v1/main.js"></script>
<link rel="stylesheet" href="http://widget.bliskapaczka.pl/v1/main.css" />
Bliska Paczka Widget changes its look depending of given width.
Breakpoints: 992px, 768px, 576px.
See our demo for details.