<!DOCTYPE html> <html lang="pl" style="height: 100%;"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta http-equiv="x-ua-compatible" content="IE=11"/> <title>Geowidget v4 - Example - MultiMaps</title> <script src="../js/sdk-for-javascript.js"></script> <script type="text/javascript"> window.easyPackAsyncInit = function () { var button1 = document.getElementById('button1'); var button2 = document.getElementById('button2'); var currentMap = ''; function isNeedMapRender(name, index) { if (currentMap !== index) { currentMap = index; with (document.getElementById(name)){ while (childNodes.length>0) { removeChild(childNodes[0]) } } return true; } else { return false; } } button1.onclick = function() { if (isNeedMapRender('easypack-map', 'button1')) { easyPack.init({ defaultLocale: 'pl', mapType: 'osm', searchType: 'osm', points: { types: ['parcel_locker'] }, map: { initialTypes: ['parcel_locker'] } }); var map = easyPack.mapWidget('easypack-map', function(point) { console.log(point); }); } } button2.onclick = function() { if (isNeedMapRender('easypack-map', 'button2')) { easyPack.init({ defaultLocale: 'pl', mapType: 'osm', searchType: 'osm', points: { types: ['pop'] }, map: { initialTypes: ['pop'] } }); var map = easyPack.mapWidget('easypack-map', function(point) { console.log(point); }); } } } </script> <link rel="stylesheet" href="../css/easypack.css"/> </head> <body> <button id="button1">Show Map with Parcel Lockers</button> <button id="button2">Show Map with POP</button> <div id="easypack-map"></div> </body> </html>