@oiz/stzh-components 4.5.0 → 4.6.0-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-64d91100.js → app-globals-7501aa08.js} +2 -2
- package/dist/cjs/{app-globals-64d91100.js.map → app-globals-7501aa08.js.map} +1 -1
- package/dist/cjs/index-870b4dee.js +6 -2
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/stzh-accordion_3.cjs.entry.js +3 -3
- package/dist/cjs/stzh-actions_6.cjs.entry.js +9 -9
- package/dist/cjs/stzh-actionset.cjs.entry.js +5 -5
- package/dist/cjs/stzh-amount.cjs.entry.js +1 -1
- package/dist/cjs/stzh-anchornav.cjs.entry.js +1 -1
- package/dist/cjs/stzh-app-nav.cjs.entry.js +1 -1
- package/dist/cjs/stzh-appointments.cjs.entry.js +1 -1
- package/dist/cjs/stzh-audio.cjs.entry.js +3 -3
- package/dist/cjs/stzh-badge_3.cjs.entry.js +3 -3
- package/dist/cjs/stzh-breadcrumb_2.cjs.entry.js +2 -2
- package/dist/cjs/stzh-buttongroup.cjs.entry.js +1 -1
- package/dist/cjs/stzh-card-navigation.cjs.entry.js +1 -1
- package/dist/cjs/stzh-card-searchresult.cjs.entry.js +1 -1
- package/dist/cjs/stzh-card.cjs.entry.js +4 -4
- package/dist/cjs/stzh-cardlist_3.cjs.entry.js +3 -3
- package/dist/cjs/stzh-carousel.cjs.entry.js +2 -2
- package/dist/cjs/stzh-chart.cjs.entry.js +1 -1
- package/dist/cjs/stzh-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/stzh-checkboxgroup.cjs.entry.js +3 -3
- package/dist/cjs/stzh-chip.cjs.entry.js +1 -1
- package/dist/cjs/stzh-chipgroup.cjs.entry.js +1 -1
- package/dist/cjs/stzh-chipselect.cjs.entry.js +4 -4
- package/dist/cjs/stzh-clamp.cjs.entry.js +2 -2
- package/dist/cjs/stzh-company-logo.cjs.entry.js +1 -1
- package/dist/cjs/stzh-components.cjs.js +2 -2
- package/dist/cjs/stzh-contact-cv.cjs.entry.js +1 -1
- package/dist/cjs/stzh-contact.cjs.entry.js +4 -3
- package/dist/cjs/stzh-contact.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-content.cjs.entry.js +1 -1
- package/dist/cjs/stzh-cta.cjs.entry.js +1 -1
- package/dist/cjs/stzh-datalist_3.cjs.entry.js +3 -3
- package/dist/cjs/stzh-datamessagelist-item.cjs.entry.js +1 -1
- package/dist/cjs/stzh-datamessagelist.cjs.entry.js +1 -1
- package/dist/cjs/stzh-datepicker_3.cjs.entry.js +10 -10
- package/dist/cjs/stzh-datepicker_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-daterange.cjs.entry.js +1 -1
- package/dist/cjs/stzh-details.cjs.entry.js +1 -1
- package/dist/cjs/stzh-dialog.cjs.entry.js +5 -5
- package/dist/cjs/stzh-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-disturber.cjs.entry.js +1 -1
- package/dist/cjs/stzh-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/stzh-editor.cjs.entry.js +1 -1
- package/dist/cjs/stzh-eventdata.cjs.entry.js +1 -1
- package/dist/cjs/stzh-eventinfo.cjs.entry.js +1 -1
- package/dist/cjs/stzh-feedreader-item.cjs.entry.js +1 -1
- package/dist/cjs/stzh-feedreader.cjs.entry.js +1 -1
- package/dist/cjs/stzh-figure.cjs.entry.js +1 -1
- package/dist/cjs/stzh-flyingfocus.cjs.entry.js +1 -1
- package/dist/cjs/stzh-footer.cjs.entry.js +1 -1
- package/dist/cjs/stzh-gallery.cjs.entry.js +1 -1
- package/dist/cjs/stzh-geo-ref-data.cjs.entry.js +3 -3
- package/dist/cjs/stzh-ghettobox_3.cjs.entry.js +4 -4
- package/dist/cjs/stzh-header_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-heading.cjs.entry.js +1 -1
- package/dist/cjs/stzh-homepage-search.cjs.entry.js +1 -1
- package/dist/cjs/stzh-homepage-service-highlights.cjs.entry.js +2 -2
- package/dist/cjs/stzh-hr.cjs.entry.js +1 -1
- package/dist/cjs/stzh-hspace.cjs.entry.js +2 -2
- package/dist/cjs/stzh-http-error.cjs.entry.js +1 -1
- package/dist/cjs/stzh-iframe.cjs.entry.js +4 -4
- package/dist/cjs/stzh-imagecomparison.cjs.entry.js +2 -2
- package/dist/cjs/stzh-input.cjs.entry.js +5 -5
- package/dist/cjs/stzh-invert.cjs.entry.js +1 -1
- package/dist/cjs/stzh-link.cjs.entry.js +1 -1
- package/dist/cjs/stzh-linklist.cjs.entry.js +5 -1
- package/dist/cjs/stzh-linklist.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-list_2.cjs.entry.js +2 -2
- package/dist/cjs/stzh-loader_2.cjs.entry.js +5 -5
- package/dist/cjs/stzh-loader_2.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-loadingbar.cjs.entry.js +1 -1
- package/dist/cjs/stzh-menu_2.cjs.entry.js +2 -2
- package/dist/cjs/stzh-message.cjs.entry.js +2 -2
- package/dist/cjs/stzh-microsite-teaserlist.cjs.entry.js +1 -1
- package/dist/cjs/stzh-monthyearpicker.cjs.entry.js +1 -1
- package/dist/cjs/stzh-offline-indicator.cjs.entry.js +1 -1
- package/dist/cjs/stzh-page-skiplinks.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pagebottom.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pagecontent.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pagetitle-hero.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pagetitle-home.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pagetitle.cjs.entry.js +1 -1
- package/dist/cjs/stzh-panorama.cjs.entry.js +2 -2
- package/dist/cjs/stzh-pi-content-navigation.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-menu.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-pagetitle.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-pagetitle.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-pi-quote.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-teaser-layout-item.cjs.entry.js +68 -0
- package/dist/cjs/stzh-pi-teaser-layout-item.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-pi-teaser-layout.cjs.entry.js +43 -16
- package/dist/cjs/stzh-pi-teaser-layout.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-pi-teaser.cjs.entry.js +9 -25
- package/dist/cjs/stzh-pi-teaser.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-poicard.cjs.entry.js +1 -1
- package/dist/cjs/stzh-poilist.cjs.entry.js +1 -1
- package/dist/cjs/stzh-popover.cjs.entry.js +1 -1
- package/dist/cjs/stzh-print_2.cjs.entry.js +2 -2
- package/dist/cjs/stzh-quote.cjs.entry.js +1 -1
- package/dist/cjs/stzh-ratio.cjs.entry.js +1 -1
- package/dist/cjs/stzh-readspeaker.cjs.entry.js +2 -2
- package/dist/cjs/stzh-saptcha.cjs.entry.js +2 -2
- package/dist/cjs/stzh-scrollup.cjs.entry.js +1 -1
- package/dist/cjs/stzh-search.cjs.entry.js +2 -2
- package/dist/cjs/stzh-section.cjs.entry.js +2 -2
- package/dist/cjs/stzh-sitemap.cjs.entry.js +1 -1
- package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js +1 -1
- package/dist/cjs/stzh-skin-storybook-preview.cjs.entry.js +1 -1
- package/dist/cjs/stzh-skiplink.cjs.entry.js +1 -1
- package/dist/cjs/stzh-socialmediastream-item.cjs.entry.js +1 -1
- package/dist/cjs/stzh-socialmediastream.cjs.entry.js +1 -1
- package/dist/cjs/stzh-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/stzh-stepper.cjs.entry.js +3 -3
- package/dist/cjs/stzh-sticky-actions.cjs.entry.js +1 -1
- package/dist/cjs/stzh-sticky.cjs.entry.js +1 -1
- package/dist/cjs/stzh-table.cjs.entry.js +1 -1
- package/dist/cjs/stzh-text.cjs.entry.js +2 -2
- package/dist/cjs/stzh-textandimage.cjs.entry.js +1 -1
- package/dist/cjs/stzh-timeline-item.cjs.entry.js +1 -1
- package/dist/cjs/stzh-timeline.cjs.entry.js +1 -1
- package/dist/cjs/stzh-timepicker.cjs.entry.js +1 -1
- package/dist/cjs/stzh-toast_2.cjs.entry.js +3 -3
- package/dist/cjs/stzh-toggle.cjs.entry.js +3 -3
- package/dist/cjs/stzh-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/stzh-twocolumns.cjs.entry.js +1 -1
- package/dist/cjs/stzh-upload.cjs.entry.js +3 -3
- package/dist/cjs/stzh-visuallyhidden.cjs.entry.js +2 -2
- package/dist/cjs/stzh-vspace.cjs.entry.js +2 -2
- package/dist/cjs/stzh-youtube.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/CMS/stzh-contact/stzh-contact.css +6 -3
- package/dist/collection/components/CMS/stzh-contact/stzh-contact.js +33 -15
- package/dist/collection/components/CMS/stzh-contact/stzh-contact.js.map +1 -1
- package/dist/collection/components/CMS/stzh-contact/stzh-contact.stories.js +11 -24
- package/dist/collection/components/CMS/stzh-contact-cv/stzh-contact-cv.js +1 -1
- package/dist/collection/components/CMS/stzh-disturber/stzh-disturber.js +1 -1
- package/dist/collection/components/CMS/stzh-editor/stzh-editor.js +1 -1
- package/dist/collection/components/CMS/stzh-eventdata/stzh-eventdata.js +1 -1
- package/dist/collection/components/CMS/stzh-eventinfo/stzh-eventinfo.js +1 -1
- package/dist/collection/components/CMS/stzh-feedreader/stzh-feedreader.js +1 -1
- package/dist/collection/components/CMS/stzh-feedreader-item/stzh-feedreader-item.js +1 -1
- package/dist/collection/components/CMS/stzh-geo-ref-data/stzh-geo-ref-data.js +3 -3
- package/dist/collection/components/CMS/stzh-ghettobox/stzh-ghettobox.js +1 -1
- package/dist/collection/components/CMS/stzh-homepage-search/stzh-homepage-search.js +1 -1
- package/dist/collection/components/CMS/stzh-homepage-service-highlights/stzh-homepage-service-highlights.js +2 -2
- package/dist/collection/components/CMS/stzh-linklist/stzh-linklist.js +8 -2
- package/dist/collection/components/CMS/stzh-linklist/stzh-linklist.js.map +1 -1
- package/dist/collection/components/CMS/stzh-linklist/stzh-linklist.stories.js +38 -1
- package/dist/collection/components/CMS/stzh-microsite-teaserlist/stzh-microsite-teaserlist.js +1 -1
- package/dist/collection/components/CMS/stzh-page-skiplinks/stzh-page-skiplinks.js +1 -1
- package/dist/collection/components/CMS/stzh-pagebottom/stzh-pagebottom.js +1 -1
- package/dist/collection/components/CMS/stzh-pagecontent/stzh-pagecontent.js +1 -1
- package/dist/collection/components/CMS/stzh-pagetitle/stzh-pagetitle.js +1 -1
- package/dist/collection/components/CMS/stzh-pagetitle-hero/stzh-pagetitle-hero.js +1 -1
- package/dist/collection/components/CMS/stzh-pagetitle-home/stzh-pagetitle-home.js +1 -1
- package/dist/collection/components/CMS/stzh-pi-content-navigation/stzh-pi-content-navigation.js +1 -1
- package/dist/collection/components/CMS/stzh-pi-menu/stzh-pi-menu.js +1 -1
- package/dist/collection/components/CMS/stzh-pi-pagetitle/stzh-pi-pagetitle.js +1 -1
- package/dist/collection/components/CMS/stzh-pi-pagetitle/stzh-pi-pagetitle.js.map +1 -1
- package/dist/collection/components/CMS/stzh-pi-pagetitle/stzh-pi-pagetitle.stories.js +20 -11
- package/dist/collection/components/CMS/stzh-pi-quote/stzh-pi-quote.js +1 -1
- package/dist/collection/components/CMS/stzh-pi-teaser/stzh-pi-teaser.css +127 -261
- package/dist/collection/components/CMS/stzh-pi-teaser/stzh-pi-teaser.js +7 -93
- package/dist/collection/components/CMS/stzh-pi-teaser/stzh-pi-teaser.js.map +1 -1
- package/dist/collection/components/CMS/stzh-pi-teaser/stzh-pi-teaser.stories.js +7 -73
- package/dist/collection/components/CMS/stzh-pi-teaser-layout/stzh-pi-teaser-layout.css +26 -35
- package/dist/collection/components/CMS/stzh-pi-teaser-layout/stzh-pi-teaser-layout.js +46 -16
- package/dist/collection/components/CMS/stzh-pi-teaser-layout/stzh-pi-teaser-layout.js.map +1 -1
- package/dist/collection/components/CMS/stzh-pi-teaser-layout/stzh-pi-teaser-layout.stories.js +2 -2
- package/dist/collection/components/CMS/stzh-pi-teaser-layout-item/stzh-pi-teaser-layout-item.css +514 -0
- package/dist/collection/components/CMS/stzh-pi-teaser-layout-item/stzh-pi-teaser-layout-item.e2e.js +16 -0
- package/dist/collection/components/CMS/stzh-pi-teaser-layout-item/stzh-pi-teaser-layout-item.e2e.js.map +1 -0
- package/dist/collection/components/CMS/stzh-pi-teaser-layout-item/stzh-pi-teaser-layout-item.js +292 -0
- package/dist/collection/components/CMS/stzh-pi-teaser-layout-item/stzh-pi-teaser-layout-item.js.map +1 -0
- package/dist/collection/components/CMS/stzh-pi-teaser-layout-item/stzh-pi-teaser-layout-item.stories.js +70 -0
- package/dist/collection/components/CMS/stzh-poicard/stzh-poicard.js +1 -1
- package/dist/collection/components/CMS/stzh-poilist/stzh-poilist.js +1 -1
- package/dist/collection/components/CMS/stzh-print/stzh-print.js +1 -1
- package/dist/collection/components/CMS/stzh-search/stzh-search.js +2 -2
- package/dist/collection/components/CMS/stzh-sitemap/stzh-sitemap.js +1 -1
- package/dist/collection/components/CMS/stzh-socialmediastream/stzh-socialmediastream.js +1 -1
- package/dist/collection/components/CMS/stzh-socialmediastream-item/stzh-socialmediastream-item.js +1 -1
- package/dist/collection/components/CMS/stzh-textandimage/stzh-textandimage.js +1 -1
- package/dist/collection/components/CMS/stzh-twocolumns/stzh-twocolumns.js +1 -1
- package/dist/collection/components/stzh-accordion/stzh-accordion.js +1 -1
- package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.js +1 -1
- package/dist/collection/components/stzh-actions/stzh-actions.js +1 -1
- package/dist/collection/components/stzh-actionset/stzh-actionset.js +5 -5
- package/dist/collection/components/stzh-amount/stzh-amount.js +1 -1
- package/dist/collection/components/stzh-anchornav/stzh-anchornav.js +1 -1
- package/dist/collection/components/stzh-app-nav/stzh-app-nav.js +1 -1
- package/dist/collection/components/stzh-appointments/stzh-appointments.js +1 -1
- package/dist/collection/components/stzh-audio/stzh-audio.js +3 -3
- package/dist/collection/components/stzh-badge/stzh-badge.js +1 -1
- package/dist/collection/components/stzh-breadcrumb/stzh-breadcrumb.js +1 -1
- package/dist/collection/components/stzh-button/stzh-button.js +1 -1
- package/dist/collection/components/stzh-buttongroup/stzh-buttongroup.js +1 -1
- package/dist/collection/components/stzh-card/stzh-card.js +4 -4
- package/dist/collection/components/stzh-card-navigation/stzh-card-navigation.js +1 -1
- package/dist/collection/components/stzh-card-searchresult/stzh-card-searchresult.js +1 -1
- package/dist/collection/components/stzh-cardlist/stzh-cardlist.js +1 -1
- package/dist/collection/components/stzh-carousel/stzh-carousel.js +2 -2
- package/dist/collection/components/stzh-cell/stzh-cell.js +2 -2
- package/dist/collection/components/stzh-chart/stzh-chart.js +1 -1
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.js +3 -3
- package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js +3 -3
- package/dist/collection/components/stzh-chip/stzh-chip.js +1 -1
- package/dist/collection/components/stzh-chipgroup/stzh-chipgroup.js +1 -1
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.js +4 -4
- package/dist/collection/components/stzh-clamp/stzh-clamp.js +2 -2
- package/dist/collection/components/stzh-company-logo/stzh-company-logo.js +1 -1
- package/dist/collection/components/stzh-container/stzh-container.js +1 -1
- package/dist/collection/components/stzh-content/stzh-content.js +1 -1
- package/dist/collection/components/stzh-cspace/stzh-cspace.js +1 -1
- package/dist/collection/components/stzh-cta/stzh-cta.js +1 -1
- package/dist/collection/components/stzh-datalist/stzh-datalist.js +2 -2
- package/dist/collection/components/stzh-datamessagelist/stzh-datamessagelist.js +1 -1
- package/dist/collection/components/stzh-datamessagelist-item/stzh-datamessagelist-item.js +1 -1
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.css +1 -0
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.js +3 -3
- package/dist/collection/components/stzh-daterange/stzh-daterange.js +1 -1
- package/dist/collection/components/stzh-details/stzh-details.js +1 -1
- package/dist/collection/components/stzh-dialog/stzh-dialog.js +5 -5
- package/dist/collection/components/stzh-dialog/stzh-dialog.js.map +1 -1
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.js +4 -4
- package/dist/collection/components/stzh-fieldset/stzh-fieldset.js +1 -1
- package/dist/collection/components/stzh-figure/stzh-figure.js +1 -1
- package/dist/collection/components/stzh-flyingfocus/stzh-flyingfocus.js +1 -1
- package/dist/collection/components/stzh-footer/stzh-footer.js +1 -1
- package/dist/collection/components/stzh-gallery/stzh-gallery.js +1 -1
- package/dist/collection/components/stzh-heading/stzh-heading.js +1 -1
- package/dist/collection/components/stzh-hr/stzh-hr.js +1 -1
- package/dist/collection/components/stzh-hspace/stzh-hspace.js +2 -2
- package/dist/collection/components/stzh-http-error/stzh-http-error.js +1 -1
- package/dist/collection/components/stzh-icon/stzh-icon.js +1 -1
- package/dist/collection/components/stzh-iframe/stzh-iframe.js +4 -4
- package/dist/collection/components/stzh-imagecomparison/stzh-imagecomparison.js +2 -2
- package/dist/collection/components/stzh-input/stzh-input.js +5 -5
- package/dist/collection/components/stzh-invert/stzh-invert.js +1 -1
- package/dist/collection/components/stzh-link/stzh-link.js +1 -1
- package/dist/collection/components/stzh-list/stzh-list.js +1 -1
- package/dist/collection/components/stzh-list-item/stzh-list-item.js +1 -1
- package/dist/collection/components/stzh-loader/stzh-loader.js +1 -1
- package/dist/collection/components/stzh-loadingbar/stzh-loadingbar.js +1 -1
- package/dist/collection/components/stzh-menu/stzh-menu.js +1 -1
- package/dist/collection/components/stzh-menu-item/stzh-menu-item.js +1 -1
- package/dist/collection/components/stzh-message/stzh-message.js +2 -2
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.js +1 -1
- package/dist/collection/components/stzh-offline-indicator/stzh-offline-indicator.js +1 -1
- package/dist/collection/components/stzh-olmap/stzh-olmap.js +1 -1
- package/dist/collection/components/stzh-overlay/stzh-overlay.js +4 -4
- package/dist/collection/components/stzh-overlay/stzh-overlay.js.map +1 -1
- package/dist/collection/components/stzh-pagination/stzh-pagination.js +1 -1
- package/dist/collection/components/stzh-panorama/stzh-panorama.js +2 -2
- package/dist/collection/components/stzh-popover/stzh-popover.js +1 -1
- package/dist/collection/components/stzh-quote/stzh-quote.js +1 -1
- package/dist/collection/components/stzh-radio/stzh-radio.js +3 -3
- package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js +3 -3
- package/dist/collection/components/stzh-ratio/stzh-ratio.js +1 -1
- package/dist/collection/components/stzh-readspeaker/stzh-readspeaker.js +2 -2
- package/dist/collection/components/stzh-richtext/stzh-richtext.js +1 -1
- package/dist/collection/components/stzh-row/stzh-row.js +2 -2
- package/dist/collection/components/stzh-saptcha/stzh-saptcha.js +2 -2
- package/dist/collection/components/stzh-scrollup/stzh-scrollup.js +1 -1
- package/dist/collection/components/stzh-section/stzh-section.js +2 -2
- package/dist/collection/components/stzh-share/stzh-share.js +1 -1
- package/dist/collection/components/stzh-show/stzh-show.js +2 -2
- package/dist/collection/components/stzh-skin-portal-mitwirken/stzh-skin-portal-mitwirken.js +1 -1
- package/dist/collection/components/stzh-skin-storybook-preview/stzh-skin-storybook-preview.js +1 -1
- package/dist/collection/components/stzh-skiplink/stzh-skiplink.js +1 -1
- package/dist/collection/components/stzh-sortable/stzh-sortable.js +1 -1
- package/dist/collection/components/stzh-space/stzh-space.js +2 -2
- package/dist/collection/components/stzh-status/stzh-status.js +1 -1
- package/dist/collection/components/stzh-stepper/stzh-stepper.component.js +3 -3
- package/dist/collection/components/stzh-stepper-item/stzh-stepper-item.js +3 -3
- package/dist/collection/components/stzh-sticky/stzh-sticky.js +1 -1
- package/dist/collection/components/stzh-sticky-actions/stzh-sticky-actions.js +1 -1
- package/dist/collection/components/stzh-table/stzh-table.js +1 -1
- package/dist/collection/components/stzh-tag/stzh-tag.js +1 -1
- package/dist/collection/components/stzh-text/stzh-text.js +2 -2
- package/dist/collection/components/stzh-timeline/stzh-timeline.js +1 -1
- package/dist/collection/components/stzh-timeline-item/stzh-timeline-item.js +1 -1
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.js +1 -1
- package/dist/collection/components/stzh-toast/stzh-toast.js +2 -2
- package/dist/collection/components/stzh-toastbar/stzh-toastbar.js +1 -1
- package/dist/collection/components/stzh-toggle/stzh-toggle.js +3 -3
- package/dist/collection/components/stzh-tooltip/stzh-tooltip.js +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.js +3 -3
- package/dist/collection/components/stzh-visuallyhidden/stzh-visuallyhidden.js +2 -2
- package/dist/collection/components/stzh-vspace/stzh-vspace.js +2 -2
- package/dist/collection/components/stzh-youtube/stzh-youtube.js +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-b0a7ed3c.js → p-00bfe201.js} +3 -3
- package/dist/components/{p-b0a7ed3c.js.map → p-00bfe201.js.map} +1 -1
- package/dist/components/{p-87e69533.js → p-07336076.js} +3 -3
- package/dist/components/{p-87e69533.js.map → p-07336076.js.map} +1 -1
- package/dist/components/{p-3b563957.js → p-08363886.js} +9 -9
- package/dist/components/{p-3b563957.js.map → p-08363886.js.map} +1 -1
- package/dist/components/{p-375d74b5.js → p-0d14dffd.js} +7 -7
- package/dist/components/{p-375d74b5.js.map → p-0d14dffd.js.map} +1 -1
- package/dist/components/{p-0ac64574.js → p-10d1bf15.js} +4 -4
- package/dist/components/{p-0ac64574.js.map → p-10d1bf15.js.map} +1 -1
- package/dist/components/{p-2f38d899.js → p-2f249d24.js} +7 -7
- package/dist/components/{p-2f38d899.js.map → p-2f249d24.js.map} +1 -1
- package/dist/components/{p-b8b342f5.js → p-356399a0.js} +2 -2
- package/dist/components/{p-b8b342f5.js.map → p-356399a0.js.map} +1 -1
- package/dist/components/{p-5a5884a1.js → p-39b23489.js} +2 -2
- package/dist/components/{p-5a5884a1.js.map → p-39b23489.js.map} +1 -1
- package/dist/components/{p-52037fe2.js → p-3b8bf944.js} +7 -7
- package/dist/components/{p-52037fe2.js.map → p-3b8bf944.js.map} +1 -1
- package/dist/components/{p-a6169d66.js → p-3c00c24c.js} +9 -9
- package/dist/components/{p-a6169d66.js.map → p-3c00c24c.js.map} +1 -1
- package/dist/components/{p-8254224a.js → p-3de13c90.js} +8 -8
- package/dist/components/{p-8254224a.js.map → p-3de13c90.js.map} +1 -1
- package/dist/components/{p-17efbc57.js → p-42e86bbd.js} +2 -2
- package/dist/components/{p-17efbc57.js.map → p-42e86bbd.js.map} +1 -1
- package/dist/components/{p-820ce57f.js → p-476fe818.js} +12 -12
- package/dist/components/{p-820ce57f.js.map → p-476fe818.js.map} +1 -1
- package/dist/components/{p-33ac52bc.js → p-4c4a22d3.js} +2 -2
- package/dist/components/{p-33ac52bc.js.map → p-4c4a22d3.js.map} +1 -1
- package/dist/components/{p-8107e1a2.js → p-4f39842d.js} +5 -5
- package/dist/components/{p-8107e1a2.js.map → p-4f39842d.js.map} +1 -1
- package/dist/components/{p-75352a6a.js → p-556af4a4.js} +2 -2
- package/dist/components/{p-75352a6a.js.map → p-556af4a4.js.map} +1 -1
- package/dist/components/{p-ce0311f9.js → p-5aa4ca6b.js} +2 -2
- package/dist/components/{p-ce0311f9.js.map → p-5aa4ca6b.js.map} +1 -1
- package/dist/components/{p-f6b75419.js → p-60fc78bb.js} +7 -7
- package/dist/components/{p-f6b75419.js.map → p-60fc78bb.js.map} +1 -1
- package/dist/components/p-692cd6d0.js +90 -0
- package/dist/components/p-692cd6d0.js.map +1 -0
- package/dist/components/{p-b5f00d83.js → p-6dcd63da.js} +5 -5
- package/dist/components/{p-b5f00d83.js.map → p-6dcd63da.js.map} +1 -1
- package/dist/components/{p-59b494a3.js → p-700a2919.js} +2 -2
- package/dist/components/{p-59b494a3.js.map → p-700a2919.js.map} +1 -1
- package/dist/components/{p-6268e18b.js → p-7121e1bf.js} +3 -3
- package/dist/components/{p-6268e18b.js.map → p-7121e1bf.js.map} +1 -1
- package/dist/components/{p-7f251b60.js → p-7171b3a1.js} +10 -10
- package/dist/components/{p-7f251b60.js.map → p-7171b3a1.js.map} +1 -1
- package/dist/components/{p-8436ccb7.js → p-74ae8080.js} +6 -6
- package/dist/components/{p-8436ccb7.js.map → p-74ae8080.js.map} +1 -1
- package/dist/components/{p-368c4aa2.js → p-78546000.js} +5 -5
- package/dist/components/{p-368c4aa2.js.map → p-78546000.js.map} +1 -1
- package/dist/components/{p-683460a5.js → p-7a4eaab2.js} +2 -2
- package/dist/components/{p-683460a5.js.map → p-7a4eaab2.js.map} +1 -1
- package/dist/components/{p-527121ef.js → p-85745626.js} +2 -2
- package/dist/components/{p-527121ef.js.map → p-85745626.js.map} +1 -1
- package/dist/components/{p-f70f31d6.js → p-85a0cd24.js} +2 -2
- package/dist/components/{p-f70f31d6.js.map → p-85a0cd24.js.map} +1 -1
- package/dist/components/{p-a8876adb.js → p-893776e9.js} +3 -3
- package/dist/components/{p-a8876adb.js.map → p-893776e9.js.map} +1 -1
- package/dist/components/{p-7b016fd0.js → p-8c638ee6.js} +3 -3
- package/dist/components/{p-7b016fd0.js.map → p-8c638ee6.js.map} +1 -1
- package/dist/components/{p-503bdd56.js → p-8ea6e1c0.js} +5 -5
- package/dist/components/p-8ea6e1c0.js.map +1 -0
- package/dist/components/{p-5e70f03f.js → p-8ef5faf0.js} +9 -9
- package/dist/components/{p-5e70f03f.js.map → p-8ef5faf0.js.map} +1 -1
- package/dist/components/{p-c418c5d3.js → p-8fb1ee85.js} +2 -2
- package/dist/components/{p-c418c5d3.js.map → p-8fb1ee85.js.map} +1 -1
- package/dist/components/{p-9c59e8f6.js → p-9574ea75.js} +10 -10
- package/dist/components/p-9574ea75.js.map +1 -0
- package/dist/components/{p-1449a24c.js → p-95b36277.js} +4 -4
- package/dist/components/{p-1449a24c.js.map → p-95b36277.js.map} +1 -1
- package/dist/components/{p-c65c361a.js → p-95d2855a.js} +14 -14
- package/dist/components/{p-c65c361a.js.map → p-95d2855a.js.map} +1 -1
- package/dist/components/{p-ef6cfd1f.js → p-9aa3fad7.js} +6 -6
- package/dist/components/{p-ef6cfd1f.js.map → p-9aa3fad7.js.map} +1 -1
- package/dist/components/{p-39874f6d.js → p-9ad22ce8.js} +3 -3
- package/dist/components/{p-39874f6d.js.map → p-9ad22ce8.js.map} +1 -1
- package/dist/components/{p-d91d6c31.js → p-9c18e9fe.js} +2 -2
- package/dist/components/{p-d91d6c31.js.map → p-9c18e9fe.js.map} +1 -1
- package/dist/components/{p-1d88f941.js → p-9dba6e5f.js} +6 -6
- package/dist/components/{p-1d88f941.js.map → p-9dba6e5f.js.map} +1 -1
- package/dist/components/{p-1c939b9f.js → p-a02372f5.js} +2 -2
- package/dist/components/{p-1c939b9f.js.map → p-a02372f5.js.map} +1 -1
- package/dist/components/{p-5a8587ab.js → p-a2659715.js} +2 -2
- package/dist/components/{p-5a8587ab.js.map → p-a2659715.js.map} +1 -1
- package/dist/components/{p-677c846d.js → p-a3c5c1b3.js} +2 -2
- package/dist/components/{p-677c846d.js.map → p-a3c5c1b3.js.map} +1 -1
- package/dist/components/{p-46d253ca.js → p-a5acb217.js} +3 -3
- package/dist/components/{p-46d253ca.js.map → p-a5acb217.js.map} +1 -1
- package/dist/components/{p-a649af8a.js → p-a7393afc.js} +14 -14
- package/dist/components/{p-a649af8a.js.map → p-a7393afc.js.map} +1 -1
- package/dist/components/{p-b9a50363.js → p-a773eb1b.js} +6 -6
- package/dist/components/{p-b9a50363.js.map → p-a773eb1b.js.map} +1 -1
- package/dist/components/{p-26ddf3b3.js → p-a87c8ead.js} +2 -2
- package/dist/components/{p-26ddf3b3.js.map → p-a87c8ead.js.map} +1 -1
- package/dist/components/{p-9a31aa56.js → p-ace11500.js} +3 -3
- package/dist/components/{p-9a31aa56.js.map → p-ace11500.js.map} +1 -1
- package/dist/components/{p-55b58017.js → p-ad34b5e0.js} +2 -2
- package/dist/components/{p-55b58017.js.map → p-ad34b5e0.js.map} +1 -1
- package/dist/components/{p-044c234a.js → p-b03368b3.js} +7 -7
- package/dist/components/{p-044c234a.js.map → p-b03368b3.js.map} +1 -1
- package/dist/components/{p-63ba178a.js → p-b2eca173.js} +4 -4
- package/dist/components/{p-63ba178a.js.map → p-b2eca173.js.map} +1 -1
- package/dist/components/{p-25ff5360.js → p-b35195c8.js} +4 -4
- package/dist/components/{p-25ff5360.js.map → p-b35195c8.js.map} +1 -1
- package/dist/components/{p-3e28d77d.js → p-b5caf3f4.js} +3 -3
- package/dist/components/{p-3e28d77d.js.map → p-b5caf3f4.js.map} +1 -1
- package/dist/components/{p-e42121d1.js → p-b84d0233.js} +4 -4
- package/dist/components/{p-e42121d1.js.map → p-b84d0233.js.map} +1 -1
- package/dist/components/{p-019721d4.js → p-b8f2532a.js} +5 -5
- package/dist/components/{p-019721d4.js.map → p-b8f2532a.js.map} +1 -1
- package/dist/components/{p-1e6ceaab.js → p-ba8edf1e.js} +2 -2
- package/dist/components/{p-1e6ceaab.js.map → p-ba8edf1e.js.map} +1 -1
- package/dist/components/{p-a393bd0b.js → p-bb38e284.js} +3 -3
- package/dist/components/{p-a393bd0b.js.map → p-bb38e284.js.map} +1 -1
- package/dist/components/{p-cae6655f.js → p-c5aa3de6.js} +8 -8
- package/dist/components/{p-cae6655f.js.map → p-c5aa3de6.js.map} +1 -1
- package/dist/components/{p-e87822db.js → p-cd95008d.js} +2 -2
- package/dist/components/{p-e87822db.js.map → p-cd95008d.js.map} +1 -1
- package/dist/components/{p-9ac321e4.js → p-cdbd62e3.js} +13 -13
- package/dist/components/p-cdbd62e3.js.map +1 -0
- package/dist/components/{p-1ebc2928.js → p-ce788661.js} +2 -2
- package/dist/components/{p-1ebc2928.js.map → p-ce788661.js.map} +1 -1
- package/dist/components/{p-8d98b7e1.js → p-d0ecd5c0.js} +3 -3
- package/dist/components/{p-8d98b7e1.js.map → p-d0ecd5c0.js.map} +1 -1
- package/dist/components/{p-9be51edc.js → p-d1dcb448.js} +6 -6
- package/dist/components/{p-9be51edc.js.map → p-d1dcb448.js.map} +1 -1
- package/dist/components/{p-7889ebb0.js → p-ddb9cb15.js} +7 -7
- package/dist/components/{p-7889ebb0.js.map → p-ddb9cb15.js.map} +1 -1
- package/dist/components/{p-604af41f.js → p-e4ff57a8.js} +4 -4
- package/dist/components/{p-604af41f.js.map → p-e4ff57a8.js.map} +1 -1
- package/dist/components/{p-285c271e.js → p-f020ba27.js} +3 -3
- package/dist/components/{p-285c271e.js.map → p-f020ba27.js.map} +1 -1
- package/dist/components/{p-15e2b360.js → p-f3c5a9d6.js} +3 -3
- package/dist/components/{p-15e2b360.js.map → p-f3c5a9d6.js.map} +1 -1
- package/dist/components/p-f5779736.js.map +1 -1
- package/dist/components/{p-faae4632.js → p-f625c800.js} +11 -11
- package/dist/components/{p-faae4632.js.map → p-f625c800.js.map} +1 -1
- package/dist/components/{p-06ba8843.js → p-fae759aa.js} +6 -6
- package/dist/components/{p-06ba8843.js.map → p-fae759aa.js.map} +1 -1
- package/dist/components/{p-853de15b.js → p-ffbf0fbb.js} +7 -7
- package/dist/components/{p-853de15b.js.map → p-ffbf0fbb.js.map} +1 -1
- package/dist/components/stzh-accordion-item.js +1 -1
- package/dist/components/stzh-accordion.js +1 -1
- package/dist/components/stzh-actions.js +1 -1
- package/dist/components/stzh-actionset.js +1 -1
- package/dist/components/stzh-amount.js +9 -9
- package/dist/components/stzh-anchornav.js +5 -5
- package/dist/components/stzh-app-nav.js +1 -1
- package/dist/components/stzh-appointments.js +13 -13
- package/dist/components/stzh-archivelist.js +6 -6
- package/dist/components/stzh-audio.js +7 -7
- package/dist/components/stzh-badge.js +1 -1
- package/dist/components/stzh-banner.js +3 -3
- package/dist/components/stzh-bathstatus-item.js +1 -1
- package/dist/components/stzh-bathstatus-list.js +6 -6
- package/dist/components/stzh-breadcrumb.js +1 -1
- package/dist/components/stzh-button.js +1 -1
- package/dist/components/stzh-buttongroup.js +1 -1
- package/dist/components/stzh-calendar.js +1 -1
- package/dist/components/stzh-card-navigation.js +2 -2
- package/dist/components/stzh-card-searchresult.js +14 -14
- package/dist/components/stzh-card-superteaser.js +13 -13
- package/dist/components/stzh-card.js +1 -1
- package/dist/components/stzh-cardlist.js +1 -1
- package/dist/components/stzh-carousel.js +1 -1
- package/dist/components/stzh-cell.js +1 -1
- package/dist/components/stzh-chart.js +1 -1
- package/dist/components/stzh-checkbox.js +1 -1
- package/dist/components/stzh-checkboxgroup.js +6 -6
- package/dist/components/stzh-chip.js +1 -1
- package/dist/components/stzh-chipgroup.js +1 -1
- package/dist/components/stzh-chipselect.js +1 -1
- package/dist/components/stzh-clamp.js +1 -1
- package/dist/components/stzh-company-logo.js +1 -1
- package/dist/components/stzh-contact-cv.js +4 -4
- package/dist/components/stzh-contact.js +11 -9
- package/dist/components/stzh-contact.js.map +1 -1
- package/dist/components/stzh-container.js +1 -1
- package/dist/components/stzh-content.js +1 -1
- package/dist/components/stzh-cspace.js +1 -1
- package/dist/components/stzh-cta.js +3 -3
- package/dist/components/stzh-datalist-item.js +1 -1
- package/dist/components/stzh-datalist.js +1 -1
- package/dist/components/stzh-datamessagelist-item.js +11 -11
- package/dist/components/stzh-datamessagelist.js +1 -1
- package/dist/components/stzh-datatable.js +16 -16
- package/dist/components/stzh-datepicker.js +1 -1
- package/dist/components/stzh-daterange.js +4 -4
- package/dist/components/stzh-details.js +1 -1
- package/dist/components/stzh-dialog.js +1 -1
- package/dist/components/stzh-disturber.js +4 -4
- package/dist/components/stzh-dropdown.js +1 -1
- package/dist/components/stzh-editor.js +4 -4
- package/dist/components/stzh-eventdata.js +1 -1
- package/dist/components/stzh-eventinfo.js +5 -5
- package/dist/components/stzh-feedreader-item.js +2 -2
- package/dist/components/stzh-feedreader.js +8 -8
- package/dist/components/stzh-fieldset.js +1 -1
- package/dist/components/stzh-figure.js +1 -1
- package/dist/components/stzh-flyingfocus.js +1 -1
- package/dist/components/stzh-footer.js +4 -4
- package/dist/components/stzh-gallery.js +8 -8
- package/dist/components/stzh-geo-ref-data.js +25 -25
- package/dist/components/stzh-ghettobox.js +1 -1
- package/dist/components/stzh-header.js +1 -1
- package/dist/components/stzh-heading.js +1 -1
- package/dist/components/stzh-homepage-search.js +2 -2
- package/dist/components/stzh-homepage-service-highlights.js +7 -7
- package/dist/components/stzh-hr.js +1 -1
- package/dist/components/stzh-hspace.js +1 -1
- package/dist/components/stzh-http-error.js +7 -7
- package/dist/components/stzh-icon.js +1 -1
- package/dist/components/stzh-iframe.js +1 -1
- package/dist/components/stzh-imagecomparison.js +3 -3
- package/dist/components/stzh-input.js +1 -1
- package/dist/components/stzh-invert.js +1 -1
- package/dist/components/stzh-link.js +1 -1
- package/dist/components/stzh-linklist.js +14 -11
- package/dist/components/stzh-linklist.js.map +1 -1
- package/dist/components/stzh-list-item.js +1 -1
- package/dist/components/stzh-list.js +1 -1
- package/dist/components/stzh-loader.js +1 -1
- package/dist/components/stzh-loadingbar.js +1 -1
- package/dist/components/stzh-menu-item.js +1 -1
- package/dist/components/stzh-menu.js +1 -1
- package/dist/components/stzh-message.js +1 -1
- package/dist/components/stzh-microsite-teaserlist.js +19 -19
- package/dist/components/stzh-monthyearpicker.js +5 -5
- package/dist/components/stzh-offline-indicator.js +6 -6
- package/dist/components/stzh-olmap.js +1 -1
- package/dist/components/stzh-overlay.js +1 -1
- package/dist/components/stzh-page-skiplinks.js +1 -1
- package/dist/components/stzh-pagebottom.js +8 -8
- package/dist/components/stzh-pagecontent.js +1 -1
- package/dist/components/stzh-pagetitle-hero.js +1 -1
- package/dist/components/stzh-pagetitle-home.js +2 -2
- package/dist/components/stzh-pagetitle.js +2 -2
- package/dist/components/stzh-pagination.js +1 -1
- package/dist/components/stzh-panorama.js +12 -12
- package/dist/components/stzh-pi-content-navigation.js +3 -3
- package/dist/components/stzh-pi-menu.js +3 -3
- package/dist/components/stzh-pi-pagetitle.js +2 -2
- package/dist/components/stzh-pi-pagetitle.js.map +1 -1
- package/dist/components/stzh-pi-quote.js +1 -1
- package/dist/components/stzh-pi-teaser-layout-item.d.ts +11 -0
- package/dist/components/stzh-pi-teaser-layout-item.js +8 -0
- package/dist/components/stzh-pi-teaser-layout-item.js.map +1 -0
- package/dist/components/stzh-pi-teaser-layout.js +46 -19
- package/dist/components/stzh-pi-teaser-layout.js.map +1 -1
- package/dist/components/stzh-pi-teaser.js +83 -1
- package/dist/components/stzh-pi-teaser.js.map +1 -1
- package/dist/components/stzh-pkzh-qr.js +19 -19
- package/dist/components/stzh-poicard.js +1 -1
- package/dist/components/stzh-poilist.js +18 -18
- package/dist/components/stzh-popover.js +1 -1
- package/dist/components/stzh-print.js +1 -1
- package/dist/components/stzh-quote.js +1 -1
- package/dist/components/stzh-radio.js +1 -1
- package/dist/components/stzh-radiogroup.js +1 -1
- package/dist/components/stzh-ratio.js +1 -1
- package/dist/components/stzh-readspeaker.js +5 -5
- package/dist/components/stzh-richtext.js +1 -1
- package/dist/components/stzh-row.js +1 -1
- package/dist/components/stzh-saptcha.js +8 -8
- package/dist/components/stzh-scrollup.js +1 -1
- package/dist/components/stzh-search.js +17 -17
- package/dist/components/stzh-section.js +2 -2
- package/dist/components/stzh-share.js +1 -1
- package/dist/components/stzh-show.js +1 -1
- package/dist/components/stzh-sitemap.js +9 -9
- package/dist/components/stzh-skin-portal-mitwirken.js +1 -1
- package/dist/components/stzh-skin-storybook-preview.js +1 -1
- package/dist/components/stzh-skiplink.js +1 -1
- package/dist/components/stzh-socialmediastream-item.js +1 -1
- package/dist/components/stzh-socialmediastream.js +6 -6
- package/dist/components/stzh-sortable.js +1 -1
- package/dist/components/stzh-space.js +1 -1
- package/dist/components/stzh-status.js +1 -1
- package/dist/components/stzh-stepper-item.js +1 -1
- package/dist/components/stzh-stepper.js +5 -5
- package/dist/components/stzh-sticky-actions.js +2 -2
- package/dist/components/stzh-sticky.js +1 -1
- package/dist/components/stzh-table.js +1 -1
- package/dist/components/stzh-tag.js +1 -1
- package/dist/components/stzh-text.js +1 -1
- package/dist/components/stzh-textandimage.js +1 -1
- package/dist/components/stzh-timeline-item.js +3 -3
- package/dist/components/stzh-timeline.js +1 -1
- package/dist/components/stzh-timepicker.js +5 -5
- package/dist/components/stzh-toast.js +1 -1
- package/dist/components/stzh-toastbar.js +1 -1
- package/dist/components/stzh-toggle.js +6 -6
- package/dist/components/stzh-tooltip.js +1 -1
- package/dist/components/stzh-twocolumns.js +1 -1
- package/dist/components/stzh-upload.js +14 -14
- package/dist/components/stzh-vbz-carousel.js +1 -1
- package/dist/components/stzh-vbz-intro.js +4 -4
- package/dist/components/stzh-vbz-linechip.js +1 -1
- package/dist/components/stzh-vbz-majorticker.js +6 -6
- package/dist/components/stzh-vbz-ticker.js +6 -6
- package/dist/components/stzh-visuallyhidden.js +2 -2
- package/dist/components/stzh-vspace.js +2 -2
- package/dist/components/stzh-youtube.js +6 -6
- package/dist/esm/{app-globals-8ffa411d.js → app-globals-c4439d36.js} +2 -2
- package/dist/esm/{app-globals-8ffa411d.js.map → app-globals-c4439d36.js.map} +1 -1
- package/dist/esm/index-d8813b10.js +6 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stzh-accordion_3.entry.js +3 -3
- package/dist/esm/stzh-actions_6.entry.js +9 -9
- package/dist/esm/stzh-actionset.entry.js +5 -5
- package/dist/esm/stzh-amount.entry.js +1 -1
- package/dist/esm/stzh-anchornav.entry.js +1 -1
- package/dist/esm/stzh-app-nav.entry.js +1 -1
- package/dist/esm/stzh-appointments.entry.js +1 -1
- package/dist/esm/stzh-audio.entry.js +3 -3
- package/dist/esm/stzh-badge_3.entry.js +3 -3
- package/dist/esm/stzh-breadcrumb_2.entry.js +2 -2
- package/dist/esm/stzh-buttongroup.entry.js +1 -1
- package/dist/esm/stzh-card-navigation.entry.js +1 -1
- package/dist/esm/stzh-card-searchresult.entry.js +1 -1
- package/dist/esm/stzh-card.entry.js +4 -4
- package/dist/esm/stzh-cardlist_3.entry.js +3 -3
- package/dist/esm/stzh-carousel.entry.js +2 -2
- package/dist/esm/stzh-chart.entry.js +1 -1
- package/dist/esm/stzh-checkbox.entry.js +3 -3
- package/dist/esm/stzh-checkboxgroup.entry.js +3 -3
- package/dist/esm/stzh-chip.entry.js +1 -1
- package/dist/esm/stzh-chipgroup.entry.js +1 -1
- package/dist/esm/stzh-chipselect.entry.js +4 -4
- package/dist/esm/stzh-clamp.entry.js +2 -2
- package/dist/esm/stzh-company-logo.entry.js +1 -1
- package/dist/esm/stzh-components.js +2 -2
- package/dist/esm/stzh-contact-cv.entry.js +1 -1
- package/dist/esm/stzh-contact.entry.js +4 -3
- package/dist/esm/stzh-contact.entry.js.map +1 -1
- package/dist/esm/stzh-content.entry.js +1 -1
- package/dist/esm/stzh-cta.entry.js +1 -1
- package/dist/esm/stzh-datalist_3.entry.js +3 -3
- package/dist/esm/stzh-datamessagelist-item.entry.js +1 -1
- package/dist/esm/stzh-datamessagelist.entry.js +1 -1
- package/dist/esm/stzh-datepicker_3.entry.js +10 -10
- package/dist/esm/stzh-datepicker_3.entry.js.map +1 -1
- package/dist/esm/stzh-daterange.entry.js +1 -1
- package/dist/esm/stzh-details.entry.js +1 -1
- package/dist/esm/stzh-dialog.entry.js +5 -5
- package/dist/esm/stzh-dialog.entry.js.map +1 -1
- package/dist/esm/stzh-disturber.entry.js +1 -1
- package/dist/esm/stzh-dropdown.entry.js +4 -4
- package/dist/esm/stzh-editor.entry.js +1 -1
- package/dist/esm/stzh-eventdata.entry.js +1 -1
- package/dist/esm/stzh-eventinfo.entry.js +1 -1
- package/dist/esm/stzh-feedreader-item.entry.js +1 -1
- package/dist/esm/stzh-feedreader.entry.js +1 -1
- package/dist/esm/stzh-figure.entry.js +1 -1
- package/dist/esm/stzh-flyingfocus.entry.js +1 -1
- package/dist/esm/stzh-footer.entry.js +1 -1
- package/dist/esm/stzh-gallery.entry.js +1 -1
- package/dist/esm/stzh-geo-ref-data.entry.js +3 -3
- package/dist/esm/stzh-ghettobox_3.entry.js +4 -4
- package/dist/esm/stzh-header_2.entry.js +1 -1
- package/dist/esm/stzh-heading.entry.js +1 -1
- package/dist/esm/stzh-homepage-search.entry.js +1 -1
- package/dist/esm/stzh-homepage-service-highlights.entry.js +2 -2
- package/dist/esm/stzh-hr.entry.js +1 -1
- package/dist/esm/stzh-hspace.entry.js +2 -2
- package/dist/esm/stzh-http-error.entry.js +1 -1
- package/dist/esm/stzh-iframe.entry.js +4 -4
- package/dist/esm/stzh-imagecomparison.entry.js +2 -2
- package/dist/esm/stzh-input.entry.js +5 -5
- package/dist/esm/stzh-invert.entry.js +1 -1
- package/dist/esm/stzh-link.entry.js +1 -1
- package/dist/esm/stzh-linklist.entry.js +6 -2
- package/dist/esm/stzh-linklist.entry.js.map +1 -1
- package/dist/esm/stzh-list_2.entry.js +2 -2
- package/dist/esm/stzh-loader_2.entry.js +5 -5
- package/dist/esm/stzh-loader_2.entry.js.map +1 -1
- package/dist/esm/stzh-loadingbar.entry.js +1 -1
- package/dist/esm/stzh-menu_2.entry.js +2 -2
- package/dist/esm/stzh-message.entry.js +2 -2
- package/dist/esm/stzh-microsite-teaserlist.entry.js +1 -1
- package/dist/esm/stzh-monthyearpicker.entry.js +1 -1
- package/dist/esm/stzh-offline-indicator.entry.js +1 -1
- package/dist/esm/stzh-page-skiplinks.entry.js +1 -1
- package/dist/esm/stzh-pagebottom.entry.js +1 -1
- package/dist/esm/stzh-pagecontent.entry.js +1 -1
- package/dist/esm/stzh-pagetitle-hero.entry.js +1 -1
- package/dist/esm/stzh-pagetitle-home.entry.js +1 -1
- package/dist/esm/stzh-pagetitle.entry.js +1 -1
- package/dist/esm/stzh-panorama.entry.js +2 -2
- package/dist/esm/stzh-pi-content-navigation.entry.js +1 -1
- package/dist/esm/stzh-pi-menu.entry.js +1 -1
- package/dist/esm/stzh-pi-pagetitle.entry.js +1 -1
- package/dist/esm/stzh-pi-pagetitle.entry.js.map +1 -1
- package/dist/esm/stzh-pi-quote.entry.js +1 -1
- package/dist/esm/stzh-pi-teaser-layout-item.entry.js +64 -0
- package/dist/esm/stzh-pi-teaser-layout-item.entry.js.map +1 -0
- package/dist/esm/stzh-pi-teaser-layout.entry.js +43 -16
- package/dist/esm/stzh-pi-teaser-layout.entry.js.map +1 -1
- package/dist/esm/stzh-pi-teaser.entry.js +9 -25
- package/dist/esm/stzh-pi-teaser.entry.js.map +1 -1
- package/dist/esm/stzh-poicard.entry.js +1 -1
- package/dist/esm/stzh-poilist.entry.js +1 -1
- package/dist/esm/stzh-popover.entry.js +1 -1
- package/dist/esm/stzh-print_2.entry.js +2 -2
- package/dist/esm/stzh-quote.entry.js +1 -1
- package/dist/esm/stzh-ratio.entry.js +1 -1
- package/dist/esm/stzh-readspeaker.entry.js +2 -2
- package/dist/esm/stzh-saptcha.entry.js +2 -2
- package/dist/esm/stzh-scrollup.entry.js +1 -1
- package/dist/esm/stzh-search.entry.js +2 -2
- package/dist/esm/stzh-section.entry.js +2 -2
- package/dist/esm/stzh-sitemap.entry.js +1 -1
- package/dist/esm/stzh-skin-portal-mitwirken.entry.js +1 -1
- package/dist/esm/stzh-skin-storybook-preview.entry.js +1 -1
- package/dist/esm/stzh-skiplink.entry.js +1 -1
- package/dist/esm/stzh-socialmediastream-item.entry.js +1 -1
- package/dist/esm/stzh-socialmediastream.entry.js +1 -1
- package/dist/esm/stzh-stepper-item.entry.js +3 -3
- package/dist/esm/stzh-stepper.entry.js +3 -3
- package/dist/esm/stzh-sticky-actions.entry.js +1 -1
- package/dist/esm/stzh-sticky.entry.js +1 -1
- package/dist/esm/stzh-table.entry.js +1 -1
- package/dist/esm/stzh-text.entry.js +2 -2
- package/dist/esm/stzh-textandimage.entry.js +1 -1
- package/dist/esm/stzh-timeline-item.entry.js +1 -1
- package/dist/esm/stzh-timeline.entry.js +1 -1
- package/dist/esm/stzh-timepicker.entry.js +1 -1
- package/dist/esm/stzh-toast_2.entry.js +3 -3
- package/dist/esm/stzh-toggle.entry.js +3 -3
- package/dist/esm/stzh-tooltip.entry.js +1 -1
- package/dist/esm/stzh-twocolumns.entry.js +1 -1
- package/dist/esm/stzh-upload.entry.js +3 -3
- package/dist/esm/stzh-visuallyhidden.entry.js +2 -2
- package/dist/esm/stzh-vspace.entry.js +2 -2
- package/dist/esm/stzh-youtube.entry.js +1 -1
- package/dist/stzh-components/index.esm.js.map +1 -1
- package/dist/stzh-components/{p-484ab936.entry.js → p-015a35bf.entry.js} +2 -2
- package/dist/stzh-components/p-03c2d367.entry.js +2 -0
- package/dist/stzh-components/p-03c2d367.entry.js.map +1 -0
- package/dist/stzh-components/{p-813765e0.entry.js → p-03e628b9.entry.js} +2 -2
- package/dist/stzh-components/{p-aef0879b.entry.js → p-04c9ec6b.entry.js} +2 -2
- package/dist/stzh-components/{p-c4fe3a90.entry.js → p-0685f2ae.entry.js} +2 -2
- package/dist/stzh-components/{p-810e15c1.entry.js → p-0d54bcfc.entry.js} +2 -2
- package/dist/stzh-components/p-0f546f1c.entry.js +2 -0
- package/dist/stzh-components/p-0f546f1c.entry.js.map +1 -0
- package/dist/stzh-components/{p-c5de2eae.entry.js → p-1187dcb3.entry.js} +2 -2
- package/dist/stzh-components/{p-822fd427.entry.js → p-12146af8.entry.js} +2 -2
- package/dist/stzh-components/p-15dc154c.entry.js +2 -0
- package/dist/stzh-components/p-15dc154c.entry.js.map +1 -0
- package/dist/stzh-components/{p-e973ae31.entry.js → p-1617973f.entry.js} +2 -2
- package/dist/stzh-components/{p-0f29cccb.entry.js → p-16552049.entry.js} +2 -2
- package/dist/stzh-components/{p-640bd513.entry.js → p-1844d99e.entry.js} +2 -2
- package/dist/stzh-components/{p-4524b189.entry.js → p-187fd37a.entry.js} +2 -2
- package/dist/stzh-components/{p-592d0768.entry.js → p-1bb06be6.entry.js} +2 -2
- package/dist/stzh-components/{p-36783a19.entry.js → p-1f4f76b1.entry.js} +2 -2
- package/dist/stzh-components/{p-060b4bf0.entry.js → p-1f668f53.entry.js} +2 -2
- package/dist/stzh-components/p-2096b877.entry.js +2 -0
- package/dist/stzh-components/p-2096b877.entry.js.map +1 -0
- package/dist/stzh-components/{p-a0ec5681.entry.js → p-21d2d28d.entry.js} +2 -2
- package/dist/stzh-components/{p-a634e4a3.entry.js → p-26792e28.entry.js} +2 -2
- package/dist/stzh-components/p-26792e28.entry.js.map +1 -0
- package/dist/stzh-components/{p-4e67373b.entry.js → p-2a0fa100.entry.js} +2 -2
- package/dist/stzh-components/{p-852bb820.entry.js → p-2d50d767.entry.js} +2 -2
- package/dist/stzh-components/{p-603eb9db.entry.js → p-3056b956.entry.js} +2 -2
- package/dist/stzh-components/p-3071b6f4.entry.js +2 -0
- package/dist/stzh-components/{p-7fcdf0da.entry.js.map → p-3071b6f4.entry.js.map} +1 -1
- package/dist/stzh-components/{p-dd1d8a38.entry.js → p-32448e73.entry.js} +2 -2
- package/dist/stzh-components/{p-d8d5bcf0.entry.js → p-34c68f20.entry.js} +2 -2
- package/dist/stzh-components/{p-3be9615c.entry.js → p-35be1f2c.entry.js} +2 -2
- package/dist/stzh-components/{p-86134534.entry.js → p-38104164.entry.js} +2 -2
- package/dist/stzh-components/p-3bc24ea1.entry.js +2 -0
- package/dist/stzh-components/p-3bc24ea1.entry.js.map +1 -0
- package/dist/stzh-components/{p-0aa2bf6d.entry.js → p-3d3d0515.entry.js} +2 -2
- package/dist/stzh-components/{p-dac817d4.entry.js → p-42a3a0df.entry.js} +2 -2
- package/dist/stzh-components/{p-97c16051.entry.js → p-450c13f2.entry.js} +2 -2
- package/dist/stzh-components/{p-b77def39.entry.js → p-4539e17f.entry.js} +2 -2
- package/dist/stzh-components/{p-83eee7d8.entry.js → p-46dcce84.entry.js} +2 -2
- package/dist/stzh-components/{p-c4c3cd03.entry.js → p-46e5f084.entry.js} +2 -2
- package/dist/stzh-components/{p-5149779d.entry.js → p-46fc5ee0.entry.js} +2 -2
- package/dist/stzh-components/p-4a7b6f37.js +2 -0
- package/dist/stzh-components/{p-f47de487.js.map → p-4a7b6f37.js.map} +1 -1
- package/dist/stzh-components/{p-5d4e0dd0.entry.js → p-4b754125.entry.js} +2 -2
- package/dist/stzh-components/{p-70739292.entry.js → p-4c8d577f.entry.js} +2 -2
- package/dist/stzh-components/{p-2b99717a.entry.js → p-4dbbea21.entry.js} +2 -2
- package/dist/stzh-components/{p-b2bd3ab6.entry.js → p-4f3149ca.entry.js} +2 -2
- package/dist/stzh-components/{p-242f8853.entry.js → p-4ff33b79.entry.js} +2 -2
- package/dist/stzh-components/{p-01b910be.entry.js → p-51bf87d0.entry.js} +2 -2
- package/dist/stzh-components/{p-bec35e8a.entry.js → p-5725e544.entry.js} +2 -2
- package/dist/stzh-components/{p-de0d236c.entry.js → p-582d0259.entry.js} +2 -2
- package/dist/stzh-components/{p-b424108f.entry.js → p-598de693.entry.js} +2 -2
- package/dist/stzh-components/{p-bfac05d9.entry.js → p-5a38eb4c.entry.js} +2 -2
- package/dist/stzh-components/{p-1450f777.entry.js → p-5d877ea1.entry.js} +2 -2
- package/dist/stzh-components/p-5dc298a4.entry.js +2 -0
- package/dist/stzh-components/p-5dc298a4.entry.js.map +1 -0
- package/dist/stzh-components/{p-f87cac36.entry.js → p-5fe85cfd.entry.js} +2 -2
- package/dist/stzh-components/{p-58df488a.entry.js → p-6102443e.entry.js} +2 -2
- package/dist/stzh-components/{p-1ef9b4aa.entry.js → p-61491246.entry.js} +2 -2
- package/dist/stzh-components/{p-0dd8bb75.entry.js → p-640e445b.entry.js} +2 -2
- package/dist/stzh-components/{p-bf786c3d.entry.js → p-65e099a0.entry.js} +2 -2
- package/dist/stzh-components/{p-368d97c2.entry.js → p-664e7a09.entry.js} +2 -2
- package/dist/stzh-components/{p-f544acad.entry.js → p-6ee6bc09.entry.js} +2 -2
- package/dist/stzh-components/{p-a64a1cfb.entry.js → p-6f7f7e18.entry.js} +2 -2
- package/dist/stzh-components/{p-7a0e995b.entry.js → p-72203e1d.entry.js} +2 -2
- package/dist/stzh-components/{p-c7d7d854.entry.js → p-727c30cf.entry.js} +2 -2
- package/dist/stzh-components/{p-8629e109.entry.js → p-766dea66.entry.js} +2 -2
- package/dist/stzh-components/{p-0c9776ca.entry.js → p-7844b15a.entry.js} +2 -2
- package/dist/stzh-components/{p-5f37f146.entry.js → p-7bc4d471.entry.js} +2 -2
- package/dist/stzh-components/{p-4a05919e.entry.js → p-7cfa54b9.entry.js} +2 -2
- package/dist/stzh-components/{p-4a05919e.entry.js.map → p-7cfa54b9.entry.js.map} +1 -1
- package/dist/stzh-components/{p-07a64a81.entry.js → p-7facda3d.entry.js} +3 -3
- package/dist/stzh-components/{p-7c3ad9ad.entry.js → p-86c278a3.entry.js} +2 -2
- package/dist/stzh-components/{p-600c2da8.entry.js → p-8e133247.entry.js} +2 -2
- package/dist/stzh-components/{p-0cf1a45d.entry.js → p-8e82664a.entry.js} +2 -2
- package/dist/stzh-components/{p-5f236e09.entry.js → p-8f90ba95.entry.js} +2 -2
- package/dist/stzh-components/{p-09ccae77.entry.js → p-92bdcdad.entry.js} +2 -2
- package/dist/stzh-components/{p-513cbed7.entry.js → p-93424a61.entry.js} +2 -2
- package/dist/stzh-components/{p-0cfc71d9.entry.js → p-94b7f926.entry.js} +2 -2
- package/dist/stzh-components/{p-88b60580.entry.js → p-9cdb4375.entry.js} +2 -2
- package/dist/stzh-components/{p-787ea476.entry.js → p-a12cf3bc.entry.js} +2 -2
- package/dist/stzh-components/{p-cdfc3629.entry.js → p-a38f6851.entry.js} +2 -2
- package/dist/stzh-components/{p-1791b2b3.entry.js → p-a498a5f5.entry.js} +2 -2
- package/dist/stzh-components/{p-f76e4062.entry.js → p-a4cbd257.entry.js} +2 -2
- package/dist/stzh-components/{p-59f90fb0.entry.js → p-a75c4682.entry.js} +2 -2
- package/dist/stzh-components/{p-523cd861.entry.js → p-a8292b13.entry.js} +2 -2
- package/dist/stzh-components/{p-9429dd63.entry.js → p-a9b34a6b.entry.js} +2 -2
- package/dist/stzh-components/{p-1f383f92.entry.js → p-abdf8b13.entry.js} +2 -2
- package/dist/stzh-components/{p-f50cd7ba.entry.js → p-ac335416.entry.js} +2 -2
- package/dist/stzh-components/{p-e73168b1.entry.js → p-af1aa423.entry.js} +2 -2
- package/dist/stzh-components/{p-52157928.entry.js → p-b145722f.entry.js} +2 -2
- package/dist/stzh-components/{p-f52539cd.entry.js → p-b311be28.entry.js} +2 -2
- package/dist/stzh-components/{p-5e81bc87.entry.js → p-b4bae13a.entry.js} +2 -2
- package/dist/stzh-components/{p-81234cb3.entry.js → p-b4bdb4cf.entry.js} +2 -2
- package/dist/stzh-components/{p-560c82e5.entry.js → p-b5d4e8b9.entry.js} +2 -2
- package/dist/stzh-components/{p-4883b247.entry.js → p-b95edacd.entry.js} +2 -2
- package/dist/stzh-components/{p-005493d4.entry.js → p-bc0618bb.entry.js} +2 -2
- package/dist/stzh-components/{p-6201ff22.entry.js → p-bc837007.entry.js} +2 -2
- package/dist/stzh-components/{p-6705f73a.entry.js → p-be74a213.entry.js} +2 -2
- package/dist/stzh-components/{p-a60e9919.entry.js → p-c11a73d2.entry.js} +2 -2
- package/dist/stzh-components/{p-cfaa0150.entry.js → p-c1508338.entry.js} +2 -2
- package/dist/stzh-components/{p-5afa5c60.entry.js → p-c41804d9.entry.js} +2 -2
- package/dist/stzh-components/{p-072ee314.entry.js → p-c7d82187.entry.js} +2 -2
- package/dist/stzh-components/{p-05ac8cf5.entry.js → p-c8476e6e.entry.js} +2 -2
- package/dist/stzh-components/{p-b5361fa5.entry.js → p-c95bce0d.entry.js} +2 -2
- package/dist/stzh-components/{p-802da9eb.entry.js → p-caf867f9.entry.js} +2 -2
- package/dist/stzh-components/{p-05c5f234.entry.js → p-cb058b56.entry.js} +2 -2
- package/dist/stzh-components/{p-c4a656ba.entry.js → p-cfbc4a5e.entry.js} +2 -2
- package/dist/stzh-components/{p-be5c3c5f.entry.js → p-d2a97efc.entry.js} +2 -2
- package/dist/stzh-components/{p-e1c7c23f.entry.js → p-d516d56c.entry.js} +2 -2
- package/dist/stzh-components/{p-8dccb0a9.entry.js → p-d7ee085c.entry.js} +2 -2
- package/dist/stzh-components/{p-1416149e.entry.js → p-dac4534c.entry.js} +2 -2
- package/dist/stzh-components/{p-0eb6375d.entry.js → p-dacee3d1.entry.js} +2 -2
- package/dist/stzh-components/{p-91b425d3.entry.js → p-e11a606e.entry.js} +2 -2
- package/dist/stzh-components/{p-87b49bad.entry.js → p-e184e0fd.entry.js} +2 -2
- package/dist/stzh-components/{p-d3d1a284.entry.js → p-e75cde0c.entry.js} +2 -2
- package/dist/stzh-components/{p-89dc75cb.entry.js → p-ebb4b12f.entry.js} +2 -2
- package/dist/stzh-components/{p-a47ce522.entry.js → p-ec2ac6e9.entry.js} +2 -2
- package/dist/stzh-components/p-ee311236.entry.js +2 -0
- package/dist/stzh-components/{p-ddc0dc04.entry.js.map → p-ee311236.entry.js.map} +1 -1
- package/dist/stzh-components/{p-f3d3f975.entry.js → p-f3081e0e.entry.js} +2 -2
- package/dist/stzh-components/p-f47bd88c.entry.js +2 -0
- package/dist/stzh-components/{p-c27082b1.entry.js.map → p-f47bd88c.entry.js.map} +1 -1
- package/dist/stzh-components/{p-5e15683f.entry.js → p-f52e344a.entry.js} +2 -2
- package/dist/stzh-components/{p-decc15e9.entry.js → p-f61e61e7.entry.js} +2 -2
- package/dist/stzh-components/p-f61e61e7.entry.js.map +1 -0
- package/dist/stzh-components/{p-cb70b81e.entry.js → p-f93f056f.entry.js} +2 -2
- package/dist/stzh-components/{p-14d4ccf8.entry.js → p-ff04778f.entry.js} +2 -2
- package/dist/stzh-components/{p-a92f593a.entry.js → p-ff2877e7.entry.js} +2 -2
- package/dist/stzh-components/{p-7bb25462.entry.js → p-ff41be1d.entry.js} +2 -2
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/stzh-components/stzh-components.esm.js.map +1 -1
- package/dist/types/components/CMS/stzh-contact/stzh-contact.d.ts +4 -2
- package/dist/types/components/CMS/stzh-linklist/stzh-linklist.d.ts +5 -1
- package/dist/types/components/CMS/stzh-pi-teaser/stzh-pi-teaser.d.ts +0 -7
- package/dist/types/components/CMS/stzh-pi-teaser-layout/stzh-pi-teaser-layout.d.ts +4 -1
- package/dist/types/components/CMS/stzh-pi-teaser-layout-item/stzh-pi-teaser-layout-item.d.ts +44 -0
- package/dist/types/components/stzh-dialog/stzh-dialog.d.ts +1 -1
- package/dist/types/components/stzh-overlay/stzh-overlay.d.ts +1 -1
- package/dist/types/components.d.ts +144 -42
- package/dist/types/index.d.ts +5 -0
- package/dist/vscode-data.json +100 -45
- package/package.json +4 -4
- package/dist/components/p-503bdd56.js.map +0 -1
- package/dist/components/p-9ac321e4.js.map +0 -1
- package/dist/components/p-9c59e8f6.js.map +0 -1
- package/dist/components/p-c22c1bb9.js +0 -102
- package/dist/components/p-c22c1bb9.js.map +0 -1
- package/dist/stzh-components/p-07f2765c.entry.js +0 -2
- package/dist/stzh-components/p-07f2765c.entry.js.map +0 -1
- package/dist/stzh-components/p-10e8dd7d.entry.js +0 -2
- package/dist/stzh-components/p-10e8dd7d.entry.js.map +0 -1
- package/dist/stzh-components/p-177fe44b.entry.js +0 -2
- package/dist/stzh-components/p-177fe44b.entry.js.map +0 -1
- package/dist/stzh-components/p-7fcdf0da.entry.js +0 -2
- package/dist/stzh-components/p-84f8a7c4.entry.js +0 -2
- package/dist/stzh-components/p-84f8a7c4.entry.js.map +0 -1
- package/dist/stzh-components/p-a469d79d.entry.js +0 -2
- package/dist/stzh-components/p-a469d79d.entry.js.map +0 -1
- package/dist/stzh-components/p-a634e4a3.entry.js.map +0 -1
- package/dist/stzh-components/p-c27082b1.entry.js +0 -2
- package/dist/stzh-components/p-ddc0dc04.entry.js +0 -2
- package/dist/stzh-components/p-decc15e9.entry.js.map +0 -1
- package/dist/stzh-components/p-f47de487.js +0 -2
- /package/dist/stzh-components/{p-484ab936.entry.js.map → p-015a35bf.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-813765e0.entry.js.map → p-03e628b9.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-aef0879b.entry.js.map → p-04c9ec6b.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-c4fe3a90.entry.js.map → p-0685f2ae.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-810e15c1.entry.js.map → p-0d54bcfc.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-c5de2eae.entry.js.map → p-1187dcb3.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-822fd427.entry.js.map → p-12146af8.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-e973ae31.entry.js.map → p-1617973f.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-0f29cccb.entry.js.map → p-16552049.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-640bd513.entry.js.map → p-1844d99e.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-4524b189.entry.js.map → p-187fd37a.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-592d0768.entry.js.map → p-1bb06be6.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-36783a19.entry.js.map → p-1f4f76b1.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-060b4bf0.entry.js.map → p-1f668f53.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-a0ec5681.entry.js.map → p-21d2d28d.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-4e67373b.entry.js.map → p-2a0fa100.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-852bb820.entry.js.map → p-2d50d767.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-603eb9db.entry.js.map → p-3056b956.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-dd1d8a38.entry.js.map → p-32448e73.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-d8d5bcf0.entry.js.map → p-34c68f20.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-3be9615c.entry.js.map → p-35be1f2c.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-86134534.entry.js.map → p-38104164.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-0aa2bf6d.entry.js.map → p-3d3d0515.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-dac817d4.entry.js.map → p-42a3a0df.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-97c16051.entry.js.map → p-450c13f2.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-b77def39.entry.js.map → p-4539e17f.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-83eee7d8.entry.js.map → p-46dcce84.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-c4c3cd03.entry.js.map → p-46e5f084.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-5149779d.entry.js.map → p-46fc5ee0.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-5d4e0dd0.entry.js.map → p-4b754125.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-70739292.entry.js.map → p-4c8d577f.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-2b99717a.entry.js.map → p-4dbbea21.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-b2bd3ab6.entry.js.map → p-4f3149ca.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-242f8853.entry.js.map → p-4ff33b79.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-01b910be.entry.js.map → p-51bf87d0.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-bec35e8a.entry.js.map → p-5725e544.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-de0d236c.entry.js.map → p-582d0259.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-b424108f.entry.js.map → p-598de693.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-bfac05d9.entry.js.map → p-5a38eb4c.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-1450f777.entry.js.map → p-5d877ea1.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-f87cac36.entry.js.map → p-5fe85cfd.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-58df488a.entry.js.map → p-6102443e.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-1ef9b4aa.entry.js.map → p-61491246.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-0dd8bb75.entry.js.map → p-640e445b.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-bf786c3d.entry.js.map → p-65e099a0.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-368d97c2.entry.js.map → p-664e7a09.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-f544acad.entry.js.map → p-6ee6bc09.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-a64a1cfb.entry.js.map → p-6f7f7e18.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-7a0e995b.entry.js.map → p-72203e1d.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-c7d7d854.entry.js.map → p-727c30cf.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-8629e109.entry.js.map → p-766dea66.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-0c9776ca.entry.js.map → p-7844b15a.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-5f37f146.entry.js.map → p-7bc4d471.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-07a64a81.entry.js.map → p-7facda3d.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-7c3ad9ad.entry.js.map → p-86c278a3.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-600c2da8.entry.js.map → p-8e133247.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-0cf1a45d.entry.js.map → p-8e82664a.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-5f236e09.entry.js.map → p-8f90ba95.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-09ccae77.entry.js.map → p-92bdcdad.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-513cbed7.entry.js.map → p-93424a61.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-0cfc71d9.entry.js.map → p-94b7f926.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-88b60580.entry.js.map → p-9cdb4375.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-787ea476.entry.js.map → p-a12cf3bc.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-cdfc3629.entry.js.map → p-a38f6851.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-1791b2b3.entry.js.map → p-a498a5f5.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-f76e4062.entry.js.map → p-a4cbd257.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-59f90fb0.entry.js.map → p-a75c4682.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-523cd861.entry.js.map → p-a8292b13.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-9429dd63.entry.js.map → p-a9b34a6b.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-1f383f92.entry.js.map → p-abdf8b13.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-f50cd7ba.entry.js.map → p-ac335416.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-e73168b1.entry.js.map → p-af1aa423.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-52157928.entry.js.map → p-b145722f.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-f52539cd.entry.js.map → p-b311be28.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-5e81bc87.entry.js.map → p-b4bae13a.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-81234cb3.entry.js.map → p-b4bdb4cf.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-560c82e5.entry.js.map → p-b5d4e8b9.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-4883b247.entry.js.map → p-b95edacd.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-005493d4.entry.js.map → p-bc0618bb.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-6201ff22.entry.js.map → p-bc837007.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-6705f73a.entry.js.map → p-be74a213.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-a60e9919.entry.js.map → p-c11a73d2.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-cfaa0150.entry.js.map → p-c1508338.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-5afa5c60.entry.js.map → p-c41804d9.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-072ee314.entry.js.map → p-c7d82187.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-05ac8cf5.entry.js.map → p-c8476e6e.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-b5361fa5.entry.js.map → p-c95bce0d.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-802da9eb.entry.js.map → p-caf867f9.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-05c5f234.entry.js.map → p-cb058b56.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-c4a656ba.entry.js.map → p-cfbc4a5e.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-be5c3c5f.entry.js.map → p-d2a97efc.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-e1c7c23f.entry.js.map → p-d516d56c.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-8dccb0a9.entry.js.map → p-d7ee085c.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-1416149e.entry.js.map → p-dac4534c.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-0eb6375d.entry.js.map → p-dacee3d1.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-91b425d3.entry.js.map → p-e11a606e.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-87b49bad.entry.js.map → p-e184e0fd.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-d3d1a284.entry.js.map → p-e75cde0c.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-89dc75cb.entry.js.map → p-ebb4b12f.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-a47ce522.entry.js.map → p-ec2ac6e9.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-f3d3f975.entry.js.map → p-f3081e0e.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-5e15683f.entry.js.map → p-f52e344a.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-cb70b81e.entry.js.map → p-f93f056f.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-14d4ccf8.entry.js.map → p-ff04778f.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-a92f593a.entry.js.map → p-ff2877e7.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-7bb25462.entry.js.map → p-ff41be1d.entry.js.map} +0 -0
|
@@ -4,5 +4,5 @@ import{r as t,c as i,e as s,w as e,h as r,F as n,a as h,g as a}from"./p-ef5985a3
|
|
|
4
4
|
* Latitude/longitude spherical geodesy formulae taken from
|
|
5
5
|
* http://www.movable-type.co.uk/scripts/latlong.html
|
|
6
6
|
* Licensed under CC-BY-3.0.
|
|
7
|
-
*/var Wh=function(t){this.radius=t};Wh.prototype.geodesicArea=function(t){return Wh.getArea_(t,this.radius)};Wh.prototype.haversineDistance=function(t,i){return Wh.getDistance_(t,i,this.radius)};Wh.prototype.offset=function(t,i,s){var e=Fh.toRadians(t[1]);var r=Fh.toRadians(t[0]);var n=i/this.radius;var h=Math.asin(Math.sin(e)*Math.cos(n)+Math.cos(e)*Math.sin(n)*Math.cos(s));var a=r+Math.atan2(Math.sin(s)*Math.sin(n)*Math.cos(e),Math.cos(n)-Math.sin(e)*Math.sin(h));return[Fh.toDegrees(a),Fh.toDegrees(h)]};Wh.DEFAULT_RADIUS=6371008.8;Wh.getLength=function(t,i){var s=i||{};var e=s.radius||Wh.DEFAULT_RADIUS;var r=s.projection||"EPSG:3857";t=t.clone().transform(r,"EPSG:4326");var n=t.getType();var h=0;var a,o,f,u,v,l;switch(n){case Gh.POINT:case Gh.MULTI_POINT:{break}case Gh.LINE_STRING:case Gh.LINEAR_RING:{a=t.getCoordinates();h=Wh.getLength_(a,e);break}case Gh.MULTI_LINE_STRING:case Gh.POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){h+=Wh.getLength_(a[f],e)}break}case Gh.MULTI_POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){o=a[f];for(v=0,l=o.length;v<l;++v){h+=Wh.getLength_(o[v],e)}}break}case Gh.GEOMETRY_COLLECTION:{var c=t.getGeometries();for(f=0,u=c.length;f<u;++f){h+=Wh.getLength(c[f],i)}break}default:{throw new Error("Unsupported geometry type: "+n)}}return h};Wh.getLength_=function(t,i){var s=0;for(var e=0,r=t.length;e<r-1;++e){s+=Wh.getDistance_(t[e],t[e+1],i)}return s};Wh.getDistance_=function(t,i,s){var e=Fh.toRadians(t[1]);var r=Fh.toRadians(i[1]);var n=(r-e)/2;var h=Fh.toRadians(i[0]-t[0])/2;var a=Math.sin(n)*Math.sin(n)+Math.sin(h)*Math.sin(h)*Math.cos(e)*Math.cos(r);return 2*s*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))};Wh.getArea=function(t,i){var s=i||{};var e=s.radius||Wh.DEFAULT_RADIUS;var r=s.projection||"EPSG:3857";t=t.clone().transform(r,"EPSG:4326");var n=t.getType();var h=0;var a,o,f,u,v,l;switch(n){case Gh.POINT:case Gh.MULTI_POINT:case Gh.LINE_STRING:case Gh.MULTI_LINE_STRING:case Gh.LINEAR_RING:{break}case Gh.POLYGON:{a=t.getCoordinates();h=Math.abs(Wh.getArea_(a[0],e));for(f=1,u=a.length;f<u;++f){h-=Math.abs(Wh.getArea_(a[f],e))}break}case Gh.MULTI_POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){o=a[f];h+=Math.abs(Wh.getArea_(o[0],e));for(v=1,l=o.length;v<l;++v){h-=Math.abs(Wh.getArea_(o[v],e))}}break}case Gh.GEOMETRY_COLLECTION:{var c=t.getGeometries();for(f=0,u=c.length;f<u;++f){h+=Wh.getArea(c[f],i)}break}default:{throw new Error("Unsupported geometry type: "+n)}}return h};Wh.getArea_=function(t,i){var s=0,e=t.length;var r=t[e-1][0];var n=t[e-1][1];for(var h=0;h<e;h++){var a=t[h][0],o=t[h][1];s+=Fh.toRadians(a-r)*(2+Math.sin(Fh.toRadians(n))+Math.sin(Fh.toRadians(o)));r=a;n=o}return s*i*i/2};var jh={};jh.binarySearch=function(t,i,s){var e,r;var n=s||jh.numberSafeCompareFunction;var h=0;var a=t.length;var o=false;while(h<a){e=h+(a-h>>1);r=+n(t[e],i);if(r<0){h=e+1}else{a=e;o=!r}}return o?h:~h};jh.numberSafeCompareFunction=function(t,i){return t>i?1:t<i?-1:0};jh.includes=function(t,i){return t.indexOf(i)>=0};jh.linearFindNearest=function(t,i,s){var e=t.length;if(t[0]<=i){return 0}else if(i<=t[e-1]){return e-1}else{var r;if(s>0){for(r=1;r<e;++r){if(t[r]<i){return r-1}}}else if(s<0){for(r=1;r<e;++r){if(t[r]<=i){return r}}}else{for(r=1;r<e;++r){if(t[r]==i){return r}else if(t[r]<i){if(t[r-1]-i<i-t[r]){return r-1}else{return r}}}}return e-1}};jh.reverseSubArray=function(t,i,s){while(i<s){var e=t[i];t[i]=t[s];t[s]=e;++i;--s}};jh.extend=function(t,i){var s;var e=Array.isArray(i)?i:[i];var r=e.length;for(s=0;s<r;s++){t[t.length]=e[s]}};jh.remove=function(t,i){var s=t.indexOf(i);var e=s>-1;if(e){t.splice(s,1)}return e};jh.find=function(t,i){var s=t.length>>>0;var e;for(var r=0;r<s;r++){e=t[r];if(i(e,r,t)){return e}}return null};jh.equals=function(t,i){var s=t.length;if(s!==i.length){return false}for(var e=0;e<s;e++){if(t[e]!==i[e]){return false}}return true};jh.stableSort=function(t,i){var s=t.length;var e=Array(t.length);var r;for(r=0;r<s;r++){e[r]={index:r,value:t[r]}}e.sort((function(t,s){return i(t.value,s.value)||t.index-s.index}));for(r=0;r<t.length;r++){t[r]=e[r].value}};jh.findIndex=function(t,i){var s;var e=!t.every((function(e,r){s=r;return!i(e,r,t)}));return e?s:-1};jh.isSorted=function(t,i,s){var e=i||jh.numberSafeCompareFunction;return t.every((function(i,r){if(r===0){return true}var n=e(t[r-1],i);return!(n>0||s&&n===0)}))};var Vh={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var Uh={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};var qh={};qh.boundingExtent=function(t){var i=qh.createEmpty();for(var s=0,e=t.length;s<e;++s){qh.extendCoordinate(i,t[s])}return i};qh.boundingExtentXYs_=function(t,i,s){var e=Math.min.apply(null,t);var r=Math.min.apply(null,i);var n=Math.max.apply(null,t);var h=Math.max.apply(null,i);return qh.createOrUpdate(e,r,n,h,s)};qh.buffer=function(t,i,s){if(s){s[0]=t[0]-i;s[1]=t[1]-i;s[2]=t[2]+i;s[3]=t[3]+i;return s}else{return[t[0]-i,t[1]-i,t[2]+i,t[3]+i]}};qh.clone=function(t,i){if(i){i[0]=t[0];i[1]=t[1];i[2]=t[2];i[3]=t[3];return i}else{return t.slice()}};qh.closestSquaredDistanceXY=function(t,i,s){var e,r;if(i<t[0]){e=t[0]-i}else if(t[2]<i){e=i-t[2]}else{e=0}if(s<t[1]){r=t[1]-s}else if(t[3]<s){r=s-t[3]}else{r=0}return e*e+r*r};qh.containsCoordinate=function(t,i){return qh.containsXY(t,i[0],i[1])};qh.containsExtent=function(t,i){return t[0]<=i[0]&&i[2]<=t[2]&&t[1]<=i[1]&&i[3]<=t[3]};qh.containsXY=function(t,i,s){return t[0]<=i&&i<=t[2]&&t[1]<=s&&s<=t[3]};qh.coordinateRelationship=function(t,i){var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=i[0];var a=i[1];var o=Uh.UNKNOWN;if(h<s){o=o|Uh.LEFT}else if(h>r){o=o|Uh.RIGHT}if(a<e){o=o|Uh.BELOW}else if(a>n){o=o|Uh.ABOVE}if(o===Uh.UNKNOWN){o=Uh.INTERSECTING}return o};qh.createEmpty=function(){return[Infinity,Infinity,-Infinity,-Infinity]};qh.createOrUpdate=function(t,i,s,e,r){if(r){r[0]=t;r[1]=i;r[2]=s;r[3]=e;return r}else{return[t,i,s,e]}};qh.createOrUpdateEmpty=function(t){return qh.createOrUpdate(Infinity,Infinity,-Infinity,-Infinity,t)};qh.createOrUpdateFromCoordinate=function(t,i){var s=t[0];var e=t[1];return qh.createOrUpdate(s,e,s,e,i)};qh.createOrUpdateFromCoordinates=function(t,i){var s=qh.createOrUpdateEmpty(i);return qh.extendCoordinates(s,t)};qh.createOrUpdateFromFlatCoordinates=function(t,i,s,e,r){var n=qh.createOrUpdateEmpty(r);return qh.extendFlatCoordinates(n,t,i,s,e)};qh.createOrUpdateFromRings=function(t,i){var s=qh.createOrUpdateEmpty(i);return qh.extendRings(s,t)};qh.equals=function(t,i){return t[0]==i[0]&&t[2]==i[2]&&t[1]==i[1]&&t[3]==i[3]};qh.extend=function(t,i){if(i[0]<t[0]){t[0]=i[0]}if(i[2]>t[2]){t[2]=i[2]}if(i[1]<t[1]){t[1]=i[1]}if(i[3]>t[3]){t[3]=i[3]}return t};qh.extendCoordinate=function(t,i){if(i[0]<t[0]){t[0]=i[0]}if(i[0]>t[2]){t[2]=i[0]}if(i[1]<t[1]){t[1]=i[1]}if(i[1]>t[3]){t[3]=i[1]}};qh.extendCoordinates=function(t,i){var s,e;for(s=0,e=i.length;s<e;++s){qh.extendCoordinate(t,i[s])}return t};qh.extendFlatCoordinates=function(t,i,s,e,r){for(;s<e;s+=r){qh.extendXY(t,i[s],i[s+1])}return t};qh.extendRings=function(t,i){var s,e;for(s=0,e=i.length;s<e;++s){qh.extendCoordinates(t,i[s])}return t};qh.extendXY=function(t,i,s){t[0]=Math.min(t[0],i);t[1]=Math.min(t[1],s);t[2]=Math.max(t[2],i);t[3]=Math.max(t[3],s)};qh.forEachCorner=function(t,i,s){var e;e=i.call(s,qh.getBottomLeft(t));if(e){return e}e=i.call(s,qh.getBottomRight(t));if(e){return e}e=i.call(s,qh.getTopRight(t));if(e){return e}e=i.call(s,qh.getTopLeft(t));if(e){return e}return false};qh.getArea=function(t){var i=0;if(!qh.isEmpty(t)){i=qh.getWidth(t)*qh.getHeight(t)}return i};qh.getBottomLeft=function(t){return[t[0],t[1]]};qh.getBottomRight=function(t){return[t[2],t[1]]};qh.getCenter=function(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]};qh.getCorner=function(t,i){var s;if(i===Vh.BOTTOM_LEFT){s=qh.getBottomLeft(t)}else if(i===Vh.BOTTOM_RIGHT){s=qh.getBottomRight(t)}else if(i===Vh.TOP_LEFT){s=qh.getTopLeft(t)}else if(i===Vh.TOP_RIGHT){s=qh.getTopRight(t)}else{Dh.assert(false,13)}return s};qh.getEnlargedArea=function(t,i){var s=Math.min(t[0],i[0]);var e=Math.min(t[1],i[1]);var r=Math.max(t[2],i[2]);var n=Math.max(t[3],i[3]);return(r-s)*(n-e)};qh.getForViewAndSize=function(t,i,s,e,r){var n=i*e[0]/2;var h=i*e[1]/2;var a=Math.cos(s);var o=Math.sin(s);var f=n*a;var u=n*o;var v=h*a;var l=h*o;var c=t[0];var d=t[1];var m=c-f+l;var p=c-f-l;var M=c+f-l;var z=c+f+l;var _=d-u-v;var g=d-u+v;var w=d+u+v;var y=d+u-v;return qh.createOrUpdate(Math.min(m,p,M,z),Math.min(_,g,w,y),Math.max(m,p,M,z),Math.max(_,g,w,y),r)};qh.getHeight=function(t){return t[3]-t[1]};qh.getIntersectionArea=function(t,i){var s=qh.getIntersection(t,i);return qh.getArea(s)};qh.getIntersection=function(t,i,s){var e=s?s:qh.createEmpty();if(qh.intersects(t,i)){if(t[0]>i[0]){e[0]=t[0]}else{e[0]=i[0]}if(t[1]>i[1]){e[1]=t[1]}else{e[1]=i[1]}if(t[2]<i[2]){e[2]=t[2]}else{e[2]=i[2]}if(t[3]<i[3]){e[3]=t[3]}else{e[3]=i[3]}}return e};qh.getMargin=function(t){return qh.getWidth(t)+qh.getHeight(t)};qh.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]};qh.getTopLeft=function(t){return[t[0],t[3]]};qh.getTopRight=function(t){return[t[2],t[3]]};qh.getWidth=function(t){return t[2]-t[0]};qh.intersects=function(t,i){return t[0]<=i[2]&&t[2]>=i[0]&&t[1]<=i[3]&&t[3]>=i[1]};qh.isEmpty=function(t){return t[2]<t[0]||t[3]<t[1]};qh.returnOrUpdate=function(t,i){if(i){i[0]=t[0];i[1]=t[1];i[2]=t[2];i[3]=t[3];return i}else{return t}};qh.scaleFromCenter=function(t,i){var s=(t[2]-t[0])/2*(i-1);var e=(t[3]-t[1])/2*(i-1);t[0]-=s;t[2]+=s;t[1]-=e;t[3]+=e};qh.intersectsSegment=function(t,i,s){var e=false;var r=qh.coordinateRelationship(t,i);var n=qh.coordinateRelationship(t,s);if(r===Uh.INTERSECTING||n===Uh.INTERSECTING){e=true}else{var h=t[0];var a=t[1];var o=t[2];var f=t[3];var u=i[0];var v=i[1];var l=s[0];var c=s[1];var d=(c-v)/(l-u);var m,p;if(!!(n&Uh.ABOVE)&&!(r&Uh.ABOVE)){m=l-(c-f)/d;e=m>=h&&m<=o}if(!e&&!!(n&Uh.RIGHT)&&!(r&Uh.RIGHT)){p=c-(l-o)*d;e=p>=a&&p<=f}if(!e&&!!(n&Uh.BELOW)&&!(r&Uh.BELOW)){m=l-(c-a)/d;e=m>=h&&m<=o}if(!e&&!!(n&Uh.LEFT)&&!(r&Uh.LEFT)){p=c-(l-h)*d;e=p>=a&&p<=f}}return e};qh.applyTransform=function(t,i,s){var e=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];i(e,e,2);var r=[e[0],e[2],e[4],e[6]];var n=[e[1],e[3],e[5],e[7]];return qh.boundingExtentXYs_(r,n,s)};var Xh={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};var Yh={};Yh.TRUE=function(){return true};Yh.FALSE=function(){return false};var Bh={};Bh.transform2D=function(t,i,s,e,r,n){var h=n?n:[];var a=0;var o;for(o=i;o<s;o+=e){var f=t[o];var u=t[o+1];h[a++]=r[0]*f+r[2]*u+r[4];h[a++]=r[1]*f+r[3]*u+r[5]}if(n&&h.length!=a){h.length=a}return h};Bh.rotate=function(t,i,s,e,r,n,h){var a=h?h:[];var o=Math.cos(r);var f=Math.sin(r);var u=n[0];var v=n[1];var l=0;for(var c=i;c<s;c+=e){var d=t[c]-u;var m=t[c+1]-v;a[l++]=u+d*o-m*f;a[l++]=v+d*f+m*o;for(var p=c+2;p<c+e;++p){a[l++]=t[p]}}if(h&&a.length!=l){a.length=l}return a};Bh.scale=function(t,i,s,e,r,n,h,a){var o=a?a:[];var f=h[0];var u=h[1];var v=0;for(var l=i;l<s;l+=e){var c=t[l]-f;var d=t[l+1]-u;o[v++]=f+r*c;o[v++]=u+n*d;for(var m=l+2;m<l+e;++m){o[v++]=t[m]}}if(a&&o.length!=v){o.length=v}return o};Bh.translate=function(t,i,s,e,r,n,h){var a=h?h:[];var o=0;var f,u;for(f=i;f<s;f+=e){a[o++]=t[f]+r;a[o++]=t[f+1]+n;for(u=f+2;u<f+e;++u){a[o++]=t[u]}}if(h&&a.length!=o){a.length=o}return a};var Hh={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"};Hh.METERS_PER_UNIT={};Hh.METERS_PER_UNIT[Hh.DEGREES]=2*Math.PI*6370997/360;Hh.METERS_PER_UNIT[Hh.FEET]=.3048;Hh.METERS_PER_UNIT[Hh.METERS]=1;Hh.METERS_PER_UNIT[Hh.USFEET]=1200/3937;var Jh={};Jh.cache_=null;Jh.set=function(t){Jh.cache_=t};Jh.get=function(){return Jh.cache_||window["proj4"]};var Zh=function(t){this.code_=t.code;this.units_=t.units;this.extent_=t.extent!==undefined?t.extent:null;this.worldExtent_=t.worldExtent!==undefined?t.worldExtent:null;this.axisOrientation_=t.axisOrientation!==undefined?t.axisOrientation:"enu";this.global_=t.global!==undefined?t.global:false;this.canWrapX_=!!(this.global_&&this.extent_);this.getPointResolutionFunc_=t.getPointResolution;this.defaultTileGrid_=null;this.metersPerUnit_=t.metersPerUnit;var i=t.code;if(kh.ENABLE_PROJ4JS){var s=Jh.get();if(typeof s=="function"){var e=s.defs(i);if(e!==undefined){if(e.axis!==undefined&&t.axisOrientation===undefined){this.axisOrientation_=e.axis}if(t.metersPerUnit===undefined){this.metersPerUnit_=e.to_meter}if(t.units===undefined){this.units_=e.units}}}}};Zh.prototype.canWrapX=function(){return this.canWrapX_};Zh.prototype.getCode=function(){return this.code_};Zh.prototype.getExtent=function(){return this.extent_};Zh.prototype.getUnits=function(){return this.units_};Zh.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Hh.METERS_PER_UNIT[this.units_]};Zh.prototype.getWorldExtent=function(){return this.worldExtent_};Zh.prototype.getAxisOrientation=function(){return this.axisOrientation_};Zh.prototype.isGlobal=function(){return this.global_};Zh.prototype.setGlobal=function(t){this.global_=t;this.canWrapX_=!!(t&&this.extent_)};Zh.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_};Zh.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t};Zh.prototype.setExtent=function(t){this.extent_=t;this.canWrapX_=!!(this.global_&&t)};Zh.prototype.setWorldExtent=function(t){this.worldExtent_=t};Zh.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t};Zh.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var Kh={};Kh.Projection_=function(t){Zh.call(this,{code:t,units:Hh.METERS,extent:Kh.EXTENT,global:true,worldExtent:Kh.WORLD_EXTENT,getPointResolution:function(t,i){return t/Fh.cosh(i[1]/Kh.RADIUS)}})};kh.inherits(Kh.Projection_,Zh);Kh.RADIUS=6378137;Kh.HALF_SIZE=Math.PI*Kh.RADIUS;Kh.EXTENT=[-Kh.HALF_SIZE,-Kh.HALF_SIZE,Kh.HALF_SIZE,Kh.HALF_SIZE];Kh.WORLD_EXTENT=[-180,-85,180,85];Kh.PROJECTIONS=[new Kh.Projection_("EPSG:3857"),new Kh.Projection_("EPSG:102100"),new Kh.Projection_("EPSG:102113"),new Kh.Projection_("EPSG:900913"),new Kh.Projection_("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Kh.Projection_("urn:ogc:def:crs:EPSG::3857"),new Kh.Projection_("http://www.opengis.net/gml/srs/epsg.xml#3857")];Kh.fromEPSG4326=function(t,i,s){var e=t.length,r=s>1?s:2,n=i;if(n===undefined){if(r>2){n=t.slice()}else{n=new Array(e)}}var h=Kh.HALF_SIZE;for(var a=0;a<e;a+=r){n[a]=h*t[a]/180;var o=Kh.RADIUS*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));if(o>h){o=h}else if(o<-h){o=-h}n[a+1]=o}return n};Kh.toEPSG4326=function(t,i,s){var e=t.length,r=s>1?s:2,n=i;if(n===undefined){if(r>2){n=t.slice()}else{n=new Array(e)}}for(var h=0;h<e;h+=r){n[h]=180*t[h]/Kh.HALF_SIZE;n[h+1]=360*Math.atan(Math.exp(t[h+1]/Kh.RADIUS))/Math.PI-90}return n};var $h={};$h.Projection_=function(t,i){Zh.call(this,{code:t,units:Hh.DEGREES,extent:$h.EXTENT,axisOrientation:i,global:true,metersPerUnit:$h.METERS_PER_UNIT,worldExtent:$h.EXTENT})};kh.inherits($h.Projection_,Zh);$h.RADIUS=6378137;$h.EXTENT=[-180,-90,180,90];$h.METERS_PER_UNIT=Math.PI*$h.RADIUS/180;$h.PROJECTIONS=[new $h.Projection_("CRS:84"),new $h.Projection_("EPSG:4326","neu"),new $h.Projection_("urn:ogc:def:crs:EPSG::4326","neu"),new $h.Projection_("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new $h.Projection_("urn:ogc:def:crs:OGC:1.3:CRS84"),new $h.Projection_("urn:ogc:def:crs:OGC:2:84"),new $h.Projection_("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new $h.Projection_("urn:x-ogc:def:crs:EPSG:4326","neu")];var Qh={};Qh.cache_={};Qh.clear=function(){Qh.cache_={}};Qh.get=function(t){var i=Qh.cache_;return i[t]||null};Qh.add=function(t,i){var s=Qh.cache_;s[t]=i};var ta={};ta.cache_={};ta.clear=function(){ta.cache_={}};ta.add=function(t,i,s){var e=t.getCode();var r=i.getCode();var n=ta.cache_;if(!(e in n)){n[e]={}}n[e][r]=s};ta.remove=function(t,i){var s=t.getCode();var e=i.getCode();var r=ta.cache_;var n=r[s][e];delete r[s][e];if(Ch.isEmpty(r[s])){delete r[s]}return n};ta.get=function(t,i){var s;var e=ta.cache_;if(t in e&&i in e[t]){s=e[t][i]}return s};var ia={};ia.METERS_PER_UNIT=Hh.METERS_PER_UNIT;ia.SPHERE_=new Wh(Wh.DEFAULT_RADIUS);if(kh.ENABLE_PROJ4JS){ia.setProj4=function(t){Jh.set(t)}}ia.getPointResolution=function(t,i,s,e){t=ia.get(t);var r;var n=t.getPointResolutionFunc();if(n){r=n(i,s)}else{var h=t.getUnits();if(h==Hh.DEGREES&&!e||e==Hh.DEGREES){r=i}else{var a=ia.getTransformFromProjections(t,ia.get("EPSG:4326"));var o=[s[0]-i/2,s[1],s[0]+i/2,s[1],s[0],s[1]-i/2,s[0],s[1]+i/2];o=a(o,o,2);var f=ia.SPHERE_.haversineDistance(o.slice(0,2),o.slice(2,4));var u=ia.SPHERE_.haversineDistance(o.slice(4,6),o.slice(6,8));r=(f+u)/2;var v=e?Hh.METERS_PER_UNIT[e]:t.getMetersPerUnit();if(v!==undefined){r/=v}}}return r};ia.addEquivalentProjections=function(t){ia.addProjections(t);t.forEach((function(i){t.forEach((function(t){if(i!==t){ta.add(i,t,ia.cloneTransform)}}))}))};ia.addEquivalentTransforms=function(t,i,s,e){t.forEach((function(t){i.forEach((function(i){ta.add(t,i,s);ta.add(i,t,e)}))}))};ia.addProjection=function(t){Qh.add(t.getCode(),t);ta.add(t,t,ia.cloneTransform)};ia.addProjections=function(t){t.forEach(ia.addProjection)};ia.clearAllProjections=function(){Qh.clear();ta.clear()};ia.createProjection=function(t,i){if(!t){return ia.get(i)}else if(typeof t==="string"){return ia.get(t)}else{return t}};ia.addCoordinateTransforms=function(t,i,s,e){var r=ia.get(t);var n=ia.get(i);ta.add(r,n,ia.createTransformFromCoordinateTransform(s));ta.add(n,r,ia.createTransformFromCoordinateTransform(e))};ia.createTransformFromCoordinateTransform=function(t){return function(i,s,e){var r=i.length;var n=e!==undefined?e:2;var h=s!==undefined?s:new Array(r);var a,o,f;for(o=0;o<r;o+=n){a=t([i[o],i[o+1]]);h[o]=a[0];h[o+1]=a[1];for(f=n-1;f>=2;--f){h[o+f]=i[o+f]}}return h}};ia.fromLonLat=function(t,i){return ia.transform(t,"EPSG:4326",i!==undefined?i:"EPSG:3857")};ia.toLonLat=function(t,i){var s=ia.transform(t,i!==undefined?i:"EPSG:3857","EPSG:4326");var e=s[0];if(e<-180||e>180){s[0]=Fh.modulo(e+180,360)-180}return s};ia.get=function(t){var i=null;if(t instanceof Zh){i=t}else if(typeof t==="string"){var s=t;i=Qh.get(s);if(kh.ENABLE_PROJ4JS&&!i){var e=Jh.get();if(typeof e=="function"&&e.defs(s)!==undefined){i=new Zh({code:s});ia.addProjection(i)}}}return i};ia.equivalent=function(t,i){if(t===i){return true}var s=t.getUnits()===i.getUnits();if(t.getCode()===i.getCode()){return s}else{var e=ia.getTransformFromProjections(t,i);return e===ia.cloneTransform&&s}};ia.getTransform=function(t,i){var s=ia.get(t);var e=ia.get(i);return ia.getTransformFromProjections(s,e)};ia.getTransformFromProjections=function(t,i){var s=t.getCode();var e=i.getCode();var r=ta.get(s,e);if(kh.ENABLE_PROJ4JS&&!r){var n=Jh.get();if(typeof n=="function"){var h=n.defs(s);var a=n.defs(e);if(h!==undefined&&a!==undefined){if(h===a){ia.addEquivalentProjections([i,t])}else{var o=n(e,s);ia.addCoordinateTransforms(i,t,o.forward,o.inverse)}r=ta.get(s,e)}}}if(!r){r=ia.identityTransform}return r};ia.identityTransform=function(t,i,s){if(i!==undefined&&t!==i){for(var e=0,r=t.length;e<r;++e){i[e]=t[e]}t=i}return t};ia.cloneTransform=function(t,i,s){var e;if(i!==undefined){for(var r=0,n=t.length;r<n;++r){i[r]=t[r]}e=i}else{e=t.slice()}return e};ia.transform=function(t,i,s){var e=ia.getTransform(i,s);return e(t,undefined,t.length)};ia.transformExtent=function(t,i,s){var e=ia.getTransform(i,s);return qh.applyTransform(t,e)};ia.transformWithProjections=function(t,i,s){var e=ia.getTransformFromProjections(i,s);return e(t)};ia.addCommon=function(){ia.addEquivalentProjections(Kh.PROJECTIONS);ia.addEquivalentProjections($h.PROJECTIONS);ia.addEquivalentTransforms($h.PROJECTIONS,Kh.PROJECTIONS,Kh.fromEPSG4326,Kh.toEPSG4326)};ia.addCommon();var sa={};sa.tmp_=new Array(6);sa.create=function(){return[1,0,0,1,0,0]};sa.reset=function(t){return sa.set(t,1,0,0,1,0,0)};sa.multiply=function(t,i){var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=t[4];var a=t[5];var o=i[0];var f=i[1];var u=i[2];var v=i[3];var l=i[4];var c=i[5];t[0]=s*o+r*f;t[1]=e*o+n*f;t[2]=s*u+r*v;t[3]=e*u+n*v;t[4]=s*l+r*c+h;t[5]=e*l+n*c+a;return t};sa.set=function(t,i,s,e,r,n,h){t[0]=i;t[1]=s;t[2]=e;t[3]=r;t[4]=n;t[5]=h;return t};sa.setFromArray=function(t,i){t[0]=i[0];t[1]=i[1];t[2]=i[2];t[3]=i[3];t[4]=i[4];t[5]=i[5];return t};sa.apply=function(t,i){var s=i[0],e=i[1];i[0]=t[0]*s+t[2]*e+t[4];i[1]=t[1]*s+t[3]*e+t[5];return i};sa.rotate=function(t,i){var s=Math.cos(i);var e=Math.sin(i);return sa.multiply(t,sa.set(sa.tmp_,s,e,-e,s,0,0))};sa.scale=function(t,i,s){return sa.multiply(t,sa.set(sa.tmp_,i,0,0,s,0,0))};sa.translate=function(t,i,s){return sa.multiply(t,sa.set(sa.tmp_,1,0,0,1,i,s))};sa.compose=function(t,i,s,e,r,n,h,a){var o=Math.sin(n);var f=Math.cos(n);t[0]=e*f;t[1]=r*o;t[2]=-e*o;t[3]=r*f;t[4]=h*e*f-a*e*o+i;t[5]=h*r*o+a*r*f+s;return t};sa.invert=function(t){var i=sa.determinant(t);Dh.assert(i!==0,32);var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=t[4];var a=t[5];t[0]=n/i;t[1]=-e/i;t[2]=-r/i;t[3]=s/i;t[4]=(r*a-n*h)/i;t[5]=-(s*a-e*h)/i;return t};sa.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};var ea=function(){Ph.call(this);this.extent_=qh.createEmpty();this.extentRevision_=-1;this.simplifiedGeometryCache={};this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=0;this.tmpTransform_=sa.create()};kh.inherits(ea,Ph);ea.prototype.clone=function(){};ea.prototype.closestPointXY=function(t,i,s,e){};ea.prototype.getClosestPoint=function(t,i){var s=i?i:[NaN,NaN];this.closestPointXY(t[0],t[1],s,Infinity);return s};ea.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])};ea.prototype.computeExtent=function(t){};ea.prototype.containsXY=Yh.FALSE;ea.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){this.extent_=this.computeExtent(this.extent_);this.extentRevision_=this.getRevision()}return qh.returnOrUpdate(this.extent_,t)};ea.prototype.rotate=function(t,i){};ea.prototype.scale=function(t,i,s){};ea.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)};ea.prototype.getSimplifiedGeometry=function(t){};ea.prototype.getType=function(){};ea.prototype.applyTransform=function(t){};ea.prototype.intersectsExtent=function(t){};ea.prototype.translate=function(t,i){};ea.prototype.transform=function(t,i){var s=this.tmpTransform_;t=ia.get(t);var e=t.getUnits()==Hh.TILE_PIXELS?function(e,r,n){var h=t.getExtent();var a=t.getWorldExtent();var o=qh.getHeight(a)/qh.getHeight(h);sa.compose(s,a[0],a[3],o,-o,0,0,0);Bh.transform2D(e,0,e.length,n,s,r);return ia.getTransform(t,i)(e,r,n)}:ia.getTransform(t,i);this.applyTransform(e);return this};var ra=function(){ea.call(this);this.layout=Xh.XY;this.stride=2;this.flatCoordinates=null};kh.inherits(ra,ea);ra.getLayoutForStride_=function(t){var i;if(t==2){i=Xh.XY}else if(t==3){i=Xh.XYZ}else if(t==4){i=Xh.XYZM}return i};ra.getStrideForLayout=function(t){var i;if(t==Xh.XY){i=2}else if(t==Xh.XYZ||t==Xh.XYM){i=3}else if(t==Xh.XYZM){i=4}return i};ra.prototype.containsXY=Yh.FALSE;ra.prototype.computeExtent=function(t){return qh.createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)};ra.prototype.getCoordinates=function(){};ra.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)};ra.prototype.getFlatCoordinates=function(){return this.flatCoordinates};ra.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)};ra.prototype.getLayout=function(){return this.layout};ra.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()){Ch.clear(this.simplifiedGeometryCache);this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=this.getRevision()}if(t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance){return this}var i=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(i)){return this.simplifiedGeometryCache[i]}else{var s=this.getSimplifiedGeometryInternal(t);var e=s.getFlatCoordinates();if(e.length<this.flatCoordinates.length){this.simplifiedGeometryCache[i]=s;return s}else{this.simplifiedGeometryMaxMinSquaredTolerance=t;return this}}};ra.prototype.getSimplifiedGeometryInternal=function(t){return this};ra.prototype.getStride=function(){return this.stride};ra.prototype.setFlatCoordinatesInternal=function(t,i){this.stride=ra.getStrideForLayout(t);this.layout=t;this.flatCoordinates=i};ra.prototype.setCoordinates=function(t,i){};ra.prototype.setLayout=function(t,i,s){var e;if(t){e=ra.getStrideForLayout(t)}else{var r;for(r=0;r<s;++r){if(i.length===0){this.layout=Xh.XY;this.stride=2;return}else{i=i[0]}}e=i.length;t=ra.getLayoutForStride_(e)}this.layout=t;this.stride=e};ra.prototype.applyTransform=function(t){if(this.flatCoordinates){t(this.flatCoordinates,this.flatCoordinates,this.stride);this.changed()}};ra.prototype.rotate=function(t,i){var s=this.getFlatCoordinates();if(s){var e=this.getStride();Bh.rotate(s,0,s.length,e,t,i,s);this.changed()}};ra.prototype.scale=function(t,i,s){var e=i;if(e===undefined){e=t}var r=s;if(!r){r=qh.getCenter(this.getExtent())}var n=this.getFlatCoordinates();if(n){var h=this.getStride();Bh.scale(n,0,n.length,h,t,e,r,n);this.changed()}};ra.prototype.translate=function(t,i){var s=this.getFlatCoordinates();if(s){var e=this.getStride();Bh.translate(s,0,s.length,e,t,i,s);this.changed()}};ra.transform2D=function(t,i,s){var e=t.getFlatCoordinates();if(!e){return null}else{var r=t.getStride();return Bh.transform2D(e,0,e.length,r,i,s)}};var na={};na.linearRing=function(t,i,s,e){var r=0;var n=t[s-e];var h=t[s-e+1];for(;i<s;i+=e){var a=t[i];var o=t[i+1];r+=h*a-n*o;n=a;h=o}return r/2};na.linearRings=function(t,i,s,e){var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r+=na.linearRing(t,i,a,e);i=a}return r};na.linearRingss=function(t,i,s,e){var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r+=na.linearRings(t,i,a,e);i=a[a.length-1]}return r};var ha={};ha.point=function(t,i,s,e,r,n,h){var a=t[i];var o=t[i+1];var f=t[s]-a;var u=t[s+1]-o;var v,l;if(f===0&&u===0){l=i}else{var c=((r-a)*f+(n-o)*u)/(f*f+u*u);if(c>1){l=s}else if(c>0){for(v=0;v<e;++v){h[v]=Fh.lerp(t[i+v],t[s+v],c)}h.length=e;return}else{l=i}}for(v=0;v<e;++v){h[v]=t[l+v]}h.length=e};ha.getMaxSquaredDelta=function(t,i,s,e,r){var n=t[i];var h=t[i+1];for(i+=e;i<s;i+=e){var a=t[i];var o=t[i+1];var f=Fh.squaredDistance(n,h,a,o);if(f>r){r=f}n=a;h=o}return r};ha.getsMaxSquaredDelta=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r=ha.getMaxSquaredDelta(t,i,a,e,r);i=a}return r};ha.getssMaxSquaredDelta=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r=ha.getsMaxSquaredDelta(t,i,a,e,r);i=a[a.length-1]}return r};ha.getClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){if(i==s){return f}var v,l;if(r===0){l=Fh.squaredDistance(h,a,t[i],t[i+1]);if(l<f){for(v=0;v<e;++v){o[v]=t[i+v]}o.length=e;return l}else{return f}}var c=u?u:[NaN,NaN];var d=i+e;while(d<s){ha.point(t,d-e,d,e,h,a,c);l=Fh.squaredDistance(h,a,c[0],c[1]);if(l<f){f=l;for(v=0;v<e;++v){o[v]=c[v]}o.length=e;d+=e}else{d+=e*Math.max((Math.sqrt(l)-Math.sqrt(f))/r|0,1)}}if(n){ha.point(t,s-e,i,e,h,a,c);l=Fh.squaredDistance(h,a,c[0],c[1]);if(l<f){f=l;for(v=0;v<e;++v){o[v]=c[v]}o.length=e}}return f};ha.getsClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){var v=u?u:[NaN,NaN];var l,c;for(l=0,c=s.length;l<c;++l){var d=s[l];f=ha.getClosestPoint(t,i,d,e,r,n,h,a,o,f,v);i=d}return f};ha.getssClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){var v=u?u:[NaN,NaN];var l,c;for(l=0,c=s.length;l<c;++l){var d=s[l];f=ha.getsClosestPoint(t,i,d,e,r,n,h,a,o,f,v);i=d[d.length-1]}return f};var aa={};aa.coordinate=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){t[i++]=s[r]}return i};aa.coordinates=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){var h=s[r];var a;for(a=0;a<e;++a){t[i++]=h[a]}}return i};aa.coordinatess=function(t,i,s,e,r){var n=r?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=aa.coordinates(t,i,s[a],e);n[h++]=f;i=f}n.length=h;return n};aa.coordinatesss=function(t,i,s,e,r){var n=r?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=aa.coordinatess(t,i,s[a],e,n[h]);n[h++]=f;i=f[f.length-1]}n.length=h;return n};var oa={};oa.coordinates=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a;for(a=i;a<s;a+=e){n[h++]=t.slice(a,a+e)}n.length=h;return n};oa.coordinatess=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=s[a];n[h++]=oa.coordinates(t,i,f,e,n[h]);i=f}n.length=h;return n};oa.coordinatesss=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=s[a];n[h++]=oa.coordinatess(t,i,f,e,n[h]);i=f[f.length-1]}n.length=h;return n};var fa={};fa.lineString=function(t,i,s,e,r,n,h){var a=h!==undefined?h:[];if(!n){s=fa.radialDistance(t,i,s,e,r,a,0);t=a;i=0;e=2}a.length=fa.douglasPeucker(t,i,s,e,r,a,0);return a};fa.douglasPeucker=function(t,i,s,e,r,n,h){var a=(s-i)/e;if(a<3){for(;i<s;i+=e){n[h++]=t[i];n[h++]=t[i+1]}return h}var o=new Array(a);o[0]=1;o[a-1]=1;var f=[i,s-e];var u=0;var v;while(f.length>0){var l=f.pop();var c=f.pop();var d=0;var m=t[c];var p=t[c+1];var M=t[l];var z=t[l+1];for(v=c+e;v<l;v+=e){var _=t[v];var g=t[v+1];var w=Fh.squaredSegmentDistance(_,g,m,p,M,z);if(w>d){u=v;d=w}}if(d>r){o[(u-i)/e]=1;if(c+e<u){f.push(c,u)}if(u+e<l){f.push(u,l)}}}for(v=0;v<a;++v){if(o[v]){n[h++]=t[i+v*e];n[h++]=t[i+v*e+1]}}return h};fa.douglasPeuckers=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];h=fa.douglasPeucker(t,i,u,e,r,n,h);a.push(h);i=u}return h};fa.douglasPeuckerss=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];var v=[];h=fa.douglasPeuckers(t,i,u,e,r,n,h,v);a.push(v);i=u[u.length-1]}return h};fa.radialDistance=function(t,i,s,e,r,n,h){if(s<=i+e){for(;i<s;i+=e){n[h++]=t[i];n[h++]=t[i+1]}return h}var a=t[i];var o=t[i+1];n[h++]=a;n[h++]=o;var f=a;var u=o;for(i+=e;i<s;i+=e){f=t[i];u=t[i+1];if(Fh.squaredDistance(a,o,f,u)>r){n[h++]=f;n[h++]=u;a=f;o=u}}if(f!=a||u!=o){n[h++]=f;n[h++]=u}return h};fa.snap=function(t,i){return i*Math.round(t/i)};fa.quantize=function(t,i,s,e,r,n,h){if(i==s){return h}var a=fa.snap(t[i],r);var o=fa.snap(t[i+1],r);i+=e;n[h++]=a;n[h++]=o;var f,u;do{f=fa.snap(t[i],r);u=fa.snap(t[i+1],r);i+=e;if(i==s){n[h++]=f;n[h++]=u;return h}}while(f==a&&u==o);while(i<s){var v,l;v=fa.snap(t[i],r);l=fa.snap(t[i+1],r);i+=e;if(v==f&&l==u){continue}var c=f-a;var d=u-o;var m=v-a;var p=l-o;if(c*p==d*m&&(c<0&&m<c||c==m||c>0&&m>c)&&(d<0&&p<d||d==p||d>0&&p>d)){f=v;u=l;continue}n[h++]=f;n[h++]=u;a=f;o=u;f=v;u=l}n[h++]=f;n[h++]=u;return h};fa.quantizes=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];h=fa.quantize(t,i,u,e,r,n,h);a.push(h);i=u}return h};fa.quantizess=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];var v=[];h=fa.quantizes(t,i,u,e,r,n,h,v);a.push(v);i=u[u.length-1]}return h};var ua=function(t,i){ra.call(this);this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.setCoordinates(t,i)};kh.inherits(ua,ra);ua.prototype.clone=function(){var t=new ua(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};ua.prototype.closestPointXY=function(t,i,s,e){if(e<qh.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(ha.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return ha.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,true,t,i,s,e)};ua.prototype.getArea=function(){return na.linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};ua.prototype.getCoordinates=function(){return oa.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};ua.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=fa.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new ua(null);s.setFlatCoordinates(Xh.XY,i);return s};ua.prototype.getType=function(){return Gh.LINEAR_RING};ua.prototype.intersectsExtent=function(t){};ua.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(Xh.XY,null)}else{this.setLayout(i,t,1);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=aa.coordinates(this.flatCoordinates,0,t,this.stride);this.changed()}};ua.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var va=function(t,i){ra.call(this);this.setCoordinates(t,i)};kh.inherits(va,ra);va.prototype.clone=function(){var t=new va(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};va.prototype.closestPointXY=function(t,i,s,e){var r=this.flatCoordinates;var n=Fh.squaredDistance(t,i,r[0],r[1]);if(n<e){var h=this.stride;var a;for(a=0;a<h;++a){s[a]=r[a]}s.length=h;return n}else{return e}};va.prototype.getCoordinates=function(){return!this.flatCoordinates?[]:this.flatCoordinates.slice()};va.prototype.computeExtent=function(t){return qh.createOrUpdateFromCoordinate(this.flatCoordinates,t)};va.prototype.getType=function(){return Gh.POINT};va.prototype.intersectsExtent=function(t){return qh.containsXY(t,this.flatCoordinates[0],this.flatCoordinates[1])};va.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(Xh.XY,null)}else{this.setLayout(i,t,0);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=aa.coordinate(this.flatCoordinates,0,t,this.stride);this.changed()}};va.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var la={};la.linearRingContainsExtent=function(t,i,s,e,r){var n=qh.forEachCorner(r,(function(r){return!la.linearRingContainsXY(t,i,s,e,r[0],r[1])}));return!n};la.linearRingContainsXY=function(t,i,s,e,r,n){var h=0;var a=t[s-e];var o=t[s-e+1];for(;i<s;i+=e){var f=t[i];var u=t[i+1];if(o<=n){if(u>n&&(f-a)*(n-o)-(r-a)*(u-o)>0){h++}}else if(u<=n&&(f-a)*(n-o)-(r-a)*(u-o)<0){h--}a=f;o=u}return h!==0};la.linearRingsContainsXY=function(t,i,s,e,r,n){if(s.length===0){return false}if(!la.linearRingContainsXY(t,i,s[0],e,r,n)){return false}var h,a;for(h=1,a=s.length;h<a;++h){if(la.linearRingContainsXY(t,s[h-1],s[h],e,r,n)){return false}}return true};la.linearRingssContainsXY=function(t,i,s,e,r,n){if(s.length===0){return false}var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];if(la.linearRingsContainsXY(t,i,o,e,r,n)){return true}i=o[o.length-1]}return false};var ca={};ca.linearRings=function(t,i,s,e,r,n,h){var a,o,f,u,v,l,c;var d=r[n+1];var m=[];for(var p=0,M=s.length;p<M;++p){var z=s[p];u=t[z-e];l=t[z-e+1];for(a=i;a<z;a+=e){v=t[a];c=t[a+1];if(d<=l&&c<=d||l<=d&&d<=c){f=(d-l)/(c-l)*(v-u)+u;m.push(f)}u=v;l=c}}var _=NaN;var g=-Infinity;m.sort(jh.numberSafeCompareFunction);u=m[0];for(a=1,o=m.length;a<o;++a){v=m[a];var w=Math.abs(v-u);if(w>g){f=(u+v)/2;if(la.linearRingsContainsXY(t,i,s,e,f,d)){_=f;g=w}}u=v}if(isNaN(_)){_=r[n]}if(h){h.push(_,d,g);return h}else{return[_,d,g]}};ca.linearRingss=function(t,i,s,e,r){var n=[];var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];n=ca.linearRings(t,i,o,e,r,2*h,n);i=o[o.length-1]}return n};var da={};da.forEach=function(t,i,s,e,r,n){var h=[t[i],t[i+1]];var a=[];var o;for(;i+e<s;i+=e){a[0]=t[i+e];a[1]=t[i+e+1];o=r.call(n,h,a);if(o){return o}h[0]=a[0];h[1]=a[1]}return false};var ma={};ma.lineString=function(t,i,s,e,r){var n=qh.extendFlatCoordinates(qh.createEmpty(),t,i,s,e);if(!qh.intersects(r,n)){return false}if(qh.containsExtent(r,n)){return true}if(n[0]>=r[0]&&n[2]<=r[2]){return true}if(n[1]>=r[1]&&n[3]<=r[3]){return true}return da.forEach(t,i,s,e,(function(t,i){return qh.intersectsSegment(r,t,i)}))};ma.lineStrings=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){if(ma.lineString(t,i,s[n],e,r)){return true}i=s[n]}return false};ma.linearRing=function(t,i,s,e,r){if(ma.lineString(t,i,s,e,r)){return true}if(la.linearRingContainsXY(t,i,s,e,r[0],r[1])){return true}if(la.linearRingContainsXY(t,i,s,e,r[0],r[3])){return true}if(la.linearRingContainsXY(t,i,s,e,r[2],r[1])){return true}if(la.linearRingContainsXY(t,i,s,e,r[2],r[3])){return true}return false};ma.linearRings=function(t,i,s,e,r){if(!ma.linearRing(t,i,s[0],e,r)){return false}if(s.length===1){return true}var n,h;for(n=1,h=s.length;n<h;++n){if(la.linearRingContainsExtent(t,s[n-1],s[n],e,r)){return false}}return true};ma.linearRingss=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];if(ma.linearRings(t,i,a,e,r)){return true}i=a[a.length-1]}return false};var pa={};pa.coordinates=function(t,i,s,e){while(i<s-e){var r;for(r=0;r<e;++r){var n=t[i+r];t[i+r]=t[s-e+r];t[s-e+r]=n}i+=e;s-=e}};var Ma={};Ma.linearRingIsClockwise=function(t,i,s,e){var r=0;var n=t[s-e];var h=t[s-e+1];for(;i<s;i+=e){var a=t[i];var o=t[i+1];r+=(a-n)*(o+h);n=a;h=o}return r>0};Ma.linearRingsAreOriented=function(t,i,s,e,r){var n=r!==undefined?r:false;var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];var f=Ma.linearRingIsClockwise(t,i,o,e);if(h===0){if(n&&f||!n&&!f){return false}}else{if(n&&!f||!n&&f){return false}}i=o}return true};Ma.linearRingssAreOriented=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){if(!Ma.linearRingsAreOriented(t,i,s[n],e,r)){return false}}return true};Ma.orientLinearRings=function(t,i,s,e,r){var n=r!==undefined?r:false;var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];var f=Ma.linearRingIsClockwise(t,i,o,e);var u=h===0?n&&f||!n&&!f:n&&!f||!n&&f;if(u){pa.coordinates(t,i,o,e)}i=o}return i};Ma.orientLinearRingss=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){i=Ma.orientLinearRings(t,i,s[n],e,r)}return i};var za=function(t,i){ra.call(this);this.ends_=[];this.flatInteriorPointRevision_=-1;this.flatInteriorPoint_=null;this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.orientedRevision_=-1;this.orientedFlatCoordinates_=null;this.setCoordinates(t,i)};kh.inherits(za,ra);za.prototype.appendLinearRing=function(t){if(!this.flatCoordinates){this.flatCoordinates=t.getFlatCoordinates().slice()}else{jh.extend(this.flatCoordinates,t.getFlatCoordinates())}this.ends_.push(this.flatCoordinates.length);this.changed()};za.prototype.clone=function(){var t=new za(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice());return t};za.prototype.closestPointXY=function(t,i,s,e){if(e<qh.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(ha.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return ha.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,true,t,i,s,e)};za.prototype.containsXY=function(t,i){return la.linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)};za.prototype.getArea=function(){return na.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)};za.prototype.getCoordinates=function(t){var i;if(t!==undefined){i=this.getOrientedFlatCoordinates().slice();Ma.orientLinearRings(i,0,this.ends_,this.stride,t)}else{i=this.flatCoordinates}return oa.coordinatess(i,0,this.ends_,this.stride)};za.prototype.getEnds=function(){return this.ends_};za.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=qh.getCenter(this.getExtent());this.flatInteriorPoint_=ca.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0);this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_};za.prototype.getInteriorPoint=function(){return new va(this.getFlatInteriorPoint(),Xh.XYM)};za.prototype.getLinearRingCount=function(){return this.ends_.length};za.prototype.getLinearRing=function(t){if(t<0||this.ends_.length<=t){return null}var i=new ua(null);i.setFlatCoordinates(this.layout,this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]));return i};za.prototype.getLinearRings=function(){var t=this.layout;var i=this.flatCoordinates;var s=this.ends_;var e=[];var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];var o=new ua(null);o.setFlatCoordinates(t,i.slice(r,a));e.push(o);r=a}return e};za.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;if(Ma.linearRingsAreOriented(t,0,this.ends_,this.stride)){this.orientedFlatCoordinates_=t}else{this.orientedFlatCoordinates_=t.slice();this.orientedFlatCoordinates_.length=Ma.orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)}this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_};za.prototype.getSimplifiedGeometryInternal=function(t){var i=[];var s=[];i.length=fa.quantizes(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,s);var e=new za(null);e.setFlatCoordinates(Xh.XY,i,s);return e};za.prototype.getType=function(){return Gh.POLYGON};za.prototype.intersectsExtent=function(t){return ma.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)};za.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(Xh.XY,null,this.ends_)}else{this.setLayout(i,t,2);if(!this.flatCoordinates){this.flatCoordinates=[]}var s=aa.coordinatess(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=s.length===0?0:s[s.length-1];this.changed()}};za.prototype.setFlatCoordinates=function(t,i,s){this.setFlatCoordinatesInternal(t,i);this.ends_=s;this.changed()};za.circular=function(t,i,s,e){var r=e?e:32;var n=[];var h;for(h=0;h<r;++h){jh.extend(n,t.offset(i,s,2*Math.PI*h/r))}n.push(n[0],n[1]);var a=new za(null);a.setFlatCoordinates(Xh.XY,n,[n.length]);return a};za.fromExtent=function(t){var i=t[0];var s=t[1];var e=t[2];var r=t[3];var n=[i,s,i,r,e,r,e,s,i,s];var h=new za(null);h.setFlatCoordinates(Xh.XY,n,[n.length]);return h};za.fromCircle=function(t,i,s){var e=i?i:32;var r=t.getStride();var n=t.getLayout();var h=new za(null,n);var a=r*(e+1);var o=new Array(a);for(var f=0;f<a;f++){o[f]=0}var u=[o.length];h.setFlatCoordinates(n,o,u);za.makeRegular(h,t.getCenter(),t.getRadius(),s);return h};za.makeRegular=function(t,i,s,e){var r=t.getFlatCoordinates();var n=t.getLayout();var h=t.getStride();var a=t.getEnds();var o=r.length/h-1;var f=e?e:0;var u,v;for(var l=0;l<=o;++l){v=l*h;u=f+Fh.modulo(l,o)*2*Math.PI/o;r[v]=i[0]+s*Math.cos(u);r[v+1]=i[1]+s*Math.sin(u)}t.setFlatCoordinates(n,r,a)};var _a={};_a.ONE=1;_a.SRC_ALPHA=770;_a.COLOR_ATTACHMENT0=36064;_a.COLOR_BUFFER_BIT=16384;_a.TRIANGLES=4;_a.TRIANGLE_STRIP=5;_a.ONE_MINUS_SRC_ALPHA=771;_a.ARRAY_BUFFER=34962;_a.ELEMENT_ARRAY_BUFFER=34963;_a.STREAM_DRAW=35040;_a.STATIC_DRAW=35044;_a.DYNAMIC_DRAW=35048;_a.CULL_FACE=2884;_a.BLEND=3042;_a.STENCIL_TEST=2960;_a.DEPTH_TEST=2929;_a.SCISSOR_TEST=3089;_a.UNSIGNED_BYTE=5121;_a.UNSIGNED_SHORT=5123;_a.UNSIGNED_INT=5125;_a.FLOAT=5126;_a.RGBA=6408;_a.FRAGMENT_SHADER=35632;_a.VERTEX_SHADER=35633;_a.LINK_STATUS=35714;_a.LINEAR=9729;_a.TEXTURE_MAG_FILTER=10240;_a.TEXTURE_MIN_FILTER=10241;_a.TEXTURE_WRAP_S=10242;_a.TEXTURE_WRAP_T=10243;_a.TEXTURE_2D=3553;_a.TEXTURE0=33984;_a.CLAMP_TO_EDGE=33071;_a.COMPILE_STATUS=35713;_a.FRAMEBUFFER=36160;_a.CONTEXT_IDS_=["experimental-webgl","webgl","webkit-3d","moz-webgl"];_a.getContext=function(t,i){var s,e,r=_a.CONTEXT_IDS_.length;for(e=0;e<r;++e){try{s=t.getContext(_a.CONTEXT_IDS_[e],i);if(s){return s}}catch(t){}}return null};var ga={};var wa=typeof navigator!=="undefined"?navigator.userAgent.toLowerCase():"";ga.FIREFOX=wa.indexOf("firefox")!==-1;ga.SAFARI=wa.indexOf("safari")!==-1&&wa.indexOf("chrom")==-1;ga.WEBKIT=wa.indexOf("webkit")!==-1&&wa.indexOf("edge")==-1;ga.MAC=wa.indexOf("macintosh")!==-1;ga.DEVICE_PIXEL_RATIO=window.devicePixelRatio||1;ga.CANVAS_LINE_DASH=false;ga.CANVAS=kh.ENABLE_CANVAS&&function(){if(!("HTMLCanvasElement"in window)){return false}try{var t=document.createElement("CANVAS").getContext("2d");if(!t){return false}else{if(t.setLineDash!==undefined){ga.CANVAS_LINE_DASH=true}return true}}catch(t){return false}}();ga.DEVICE_ORIENTATION="DeviceOrientationEvent"in window;ga.GEOLOCATION="geolocation"in navigator;ga.TOUCH=kh.ASSUME_TOUCH||"ontouchstart"in window;ga.POINTER="PointerEvent"in window;ga.MSPOINTER=!!navigator.msPointerEnabled;(function(){if(kh.ENABLE_WEBGL){var t=false;var i;var s=[];if("WebGLRenderingContext"in window){try{var e=document.createElement("CANVAS");var r=_a.getContext(e,{failIfMajorPerformanceCaveat:true});if(r){t=true;i=r.getParameter(r.MAX_TEXTURE_SIZE);s=r.getSupportedExtensions()}}catch(t){}}ga.WEBGL=t;kh.WEBGL_EXTENSIONS=s;kh.WEBGL_MAX_TEXTURE_SIZE=i}})();var ya=function(t){Ph.call(this);var i=t||{};this.position_=null;this.transform_=ia.identityTransform;this.sphere_=new Wh($h.RADIUS);this.watchId_=undefined;Ih.listen(this,Ph.getChangeEventType(Eh.PROJECTION),this.handleProjectionChanged_,this);Ih.listen(this,Ph.getChangeEventType(Eh.TRACKING),this.handleTrackingChanged_,this);if(i.projection!==undefined){this.setProjection(i.projection)}if(i.trackingOptions!==undefined){this.setTrackingOptions(i.trackingOptions)}this.setTracking(i.tracking!==undefined?i.tracking:false)};kh.inherits(ya,Ph);ya.prototype.disposeInternal=function(){this.setTracking(false);Ph.prototype.disposeInternal.call(this)};ya.prototype.handleProjectionChanged_=function(){var t=this.getProjection();if(t){this.transform_=ia.getTransformFromProjections(ia.get("EPSG:4326"),t);if(this.position_){this.set(Eh.POSITION,this.transform_(this.position_))}}};ya.prototype.handleTrackingChanged_=function(){if(ga.GEOLOCATION){var t=this.getTracking();if(t&&this.watchId_===undefined){this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions())}else if(!t&&this.watchId_!==undefined){navigator.geolocation.clearWatch(this.watchId_);this.watchId_=undefined}}};ya.prototype.positionChange_=function(t){var i=t.coords;this.set(Eh.ACCURACY,i.accuracy);this.set(Eh.ALTITUDE,i.altitude===null?undefined:i.altitude);this.set(Eh.ALTITUDE_ACCURACY,i.altitudeAccuracy===null?undefined:i.altitudeAccuracy);this.set(Eh.HEADING,i.heading===null?undefined:Fh.toRadians(i.heading));if(!this.position_){this.position_=[i.longitude,i.latitude]}else{this.position_[0]=i.longitude;this.position_[1]=i.latitude}var s=this.transform_(this.position_);this.set(Eh.POSITION,s);this.set(Eh.SPEED,i.speed===null?undefined:i.speed);var e=za.circular(this.sphere_,this.position_,i.accuracy);e.applyTransform(this.transform_);this.set(Eh.ACCURACY_GEOMETRY,e);this.changed()};ya.prototype.positionError_=function(t){t.type=Ah.ERROR;this.setTracking(false);this.dispatchEvent(t)};ya.prototype.getAccuracy=function(){return this.get(Eh.ACCURACY)};ya.prototype.getAccuracyGeometry=function(){return this.get(Eh.ACCURACY_GEOMETRY)||null};ya.prototype.getAltitude=function(){return this.get(Eh.ALTITUDE)};ya.prototype.getAltitudeAccuracy=function(){return this.get(Eh.ALTITUDE_ACCURACY)};ya.prototype.getHeading=function(){return this.get(Eh.HEADING)};ya.prototype.getPosition=function(){return this.get(Eh.POSITION)};ya.prototype.getProjection=function(){return this.get(Eh.PROJECTION)};ya.prototype.getSpeed=function(){return this.get(Eh.SPEED)};ya.prototype.getTracking=function(){return this.get(Eh.TRACKING)};ya.prototype.getTrackingOptions=function(){return this.get(Eh.TRACKING_OPTIONS)};ya.prototype.setProjection=function(t){this.set(Eh.PROJECTION,ia.get(t))};ya.prototype.setTracking=function(t){this.set(Eh.TRACKING,t)};ya.prototype.setTrackingOptions=function(t){this.set(Eh.TRACKING_OPTIONS,t)};var ba={ADD:"add",REMOVE:"remove"};var xa=function(t,i){Ph.call(this);var s=i||{};this.unique_=!!s.unique;this.array_=t?t:[];if(this.unique_){for(var e=0,r=this.array_.length;e<r;++e){this.assertUnique_(this.array_[e],e)}}this.updateLength_()};kh.inherits(xa,Ph);xa.prototype.clear=function(){while(this.getLength()>0){this.pop()}};xa.prototype.extend=function(t){var i,s;for(i=0,s=t.length;i<s;++i){this.push(t[i])}return this};xa.prototype.forEach=function(t,i){var s=i?t.bind(i):t;var e=this.array_;for(var r=0,n=e.length;r<n;++r){s(e[r],r,e)}};xa.prototype.getArray=function(){return this.array_};xa.prototype.item=function(t){return this.array_[t]};xa.prototype.getLength=function(){return this.get(xa.Property_.LENGTH)};xa.prototype.insertAt=function(t,i){if(this.unique_){this.assertUnique_(i)}this.array_.splice(t,0,i);this.updateLength_();this.dispatchEvent(new xa.Event(ba.ADD,i))};xa.prototype.pop=function(){return this.removeAt(this.getLength()-1)};xa.prototype.push=function(t){if(this.unique_){this.assertUnique_(t)}var i=this.getLength();this.insertAt(i,t);return this.getLength()};xa.prototype.remove=function(t){var i=this.array_;var s,e;for(s=0,e=i.length;s<e;++s){if(i[s]===t){return this.removeAt(s)}}return undefined};xa.prototype.removeAt=function(t){var i=this.array_[t];this.array_.splice(t,1);this.updateLength_();this.dispatchEvent(new xa.Event(ba.REMOVE,i));return i};xa.prototype.setAt=function(t,i){var s=this.getLength();if(t<s){if(this.unique_){this.assertUnique_(i,t)}var e=this.array_[t];this.array_[t]=i;this.dispatchEvent(new xa.Event(ba.REMOVE,e));this.dispatchEvent(new xa.Event(ba.ADD,i))}else{var r;for(r=s;r<t;++r){this.insertAt(r,undefined)}this.insertAt(t,i)}};xa.prototype.updateLength_=function(){this.set(xa.Property_.LENGTH,this.array_.length)};xa.prototype.assertUnique_=function(t,i){for(var s=0,e=this.array_.length;s<e;++s){if(this.array_[s]===t&&s!==i){throw new Lh(58)}}};xa.Property_={LENGTH:"length"};xa.Event=function(t,i){Oh.call(this,t);this.element=i};kh.inherits(xa.Event,Oh);var ka=function(t,i,s){Oh.call(this,t);this.map=i;this.frameState=s!==undefined?s:null};kh.inherits(ka,Oh);var Ea=function(t,i,s,e,r){ka.call(this,t,i,r);this.originalEvent=s;this.pixel=i.getEventPixel(s);this.coordinate=i.getCoordinateFromPixel(this.pixel);this.dragging=e!==undefined?e:false};kh.inherits(Ea,ka);Ea.prototype.preventDefault=function(){ka.prototype.preventDefault.call(this);this.originalEvent.preventDefault()};Ea.prototype.stopPropagation=function(){ka.prototype.stopPropagation.call(this);this.originalEvent.stopPropagation()};var Na={SINGLECLICK:"singleclick",CLICK:Ah.CLICK,DBLCLICK:Ah.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var Ca=function(t,i,s,e,r){Ea.call(this,t,i,s.originalEvent,e,r);this.pointerEvent=s};kh.inherits(Ca,Ea);var Ia={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var Sa=function(t,i){this.dispatcher=t;this.mapping_=i};Sa.prototype.getEvents=function(){return Object.keys(this.mapping_)};Sa.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var Oa=function(t){var i={mousedown:this.mousedown,mousemove:this.mousemove,mouseup:this.mouseup,mouseover:this.mouseover,mouseout:this.mouseout};Sa.call(this,t,i);this.pointerMap=t.pointerMap;this.lastTouches=[]};kh.inherits(Oa,Sa);Oa.POINTER_ID=1;Oa.POINTER_TYPE="mouse";Oa.DEDUP_DIST=25;Oa.prototype.isEventSimulatedFromTouch_=function(t){var i=this.lastTouches;var s=t.clientX,e=t.clientY;for(var r=0,n=i.length,h;r<n&&(h=i[r]);r++){var a=Math.abs(s-h[0]),o=Math.abs(e-h[1]);if(a<=Oa.DEDUP_DIST&&o<=Oa.DEDUP_DIST){return true}}return false};Oa.prepareEvent=function(t,i){var s=i.cloneEvent(t,t);var e=s.preventDefault;s.preventDefault=function(){t.preventDefault();e()};s.pointerId=Oa.POINTER_ID;s.isPrimary=true;s.pointerType=Oa.POINTER_TYPE;return s};Oa.prototype.mousedown=function(t){if(!this.isEventSimulatedFromTouch_(t)){if(Oa.POINTER_ID.toString()in this.pointerMap){this.cancel(t)}var i=Oa.prepareEvent(t,this.dispatcher);this.pointerMap[Oa.POINTER_ID.toString()]=t;this.dispatcher.down(i,t)}};Oa.prototype.mousemove=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Oa.prepareEvent(t,this.dispatcher);this.dispatcher.move(i,t)}};Oa.prototype.mouseup=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=this.pointerMap[Oa.POINTER_ID.toString()];if(i&&i.button===t.button){var s=Oa.prepareEvent(t,this.dispatcher);this.dispatcher.up(s,t);this.cleanupMouse()}}};Oa.prototype.mouseover=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Oa.prepareEvent(t,this.dispatcher);this.dispatcher.enterOver(i,t)}};Oa.prototype.mouseout=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Oa.prepareEvent(t,this.dispatcher);this.dispatcher.leaveOut(i,t)}};Oa.prototype.cancel=function(t){var i=Oa.prepareEvent(t,this.dispatcher);this.dispatcher.cancel(i,t);this.cleanupMouse()};Oa.prototype.cleanupMouse=function(){delete this.pointerMap[Oa.POINTER_ID.toString()]};var Ta=function(t){var i={MSPointerDown:this.msPointerDown,MSPointerMove:this.msPointerMove,MSPointerUp:this.msPointerUp,MSPointerOut:this.msPointerOut,MSPointerOver:this.msPointerOver,MSPointerCancel:this.msPointerCancel,MSGotPointerCapture:this.msGotPointerCapture,MSLostPointerCapture:this.msLostPointerCapture};Sa.call(this,t,i);this.pointerMap=t.pointerMap;this.POINTER_TYPES=["","unavailable","touch","pen","mouse"]};kh.inherits(Ta,Sa);Ta.prototype.prepareEvent_=function(t){var i=t;if(typeof t.pointerType==="number"){i=this.dispatcher.cloneEvent(t,t);i.pointerType=this.POINTER_TYPES[t.pointerType]}return i};Ta.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]};Ta.prototype.msPointerDown=function(t){this.pointerMap[t.pointerId.toString()]=t;var i=this.prepareEvent_(t);this.dispatcher.down(i,t)};Ta.prototype.msPointerMove=function(t){var i=this.prepareEvent_(t);this.dispatcher.move(i,t)};Ta.prototype.msPointerUp=function(t){var i=this.prepareEvent_(t);this.dispatcher.up(i,t);this.cleanup(t.pointerId)};Ta.prototype.msPointerOut=function(t){var i=this.prepareEvent_(t);this.dispatcher.leaveOut(i,t)};Ta.prototype.msPointerOver=function(t){var i=this.prepareEvent_(t);this.dispatcher.enterOver(i,t)};Ta.prototype.msPointerCancel=function(t){var i=this.prepareEvent_(t);this.dispatcher.cancel(i,t);this.cleanup(t.pointerId)};Ta.prototype.msLostPointerCapture=function(t){var i=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(i)};Ta.prototype.msGotPointerCapture=function(t){var i=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(i)};var Aa=function(t){var i={pointerdown:this.pointerDown,pointermove:this.pointerMove,pointerup:this.pointerUp,pointerout:this.pointerOut,pointerover:this.pointerOver,pointercancel:this.pointerCancel,gotpointercapture:this.gotPointerCapture,lostpointercapture:this.lostPointerCapture};Sa.call(this,t,i)};kh.inherits(Aa,Sa);Aa.prototype.pointerDown=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.pointerMove=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.pointerUp=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.pointerOut=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.pointerOver=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.pointerCancel=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.lostPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.gotPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};var Ra=function(t,i,s){Oh.call(this,t);this.originalEvent=i;var e=s?s:{};this.buttons=this.getButtons_(e);this.pressure=this.getPressure_(e,this.buttons);this.bubbles="bubbles"in e?e["bubbles"]:false;this.cancelable="cancelable"in e?e["cancelable"]:false;this.view="view"in e?e["view"]:null;this.detail="detail"in e?e["detail"]:null;this.screenX="screenX"in e?e["screenX"]:0;this.screenY="screenY"in e?e["screenY"]:0;this.clientX="clientX"in e?e["clientX"]:0;this.clientY="clientY"in e?e["clientY"]:0;this.ctrlKey="ctrlKey"in e?e["ctrlKey"]:false;this.altKey="altKey"in e?e["altKey"]:false;this.shiftKey="shiftKey"in e?e["shiftKey"]:false;this.metaKey="metaKey"in e?e["metaKey"]:false;this.button="button"in e?e["button"]:0;this.relatedTarget="relatedTarget"in e?e["relatedTarget"]:null;this.pointerId="pointerId"in e?e["pointerId"]:0;this.width="width"in e?e["width"]:0;this.height="height"in e?e["height"]:0;this.tiltX="tiltX"in e?e["tiltX"]:0;this.tiltY="tiltY"in e?e["tiltY"]:0;this.pointerType="pointerType"in e?e["pointerType"]:"";this.hwTimestamp="hwTimestamp"in e?e["hwTimestamp"]:0;this.isPrimary="isPrimary"in e?e["isPrimary"]:false;if(i.preventDefault){this.preventDefault=function(){i.preventDefault()}}};kh.inherits(Ra,Oh);Ra.prototype.getButtons_=function(t){var i;if(t.buttons||Ra.HAS_BUTTONS){i=t.buttons}else{switch(t.which){case 1:i=1;break;case 2:i=4;break;case 3:i=2;break;default:i=0}}return i};Ra.prototype.getPressure_=function(t,i){var s=0;if(t.pressure){s=t.pressure}else{s=i?.5:0}return s};Ra.HAS_BUTTONS=false;(function(){try{var t=new MouseEvent("click",{buttons:1});Ra.HAS_BUTTONS=t.buttons===1}catch(t){}})();var Pa=function(t,i){var s={touchstart:this.touchstart,touchmove:this.touchmove,touchend:this.touchend,touchcancel:this.touchcancel};Sa.call(this,t,s);this.pointerMap=t.pointerMap;this.mouseSource=i;this.firstTouchId_=undefined;this.clickCount_=0;this.resetId_=undefined};kh.inherits(Pa,Sa);Pa.DEDUP_TIMEOUT=2500;Pa.CLICK_COUNT_TIMEOUT=200;Pa.POINTER_TYPE="touch";Pa.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier};Pa.prototype.setPrimaryTouch_=function(t){var i=Object.keys(this.pointerMap).length;if(i===0||i===1&&Oa.POINTER_ID.toString()in this.pointerMap){this.firstTouchId_=t.identifier;this.cancelResetClickCount_()}};Pa.prototype.removePrimaryPointer_=function(t){if(t.isPrimary){this.firstTouchId_=undefined;this.resetClickCount_()}};Pa.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),Pa.CLICK_COUNT_TIMEOUT)};Pa.prototype.resetClickCountHandler_=function(){this.clickCount_=0;this.resetId_=undefined};Pa.prototype.cancelResetClickCount_=function(){if(this.resetId_!==undefined){clearTimeout(this.resetId_)}};Pa.prototype.touchToPointer_=function(t,i){var s=this.dispatcher.cloneEvent(t,i);s.pointerId=i.identifier+2;s.bubbles=true;s.cancelable=true;s.detail=this.clickCount_;s.button=0;s.buttons=1;s.width=i.webkitRadiusX||i.radiusX||0;s.height=i.webkitRadiusY||i.radiusY||0;s.pressure=i.webkitForce||i.force||.5;s.isPrimary=this.isPrimaryTouch_(i);s.pointerType=Pa.POINTER_TYPE;s.clientX=i.clientX;s.clientY=i.clientY;s.screenX=i.screenX;s.screenY=i.screenY;return s};Pa.prototype.processTouches_=function(t,i){var s=Array.prototype.slice.call(t.changedTouches);var e=s.length;function r(){t.preventDefault()}var n,h;for(n=0;n<e;++n){h=this.touchToPointer_(t,s[n]);h.preventDefault=r;i.call(this,t,h)}};Pa.prototype.findTouch_=function(t,i){var s=t.length;var e;for(var r=0;r<s;r++){e=t[r];if(e.identifier===i){return true}}return false};Pa.prototype.vacuumTouches_=function(t){var i=t.touches;var s=Object.keys(this.pointerMap);var e=s.length;if(e>=i.length){var r=[];var n,h,a;for(n=0;n<e;++n){h=s[n];a=this.pointerMap[h];if(h!=Oa.POINTER_ID&&!this.findTouch_(i,h-2)){r.push(a.out)}}for(n=0;n<r.length;++n){this.cancelOut_(t,r[n])}}};Pa.prototype.touchstart=function(t){this.vacuumTouches_(t);this.setPrimaryTouch_(t.changedTouches[0]);this.dedupSynthMouse_(t);this.clickCount_++;this.processTouches_(t,this.overDown_)};Pa.prototype.overDown_=function(t,i){this.pointerMap[i.pointerId]={target:i.target,out:i,outTarget:i.target};this.dispatcher.over(i,t);this.dispatcher.enter(i,t);this.dispatcher.down(i,t)};Pa.prototype.touchmove=function(t){t.preventDefault();this.processTouches_(t,this.moveOverOut_)};Pa.prototype.moveOverOut_=function(t,i){var s=i;var e=this.pointerMap[s.pointerId];if(!e){return}var r=e.out;var n=e.outTarget;this.dispatcher.move(s,t);if(r&&n!==s.target){r.relatedTarget=s.target;s.relatedTarget=n;r.target=n;if(s.target){this.dispatcher.leaveOut(r,t);this.dispatcher.enterOver(s,t)}else{s.target=n;s.relatedTarget=null;this.cancelOut_(t,s)}}e.out=s;e.outTarget=s.target};Pa.prototype.touchend=function(t){this.dedupSynthMouse_(t);this.processTouches_(t,this.upOut_)};Pa.prototype.upOut_=function(t,i){this.dispatcher.up(i,t);this.dispatcher.out(i,t);this.dispatcher.leave(i,t);this.cleanUpPointer_(i)};Pa.prototype.touchcancel=function(t){this.processTouches_(t,this.cancelOut_)};Pa.prototype.cancelOut_=function(t,i){this.dispatcher.cancel(i,t);this.dispatcher.out(i,t);this.dispatcher.leave(i,t);this.cleanUpPointer_(i)};Pa.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId];this.removePrimaryPointer_(t)};Pa.prototype.dedupSynthMouse_=function(t){var i=this.mouseSource.lastTouches;var s=t.changedTouches[0];if(this.isPrimaryTouch_(s)){var e=[s.clientX,s.clientY];i.push(e);setTimeout((function(){jh.remove(i,e)}),Pa.DEDUP_TIMEOUT)}};var La=function(t){Th.call(this);this.element_=t;this.pointerMap={};this.eventMap_={};this.eventSourceList_=[];this.registerSources()};kh.inherits(La,Th);La.prototype.registerSources=function(){if(ga.POINTER){this.registerSource("native",new Aa(this))}else if(ga.MSPOINTER){this.registerSource("ms",new Ta(this))}else{var t=new Oa(this);this.registerSource("mouse",t);if(ga.TOUCH){this.registerSource("touch",new Pa(this,t))}}this.register_()};La.prototype.registerSource=function(t,i){var s=i;var e=s.getEvents();if(e){e.forEach((function(t){var i=s.getHandlerForEvent(t);if(i){this.eventMap_[t]=i.bind(s)}}),this);this.eventSourceList_.push(s)}};La.prototype.register_=function(){var t=this.eventSourceList_.length;var i;for(var s=0;s<t;s++){i=this.eventSourceList_[s];this.addEvents_(i.getEvents())}};La.prototype.unregister_=function(){var t=this.eventSourceList_.length;var i;for(var s=0;s<t;s++){i=this.eventSourceList_[s];this.removeEvents_(i.getEvents())}};La.prototype.eventHandler_=function(t){var i=t.type;var s=this.eventMap_[i];if(s){s(t)}};La.prototype.addEvents_=function(t){t.forEach((function(t){Ih.listen(this.element_,t,this.eventHandler_,this)}),this)};La.prototype.removeEvents_=function(t){t.forEach((function(t){Ih.unlisten(this.element_,t,this.eventHandler_,this)}),this)};La.prototype.cloneEvent=function(t,i){var s={},e;for(var r=0,n=La.CLONE_PROPS.length;r<n;r++){e=La.CLONE_PROPS[r][0];s[e]=t[e]||i[e]||La.CLONE_PROPS[r][1]}return s};La.prototype.down=function(t,i){this.fireEvent(Ia.POINTERDOWN,t,i)};La.prototype.move=function(t,i){this.fireEvent(Ia.POINTERMOVE,t,i)};La.prototype.up=function(t,i){this.fireEvent(Ia.POINTERUP,t,i)};La.prototype.enter=function(t,i){t.bubbles=false;this.fireEvent(Ia.POINTERENTER,t,i)};La.prototype.leave=function(t,i){t.bubbles=false;this.fireEvent(Ia.POINTERLEAVE,t,i)};La.prototype.over=function(t,i){t.bubbles=true;this.fireEvent(Ia.POINTEROVER,t,i)};La.prototype.out=function(t,i){t.bubbles=true;this.fireEvent(Ia.POINTEROUT,t,i)};La.prototype.cancel=function(t,i){this.fireEvent(Ia.POINTERCANCEL,t,i)};La.prototype.leaveOut=function(t,i){this.out(t,i);if(!this.contains_(t.target,t.relatedTarget)){this.leave(t,i)}};La.prototype.enterOver=function(t,i){this.over(t,i);if(!this.contains_(t.target,t.relatedTarget)){this.enter(t,i)}};La.prototype.contains_=function(t,i){if(!t||!i){return false}return t.contains(i)};La.prototype.makeEvent=function(t,i,s){return new Ra(t,s,i)};La.prototype.fireEvent=function(t,i,s){var e=this.makeEvent(t,i,s);this.dispatchEvent(e)};La.prototype.fireNativeEvent=function(t){var i=this.makeEvent(t.type,t,t);this.dispatchEvent(i)};La.prototype.wrapMouseEvent=function(t,i){var s=this.makeEvent(t,Oa.prepareEvent(i,this),i);return s};La.prototype.disposeInternal=function(){this.unregister_();Th.prototype.disposeInternal.call(this)};La.CLONE_PROPS=[["bubbles",false],["cancelable",false],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",false],["altKey",false],["shiftKey",false],["metaKey",false],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",false],["type",""],["target",null],["currentTarget",null],["which",0]];var Da=function(t,i){Th.call(this);this.map_=t;this.clickTimeoutId_=0;this.dragging_=false;this.dragListenerKeys_=[];this.moveTolerance_=i?i*ga.DEVICE_PIXEL_RATIO:ga.DEVICE_PIXEL_RATIO;this.down_=null;var s=this.map_.getViewport();this.activePointers_=0;this.trackedTouches_={};this.pointerEventHandler_=new La(s);this.documentPointerEventHandler_=null;this.pointerdownListenerKey_=Ih.listen(this.pointerEventHandler_,Ia.POINTERDOWN,this.handlePointerDown_,this);this.relayedListenerKey_=Ih.listen(this.pointerEventHandler_,Ia.POINTERMOVE,this.relayEvent_,this)};kh.inherits(Da,Th);Da.prototype.emulateClick_=function(t){var i=new Ca(Na.CLICK,this.map_,t);this.dispatchEvent(i);if(this.clickTimeoutId_!==0){clearTimeout(this.clickTimeoutId_);this.clickTimeoutId_=0;i=new Ca(Na.DBLCLICK,this.map_,t);this.dispatchEvent(i)}else{this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=0;var i=new Ca(Na.SINGLECLICK,this.map_,t);this.dispatchEvent(i)}.bind(this),250)}};Da.prototype.updateActivePointers_=function(t){var i=t;if(i.type==Na.POINTERUP||i.type==Na.POINTERCANCEL){delete this.trackedTouches_[i.pointerId]}else if(i.type==Na.POINTERDOWN){this.trackedTouches_[i.pointerId]=true}this.activePointers_=Object.keys(this.trackedTouches_).length};Da.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var i=new Ca(Na.POINTERUP,this.map_,t);this.dispatchEvent(i);if(!i.propagationStopped&&!this.dragging_&&this.isMouseActionButton_(t)){this.emulateClick_(this.down_)}if(this.activePointers_===0){this.dragListenerKeys_.forEach(Ih.unlistenByKey);this.dragListenerKeys_.length=0;this.dragging_=false;this.down_=null;this.documentPointerEventHandler_.dispose();this.documentPointerEventHandler_=null}};Da.prototype.isMouseActionButton_=function(t){return t.button===0};Da.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var i=new Ca(Na.POINTERDOWN,this.map_,t);this.dispatchEvent(i);this.down_=t;if(this.dragListenerKeys_.length===0){this.documentPointerEventHandler_=new La(document);this.dragListenerKeys_.push(Ih.listen(this.documentPointerEventHandler_,Na.POINTERMOVE,this.handlePointerMove_,this),Ih.listen(this.documentPointerEventHandler_,Na.POINTERUP,this.handlePointerUp_,this),Ih.listen(this.pointerEventHandler_,Na.POINTERCANCEL,this.handlePointerUp_,this))}};Da.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=true;var i=new Ca(Na.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(i)}t.preventDefault()};Da.prototype.relayEvent_=function(t){var i=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new Ca(t.type,this.map_,t,i))};Da.prototype.isMoving_=function(t){return Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_};Da.prototype.disposeInternal=function(){if(this.relayedListenerKey_){Ih.unlistenByKey(this.relayedListenerKey_);this.relayedListenerKey_=null}if(this.pointerdownListenerKey_){Ih.unlistenByKey(this.pointerdownListenerKey_);this.pointerdownListenerKey_=null}this.dragListenerKeys_.forEach(Ih.unlistenByKey);this.dragListenerKeys_.length=0;if(this.documentPointerEventHandler_){this.documentPointerEventHandler_.dispose();this.documentPointerEventHandler_=null}if(this.pointerEventHandler_){this.pointerEventHandler_.dispose();this.pointerEventHandler_=null}Th.prototype.disposeInternal.call(this)};var Fa={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"};var Ga={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var Wa={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4,ABORT:5};var ja=function(t,i){this.priorityFunction_=t;this.keyFunction_=i;this.elements_=[];this.priorities_=[];this.queuedElements_={}};ja.DROP=Infinity;ja.prototype.clear=function(){this.elements_.length=0;this.priorities_.length=0;Ch.clear(this.queuedElements_)};ja.prototype.dequeue=function(){var t=this.elements_;var i=this.priorities_;var s=t[0];if(t.length==1){t.length=0;i.length=0}else{t[0]=t.pop();i[0]=i.pop();this.siftUp_(0)}var e=this.keyFunction_(s);delete this.queuedElements_[e];return s};ja.prototype.enqueue=function(t){Dh.assert(!(this.keyFunction_(t)in this.queuedElements_),31);var i=this.priorityFunction_(t);if(i!=ja.DROP){this.elements_.push(t);this.priorities_.push(i);this.queuedElements_[this.keyFunction_(t)]=true;this.siftDown_(0,this.elements_.length-1);return true}return false};ja.prototype.getCount=function(){return this.elements_.length};ja.prototype.getLeftChildIndex_=function(t){return t*2+1};ja.prototype.getRightChildIndex_=function(t){return t*2+2};ja.prototype.getParentIndex_=function(t){return t-1>>1};ja.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--){this.siftUp_(t)}};ja.prototype.isEmpty=function(){return this.elements_.length===0};ja.prototype.isKeyQueued=function(t){return t in this.queuedElements_};ja.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))};ja.prototype.siftUp_=function(t){var i=this.elements_;var s=this.priorities_;var e=i.length;var r=i[t];var n=s[t];var h=t;while(t<e>>1){var a=this.getLeftChildIndex_(t);var o=this.getRightChildIndex_(t);var f=o<e&&s[o]<s[a]?o:a;i[t]=i[f];s[t]=s[f];t=f}i[t]=r;s[t]=n;this.siftDown_(h,t)};ja.prototype.siftDown_=function(t,i){var s=this.elements_;var e=this.priorities_;var r=s[i];var n=e[i];while(i>t){var h=this.getParentIndex_(i);if(e[h]>n){s[i]=s[h];e[i]=e[h];i=h}else{break}}s[i]=r;e[i]=n};ja.prototype.reprioritize=function(){var t=this.priorityFunction_;var i=this.elements_;var s=this.priorities_;var e=0;var r=i.length;var n,h,a;for(h=0;h<r;++h){n=i[h];a=t(n);if(a==ja.DROP){delete this.queuedElements_[this.keyFunction_(n)]}else{s[e]=a;i[e++]=n}}i.length=e;s.length=e;this.heapify_()};var Va=function(t,i){ja.call(this,(function(i){return t.apply(null,i)}),(function(t){return t[0].getKey()}));this.tileChangeCallback_=i;this.tilesLoading_=0;this.tilesLoadingKeys_={}};kh.inherits(Va,ja);Va.prototype.enqueue=function(t){var i=ja.prototype.enqueue.call(this,t);if(i){var s=t[0];Ih.listen(s,Ah.CHANGE,this.handleTileChange,this)}return i};Va.prototype.getTilesLoading=function(){return this.tilesLoading_};Va.prototype.handleTileChange=function(t){var i=t.target;var s=i.getState();if(s===Wa.LOADED||s===Wa.ERROR||s===Wa.EMPTY||s===Wa.ABORT){Ih.unlisten(i,Ah.CHANGE,this.handleTileChange,this);var e=i.getKey();if(e in this.tilesLoadingKeys_){delete this.tilesLoadingKeys_[e];--this.tilesLoading_}this.tileChangeCallback_()}};Va.prototype.loadMoreTiles=function(t,i){var s=0;var e=false;var r,n,h;while(this.tilesLoading_<t&&s<i&&this.getCount()>0){n=this.dequeue()[0];h=n.getKey();r=n.getState();if(r===Wa.ABORT){e=true}else if(r===Wa.IDLE&&!(h in this.tilesLoadingKeys_)){this.tilesLoadingKeys_[h]=true;++this.tilesLoading_;++s;n.load()}}if(s===0&&e){this.tileChangeCallback_()}};var Ua={};Ua.createExtent=function(t){return function(i){if(i){return[Fh.clamp(i[0],t[0],t[2]),Fh.clamp(i[1],t[1],t[3])]}else{return undefined}}};Ua.none=function(t){return t};var qa={};qa.createSnapToResolutions=function(t){return function(i,s,e){if(i!==undefined){var r=jh.linearFindNearest(t,i,e);r=Fh.clamp(r+s,0,t.length-1);var n=Math.floor(r);if(r!=n&&n<t.length-1){var h=t[n]/t[n+1];return t[n]/Math.pow(h,r-n)}else{return t[n]}}else{return undefined}}};qa.createSnapToPower=function(t,i,s){return function(e,r,n){if(e!==undefined){var h=-n/2+.5;var a=Math.floor(Math.log(i/e)/Math.log(t)+h);var o=Math.max(a+r,0);if(s!==undefined){o=Math.min(o,s)}return i/Math.pow(t,o)}else{return undefined}}};var Xa={};Xa.disable=function(t,i){if(t!==undefined){return 0}else{return undefined}};Xa.none=function(t,i){if(t!==undefined){return t+i}else{return undefined}};Xa.createSnapToN=function(t){var i=2*Math.PI/t;return function(t,s){if(t!==undefined){t=Math.floor((t+s)/i+.5)*i;return t}else{return undefined}}};Xa.createSnapToZero=function(t){var i=t||Fh.toRadians(5);return function(t,s){if(t!==undefined){if(Math.abs(t+s)<=i){return 0}else{return t+s}}else{return undefined}}};var Ya={ANIMATING:0,INTERACTING:1};var Ba={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var Ha={};Ha.padNumber=function(t,i,s){var e=s!==undefined?t.toFixed(s):""+t;var r=e.indexOf(".");r=r===-1?e.length:r;return r>i?e:new Array(1+i-r).join("0")+e};Ha.compareVersions=function(t,i){var s=(""+t).split(".");var e=(""+i).split(".");for(var r=0;r<Math.max(s.length,e.length);r++){var n=parseInt(s[r]||"0",10);var h=parseInt(e[r]||"0",10);if(n>h){return 1}if(h>n){return-1}}return 0};var Ja={};Ja.add=function(t,i){t[0]+=i[0];t[1]+=i[1];return t};Ja.closestOnCircle=function(t,i){var s=i.getRadius();var e=i.getCenter();var r=e[0];var n=e[1];var h=t[0];var a=t[1];var o=h-r;var f=a-n;if(o===0&&f===0){o=1}var u=Math.sqrt(o*o+f*f);var v,l;v=r+s*o/u;l=n+s*f/u;return[v,l]};Ja.closestOnSegment=function(t,i){var s=t[0];var e=t[1];var r=i[0];var n=i[1];var h=r[0];var a=r[1];var o=n[0];var f=n[1];var u=o-h;var v=f-a;var l=u===0&&v===0?0:(u*(s-h)+v*(e-a))/(u*u+v*v||0);var c,d;if(l<=0){c=h;d=a}else if(l>=1){c=o;d=f}else{c=h+l*u;d=a+l*v}return[c,d]};Ja.createStringXY=function(t){return function(i){return Ja.toStringXY(i,t)}};Ja.degreesToStringHDMS=function(t,i,s){var e=Fh.modulo(i+180,360)-180;var r=Math.abs(3600*e);var n=s||0;var h=Math.pow(10,n);var a=Math.floor(r/3600);var o=Math.floor((r-a*3600)/60);var f=r-a*3600-o*60;f=Math.ceil(f*h)/h;if(f>=60){f=0;o+=1}if(o>=60){o=0;a+=1}return a+"° "+Ha.padNumber(o,2)+"′ "+Ha.padNumber(f,2,n)+"″"+(e==0?"":" "+t.charAt(e<0?1:0))};Ja.format=function(t,i,s){if(t){return i.replace("{x}",t[0].toFixed(s)).replace("{y}",t[1].toFixed(s))}else{return""}};Ja.equals=function(t,i){var s=true;for(var e=t.length-1;e>=0;--e){if(t[e]!=i[e]){s=false;break}}return s};Ja.rotate=function(t,i){var s=Math.cos(i);var e=Math.sin(i);var r=t[0]*s-t[1]*e;var n=t[1]*s+t[0]*e;t[0]=r;t[1]=n;return t};Ja.scale=function(t,i){t[0]*=i;t[1]*=i;return t};Ja.sub=function(t,i){t[0]-=i[0];t[1]-=i[1];return t};Ja.squaredDistance=function(t,i){var s=t[0]-i[0];var e=t[1]-i[1];return s*s+e*e};Ja.distance=function(t,i){return Math.sqrt(Ja.squaredDistance(t,i))};Ja.squaredDistanceToSegment=function(t,i){return Ja.squaredDistance(t,Ja.closestOnSegment(t,i))};Ja.toStringHDMS=function(t,i){if(t){return Ja.degreesToStringHDMS("NS",t[1],i)+" "+Ja.degreesToStringHDMS("EW",t[0],i)}else{return""}};Ja.toStringXY=function(t,i){return Ja.format(t,"{x}, {y}",i)};var Za={};Za.easeIn=function(t){return Math.pow(t,3)};Za.easeOut=function(t){return 1-Za.easeIn(1-t)};Za.inAndOut=function(t){return 3*t*t-2*t*t*t};Za.linear=function(t){return t};Za.upAndDown=function(t){if(t<.5){return Za.inAndOut(2*t)}else{return 1-Za.inAndOut(2*(t-.5))}};var Ka=function(t){Ph.call(this);var i=Ch.assign({},t);this.hints_=[0,0];this.animations_=[];this.updateAnimations_=this.updateAnimations_.bind(this);this.projection_=ia.createProjection(i.projection,"EPSG:3857");this.applyOptions_(i)};kh.inherits(Ka,Ph);Ka.prototype.applyOptions_=function(t){var i={};i[Ba.CENTER]=t.center!==undefined?t.center:null;var s=Ka.createResolutionConstraint_(t);this.maxResolution_=s.maxResolution;this.minResolution_=s.minResolution;this.zoomFactor_=s.zoomFactor;this.resolutions_=t.resolutions;this.minZoom_=s.minZoom;var e=Ka.createCenterConstraint_(t);var r=s.constraint;var n=Ka.createRotationConstraint_(t);this.constraints_={center:e,resolution:r,rotation:n};if(t.resolution!==undefined){i[Ba.RESOLUTION]=t.resolution}else if(t.zoom!==undefined){i[Ba.RESOLUTION]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_);if(this.resolutions_){i[Ba.RESOLUTION]=Fh.clamp(Number(this.getResolution()||i[Ba.RESOLUTION]),this.minResolution_,this.maxResolution_)}}i[Ba.ROTATION]=t.rotation!==undefined?t.rotation:0;this.setProperties(i);this.options_=t};Ka.prototype.getUpdatedOptions_=function(t){var i=Ch.assign({},this.options_);if(i.resolution!==undefined){i.resolution=this.getResolution()}else{i.zoom=this.getZoom()}i.center=this.getCenter();i.rotation=this.getRotation();return Ch.assign({},i,t)};Ka.prototype.animate=function(t){var i=arguments.length;var s;if(i>1&&typeof arguments[i-1]==="function"){s=arguments[i-1];--i}if(!this.isDef()){var e=arguments[i-1];if(e.center){this.setCenter(e.center)}if(e.zoom!==undefined){this.setZoom(e.zoom)}if(e.rotation!==undefined){this.setRotation(e.rotation)}if(s){s(true)}return}var r=Date.now();var n=this.getCenter().slice();var h=this.getResolution();var a=this.getRotation();var o=[];for(var f=0;f<i;++f){var u=arguments[f];var v={start:r,complete:false,anchor:u.anchor,duration:u.duration!==undefined?u.duration:1e3,easing:u.easing||Za.inAndOut};if(u.center){v.sourceCenter=n;v.targetCenter=u.center;n=v.targetCenter}if(u.zoom!==undefined){v.sourceResolution=h;v.targetResolution=this.constrainResolution(this.maxResolution_,u.zoom-this.minZoom_,0);h=v.targetResolution}else if(u.resolution){v.sourceResolution=h;v.targetResolution=u.resolution;h=v.targetResolution}if(u.rotation!==undefined){v.sourceRotation=a;var l=Fh.modulo(u.rotation-a+Math.PI,2*Math.PI)-Math.PI;v.targetRotation=a+l;a=v.targetRotation}v.callback=s;if(Ka.isNoopAnimation(v)){v.complete=true}else{r+=v.duration}o.push(v)}this.animations_.push(o);this.setHint(Ya.ANIMATING,1);this.updateAnimations_()};Ka.prototype.getAnimating=function(){return this.hints_[Ya.ANIMATING]>0};Ka.prototype.getInteracting=function(){return this.hints_[Ya.INTERACTING]>0};Ka.prototype.cancelAnimations=function(){this.setHint(Ya.ANIMATING,-this.hints_[Ya.ANIMATING]);for(var t=0,i=this.animations_.length;t<i;++t){var s=this.animations_[t];if(s[0].callback){s[0].callback(false)}}this.animations_.length=0};Ka.prototype.updateAnimations_=function(){if(this.updateAnimationKey_!==undefined){cancelAnimationFrame(this.updateAnimationKey_);this.updateAnimationKey_=undefined}if(!this.getAnimating()){return}var t=Date.now();var i=false;for(var s=this.animations_.length-1;s>=0;--s){var e=this.animations_[s];var r=true;for(var n=0,h=e.length;n<h;++n){var a=e[n];if(a.complete){continue}var o=t-a.start;var f=a.duration>0?o/a.duration:1;if(f>=1){a.complete=true;f=1}else{r=false}var u=a.easing(f);if(a.sourceCenter){var v=a.sourceCenter[0];var l=a.sourceCenter[1];var c=a.targetCenter[0];var d=a.targetCenter[1];var m=v+u*(c-v);var p=l+u*(d-l);this.set(Ba.CENTER,[m,p])}if(a.sourceResolution&&a.targetResolution){var M=u===1?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){this.set(Ba.CENTER,this.calculateCenterZoom(M,a.anchor))}this.set(Ba.RESOLUTION,M)}if(a.sourceRotation!==undefined&&a.targetRotation!==undefined){var z=u===1?Fh.modulo(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){this.set(Ba.CENTER,this.calculateCenterRotate(z,a.anchor))}this.set(Ba.ROTATION,z)}i=true;if(!a.complete){break}}if(r){this.animations_[s]=null;this.setHint(Ya.ANIMATING,-1);var _=e[0].callback;if(_){_(true)}}}this.animations_=this.animations_.filter(Boolean);if(i&&this.updateAnimationKey_===undefined){this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_)}};Ka.prototype.calculateCenterRotate=function(t,i){var s;var e=this.getCenter();if(e!==undefined){s=[e[0]-i[0],e[1]-i[1]];Ja.rotate(s,t-this.getRotation());Ja.add(s,i)}return s};Ka.prototype.calculateCenterZoom=function(t,i){var s;var e=this.getCenter();var r=this.getResolution();if(e!==undefined&&r!==undefined){var n=i[0]-t*(i[0]-e[0])/r;var h=i[1]-t*(i[1]-e[1])/r;s=[n,h]}return s};Ka.prototype.getSizeFromViewport_=function(){var t=[100,100];var i='.ol-viewport[data-view="'+kh.getUid(this)+'"]';var s=document.querySelector(i);if(s){var e=getComputedStyle(s);t[0]=parseInt(e.width,10);t[1]=parseInt(e.height,10)}return t};Ka.prototype.constrainCenter=function(t){return this.constraints_.center(t)};Ka.prototype.constrainResolution=function(t,i,s){var e=i||0;var r=s||0;return this.constraints_.resolution(t,e,r)};Ka.prototype.constrainRotation=function(t,i){var s=i||0;return this.constraints_.rotation(t,s)};Ka.prototype.getCenter=function(){return this.get(Ba.CENTER)};Ka.prototype.getConstraints=function(){return this.constraints_};Ka.prototype.getHints=function(t){if(t!==undefined){t[0]=this.hints_[0];t[1]=this.hints_[1];return t}else{return this.hints_.slice()}};Ka.prototype.calculateExtent=function(t){var i=t||this.getSizeFromViewport_();var s=this.getCenter();Dh.assert(s,1);var e=this.getResolution();Dh.assert(e!==undefined,2);var r=this.getRotation();Dh.assert(r!==undefined,3);return qh.getForViewAndSize(s,e,r,i)};Ka.prototype.getMaxResolution=function(){return this.maxResolution_};Ka.prototype.getMinResolution=function(){return this.minResolution_};Ka.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)};Ka.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))};Ka.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)};Ka.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))};Ka.prototype.getProjection=function(){return this.projection_};Ka.prototype.getResolution=function(){return this.get(Ba.RESOLUTION)};Ka.prototype.getResolutions=function(){return this.resolutions_};Ka.prototype.getResolutionForExtent=function(t,i){var s=i||this.getSizeFromViewport_();var e=qh.getWidth(t)/s[0];var r=qh.getHeight(t)/s[1];return Math.max(e,r)};Ka.prototype.getResolutionForValueFunction=function(t){var i=t||2;var s=this.maxResolution_;var e=this.minResolution_;var r=Math.log(s/e)/Math.log(i);return function(t){var e=s/Math.pow(i,t*r);return e}};Ka.prototype.getRotation=function(){return this.get(Ba.ROTATION)};Ka.prototype.getValueForResolutionFunction=function(t){var i=t||2;var s=this.maxResolution_;var e=this.minResolution_;var r=Math.log(s/e)/Math.log(i);return function(t){var e=Math.log(s/t)/Math.log(i)/r;return e}};Ka.prototype.getState=function(){var t=this.getCenter();var i=this.getProjection();var s=this.getResolution();var e=this.getRotation();return{center:t.slice(),projection:i!==undefined?i:null,resolution:s,rotation:e,zoom:this.getZoom()}};Ka.prototype.getZoom=function(){var t;var i=this.getResolution();if(i!==undefined){t=this.getZoomForResolution(i)}return t};Ka.prototype.getZoomForResolution=function(t){var i=this.minZoom_||0;var s,e;if(this.resolutions_){var r=jh.linearFindNearest(this.resolutions_,t,1);i=r;s=this.resolutions_[r];if(r==this.resolutions_.length-1){e=2}else{e=s/this.resolutions_[r+1]}}else{s=this.maxResolution_;e=this.zoomFactor_}return i+Math.log(s/t)/Math.log(e)};Ka.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)};Ka.prototype.fit=function(t,i){var s=i||{};var e=s.size;if(!e){e=this.getSizeFromViewport_()}var r;if(!(t instanceof ra)){Dh.assert(Array.isArray(t),24);Dh.assert(!qh.isEmpty(t),25);r=za.fromExtent(t)}else if(t.getType()===Gh.CIRCLE){t=t.getExtent();r=za.fromExtent(t);r.rotate(this.getRotation(),qh.getCenter(t))}else{r=t}var n=s.padding!==undefined?s.padding:[0,0,0,0];var h=s.constrainResolution!==undefined?s.constrainResolution:true;var a=s.nearest!==undefined?s.nearest:false;var o;if(s.minResolution!==undefined){o=s.minResolution}else if(s.maxZoom!==undefined){o=this.constrainResolution(this.maxResolution_,s.maxZoom-this.minZoom_,0)}else{o=0}var f=r.getFlatCoordinates();var u=this.getRotation();var v=Math.cos(-u);var l=Math.sin(-u);var c=+Infinity;var d=+Infinity;var m=-Infinity;var p=-Infinity;var M=r.getStride();for(var z=0,_=f.length;z<_;z+=M){var g=f[z]*v-f[z+1]*l;var w=f[z]*l+f[z+1]*v;c=Math.min(c,g);d=Math.min(d,w);m=Math.max(m,g);p=Math.max(p,w)}var y=this.getResolutionForExtent([c,d,m,p],[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]);y=isNaN(y)?o:Math.max(y,o);if(h){var b=this.constrainResolution(y,0,0);if(!a&&b<y){b=this.constrainResolution(b,-1,0)}y=b}l=-l;var x=(c+m)/2;var k=(d+p)/2;x+=(n[1]-n[3])/2*y;k+=(n[0]-n[2])/2*y;var E=x*v-k*l;var N=k*v+x*l;var C=[E,N];var I=s.callback?s.callback:kh.nullFunction;if(s.duration!==undefined){this.animate({resolution:y,center:C,duration:s.duration,easing:s.easing},I)}else{this.setResolution(y);this.setCenter(C);setTimeout(I.bind(undefined,true),0)}};Ka.prototype.centerOn=function(t,i,s){var e=this.getRotation();var r=Math.cos(-e);var n=Math.sin(-e);var h=t[0]*r-t[1]*n;var a=t[1]*r+t[0]*n;var o=this.getResolution();h+=(i[0]/2-s[0])*o;a+=(s[1]-i[1]/2)*o;n=-n;var f=h*r-a*n;var u=a*r+h*n;this.setCenter([f,u])};Ka.prototype.isDef=function(){return!!this.getCenter()&&this.getResolution()!==undefined};Ka.prototype.rotate=function(t,i){if(i!==undefined){var s=this.calculateCenterRotate(t,i);this.setCenter(s)}this.setRotation(t)};Ka.prototype.setCenter=function(t){this.set(Ba.CENTER,t);if(this.getAnimating()){this.cancelAnimations()}};Ka.prototype.setHint=function(t,i){this.hints_[t]+=i;this.changed();return this.hints_[t]};Ka.prototype.setResolution=function(t){this.set(Ba.RESOLUTION,t);if(this.getAnimating()){this.cancelAnimations()}};Ka.prototype.setRotation=function(t){this.set(Ba.ROTATION,t);if(this.getAnimating()){this.cancelAnimations()}};Ka.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))};Ka.createCenterConstraint_=function(t){if(t.extent!==undefined){return Ua.createExtent(t.extent)}else{return Ua.none}};Ka.createResolutionConstraint_=function(t){var i;var s;var e;var r=28;var n=2;var h=t.minZoom!==undefined?t.minZoom:kh.DEFAULT_MIN_ZOOM;var a=t.maxZoom!==undefined?t.maxZoom:r;var o=t.zoomFactor!==undefined?t.zoomFactor:n;if(t.resolutions!==undefined){var f=t.resolutions;s=f[h];e=f[a]!==undefined?f[a]:f[f.length-1];i=qa.createSnapToResolutions(f)}else{var u=ia.createProjection(t.projection,"EPSG:3857");var v=u.getExtent();var l=!v?360*ia.METERS_PER_UNIT[Hh.DEGREES]/u.getMetersPerUnit():Math.max(qh.getWidth(v),qh.getHeight(v));var c=l/kh.DEFAULT_TILE_SIZE/Math.pow(n,kh.DEFAULT_MIN_ZOOM);var d=c/Math.pow(n,r-kh.DEFAULT_MIN_ZOOM);s=t.maxResolution;if(s!==undefined){h=0}else{s=c/Math.pow(o,h)}e=t.minResolution;if(e===undefined){if(t.maxZoom!==undefined){if(t.maxResolution!==undefined){e=s/Math.pow(o,a)}else{e=c/Math.pow(o,a)}}else{e=d}}a=h+Math.floor(Math.log(s/e)/Math.log(o));e=s/Math.pow(o,a-h);i=qa.createSnapToPower(o,s,a-h)}return{constraint:i,maxResolution:s,minResolution:e,minZoom:h,zoomFactor:o}};Ka.createRotationConstraint_=function(t){var i=t.enableRotation!==undefined?t.enableRotation:true;if(i){var s=t.constrainRotation;if(s===undefined||s===true){return Xa.createSnapToZero()}else if(s===false){return Xa.none}else if(typeof s==="number"){return Xa.createSnapToN(s)}else{return Xa.none}}else{return Xa.disable}};Ka.isNoopAnimation=function(t){if(t.sourceCenter&&t.targetCenter){if(!Ja.equals(t.sourceCenter,t.targetCenter)){return false}}if(t.sourceResolution!==t.targetResolution){return false}if(t.sourceRotation!==t.targetRotation){return false}return true};var $a={};$a.createCanvasContext2D=function(t,i){var s=document.createElement("CANVAS");if(t){s.width=t}if(i){s.height=i}return s.getContext("2d")};$a.outerWidth=function(t){var i=t.offsetWidth;var s=getComputedStyle(t);i+=parseInt(s.marginLeft,10)+parseInt(s.marginRight,10);return i};$a.outerHeight=function(t){var i=t.offsetHeight;var s=getComputedStyle(t);i+=parseInt(s.marginTop,10)+parseInt(s.marginBottom,10);return i};$a.replaceNode=function(t,i){var s=i.parentNode;if(s){s.replaceChild(t,i)}};$a.removeNode=function(t){return t&&t.parentNode?t.parentNode.removeChild(t):null};$a.removeChildren=function(t){while(t.lastChild){t.removeChild(t.lastChild)}};var Qa={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",SOURCE:"source"};var to=function(t){Ph.call(this);var i=Ch.assign({},t);i[Qa.OPACITY]=t.opacity!==undefined?t.opacity:1;i[Qa.VISIBLE]=t.visible!==undefined?t.visible:true;i[Qa.Z_INDEX]=t.zIndex!==undefined?t.zIndex:0;i[Qa.MAX_RESOLUTION]=t.maxResolution!==undefined?t.maxResolution:Infinity;i[Qa.MIN_RESOLUTION]=t.minResolution!==undefined?t.minResolution:0;this.setProperties(i);this.state_={layer:this,managed:true}};kh.inherits(to,Ph);to.prototype.getType=function(){return this.type};to.prototype.getLayerState=function(){this.state_.opacity=Fh.clamp(this.getOpacity(),0,1);this.state_.sourceState=this.getSourceState();this.state_.visible=this.getVisible();this.state_.extent=this.getExtent();this.state_.zIndex=this.getZIndex();this.state_.maxResolution=this.getMaxResolution();this.state_.minResolution=Math.max(this.getMinResolution(),0);return this.state_};to.prototype.getLayersArray=function(t){};to.prototype.getLayerStatesArray=function(t){};to.prototype.getExtent=function(){return this.get(Qa.EXTENT)};to.prototype.getMaxResolution=function(){return this.get(Qa.MAX_RESOLUTION)};to.prototype.getMinResolution=function(){return this.get(Qa.MIN_RESOLUTION)};to.prototype.getOpacity=function(){return this.get(Qa.OPACITY)};to.prototype.getSourceState=function(){};to.prototype.getVisible=function(){return this.get(Qa.VISIBLE)};to.prototype.getZIndex=function(){return this.get(Qa.Z_INDEX)};to.prototype.setExtent=function(t){this.set(Qa.EXTENT,t)};to.prototype.setMaxResolution=function(t){this.set(Qa.MAX_RESOLUTION,t)};to.prototype.setMinResolution=function(t){this.set(Qa.MIN_RESOLUTION,t)};to.prototype.setOpacity=function(t){this.set(Qa.OPACITY,t)};to.prototype.setVisible=function(t){this.set(Qa.VISIBLE,t)};to.prototype.setZIndex=function(t){this.set(Qa.Z_INDEX,t)};var io={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};var so=function(t){var i=t||{};var s=Ch.assign({},i);delete s.layers;var e=i.layers;to.call(this,s);this.layersListenerKeys_=[];this.listenerKeys_={};Ih.listen(this,Ph.getChangeEventType(so.Property_.LAYERS),this.handleLayersChanged_,this);if(e){if(Array.isArray(e)){e=new xa(e.slice(),{unique:true})}else{Dh.assert(e instanceof xa,43);e=e}}else{e=new xa(undefined,{unique:true})}this.setLayers(e)};kh.inherits(so,to);so.prototype.handleLayerChange_=function(){this.changed()};so.prototype.handleLayersChanged_=function(t){this.layersListenerKeys_.forEach(Ih.unlistenByKey);this.layersListenerKeys_.length=0;var i=this.getLayers();this.layersListenerKeys_.push(Ih.listen(i,ba.ADD,this.handleLayersAdd_,this),Ih.listen(i,ba.REMOVE,this.handleLayersRemove_,this));for(var s in this.listenerKeys_){this.listenerKeys_[s].forEach(Ih.unlistenByKey)}Ch.clear(this.listenerKeys_);var e=i.getArray();var r,n,h;for(r=0,n=e.length;r<n;r++){h=e[r];this.listenerKeys_[kh.getUid(h).toString()]=[Ih.listen(h,Nh.PROPERTYCHANGE,this.handleLayerChange_,this),Ih.listen(h,Ah.CHANGE,this.handleLayerChange_,this)]}this.changed()};so.prototype.handleLayersAdd_=function(t){var i=t.element;var s=kh.getUid(i).toString();this.listenerKeys_[s]=[Ih.listen(i,Nh.PROPERTYCHANGE,this.handleLayerChange_,this),Ih.listen(i,Ah.CHANGE,this.handleLayerChange_,this)];this.changed()};so.prototype.handleLayersRemove_=function(t){var i=t.element;var s=kh.getUid(i).toString();this.listenerKeys_[s].forEach(Ih.unlistenByKey);delete this.listenerKeys_[s];this.changed()};so.prototype.getLayers=function(){return this.get(so.Property_.LAYERS)};so.prototype.setLayers=function(t){this.set(so.Property_.LAYERS,t)};so.prototype.getLayersArray=function(t){var i=t!==undefined?t:[];this.getLayers().forEach((function(t){t.getLayersArray(i)}));return i};so.prototype.getLayerStatesArray=function(t){var i=t!==undefined?t:[];var s=i.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(i)}));var e=this.getLayerState();var r,n,h;for(r=s,n=i.length;r<n;r++){h=i[r];h.opacity*=e.opacity;h.visible=h.visible&&e.visible;h.maxResolution=Math.min(h.maxResolution,e.maxResolution);h.minResolution=Math.max(h.minResolution,e.minResolution);if(e.extent!==undefined){if(h.extent!==undefined){h.extent=qh.getIntersection(h.extent,e.extent)}else{h.extent=e.extent}}}return i};so.prototype.getSourceState=function(){return io.READY};so.Property_={LAYERS:"layers"};var eo={MAP_RENDERER:"MAP_RENDERER",LAYER_RENDERER:"LAYER_RENDERER"};var ro={};ro.mapRendererPlugins_=[];ro.getMapRendererPlugins=function(){return ro.mapRendererPlugins_};ro.layerRendererPlugins_=[];ro.getLayerRendererPlugins=function(){return ro.layerRendererPlugins_};ro.register=function(t,i){var s;switch(t){case eo.MAP_RENDERER:{s=ro.mapRendererPlugins_;s.push(i);break}case eo.LAYER_RENDERER:{s=ro.layerRendererPlugins_;s.push(i);break}default:{throw new Error("Unsupported plugin type: "+t)}}};ro.registerMultiple=function(t,i){for(var s=0,e=i.length;s<e;++s){ro.register(t,i[s])}};var no={CANVAS:"canvas",WEBGL:"webgl"};var ho={};ho.buffer=function(t,i,s){if(s===undefined){s=[0,0]}s[0]=t[0]+2*i;s[1]=t[1]+2*i;return s};ho.hasArea=function(t){return t[0]>0&&t[1]>0};ho.scale=function(t,i,s){if(s===undefined){s=[0,0]}s[0]=t[0]*i+.5|0;s[1]=t[1]*i+.5|0;return s};ho.toSize=function(t,i){if(Array.isArray(t)){return t}else{if(i===undefined){i=[t,t]}else{i[0]=i[1]=t}return i}};var ao=function(t){Ph.call(this);var i=ao.createOptionsInternal(t);this.loadTilesWhileAnimating_=t.loadTilesWhileAnimating!==undefined?t.loadTilesWhileAnimating:false;this.loadTilesWhileInteracting_=t.loadTilesWhileInteracting!==undefined?t.loadTilesWhileInteracting:false;this.pixelRatio_=t.pixelRatio!==undefined?t.pixelRatio:ga.DEVICE_PIXEL_RATIO;this.logos_=i.logos;this.animationDelay_=function(){this.animationDelayKey_=undefined;this.renderFrame_.call(this,Date.now())}.bind(this);this.coordinateToPixelTransform_=sa.create();this.pixelToCoordinateTransform_=sa.create();this.frameIndex_=0;this.frameState_=null;this.previousExtent_=null;this.viewPropertyListenerKey_=null;this.viewChangeListenerKey_=null;this.layerGroupPropertyListenerKeys_=null;this.viewport_=document.createElement("DIV");this.viewport_.className="ol-viewport"+(ga.TOUCH?" ol-touch":"");this.viewport_.style.position="relative";this.viewport_.style.overflow="hidden";this.viewport_.style.width="100%";this.viewport_.style.height="100%";this.viewport_.style.msTouchAction="none";this.viewport_.style.touchAction="none";this.overlayContainer_=document.createElement("DIV");this.overlayContainer_.className="ol-overlaycontainer";this.viewport_.appendChild(this.overlayContainer_);this.overlayContainerStopEvent_=document.createElement("DIV");this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";var s=[Ah.CLICK,Ah.DBLCLICK,Ah.MOUSEDOWN,Ah.TOUCHSTART,Ah.MSPOINTERDOWN,Na.POINTERDOWN,Ah.MOUSEWHEEL,Ah.WHEEL];for(var e=0,r=s.length;e<r;++e){Ih.listen(this.overlayContainerStopEvent_,s[e],Oh.stopPropagation)}this.viewport_.appendChild(this.overlayContainerStopEvent_);this.mapBrowserEventHandler_=new Da(this,t.moveTolerance);for(var n in Na){Ih.listen(this.mapBrowserEventHandler_,Na[n],this.handleMapBrowserEvent,this)}this.keyboardEventTarget_=i.keyboardEventTarget;this.keyHandlerKeys_=null;Ih.listen(this.viewport_,Ah.WHEEL,this.handleBrowserEvent,this);Ih.listen(this.viewport_,Ah.MOUSEWHEEL,this.handleBrowserEvent,this);this.controls=i.controls||new xa;this.interactions=i.interactions||new xa;this.overlays_=i.overlays;this.overlayIdIndex_={};this.renderer_=i.mapRendererPlugin["create"](this.viewport_,this);this.focus_=null;this.postRenderFunctions_=[];this.tileQueue_=new Va(this.getTilePriority.bind(this),this.handleTileChange_.bind(this));this.skippedFeatureUids_={};Ih.listen(this,Ph.getChangeEventType(Ga.LAYERGROUP),this.handleLayerGroupChanged_,this);Ih.listen(this,Ph.getChangeEventType(Ga.VIEW),this.handleViewChanged_,this);Ih.listen(this,Ph.getChangeEventType(Ga.SIZE),this.handleSizeChanged_,this);Ih.listen(this,Ph.getChangeEventType(Ga.TARGET),this.handleTargetChanged_,this);this.setProperties(i.values);this.controls.forEach((function(t){t.setMap(this)}),this);Ih.listen(this.controls,ba.ADD,(function(t){t.element.setMap(this)}),this);Ih.listen(this.controls,ba.REMOVE,(function(t){t.element.setMap(null)}),this);this.interactions.forEach((function(t){t.setMap(this)}),this);Ih.listen(this.interactions,ba.ADD,(function(t){t.element.setMap(this)}),this);Ih.listen(this.interactions,ba.REMOVE,(function(t){t.element.setMap(null)}),this);this.overlays_.forEach(this.addOverlayInternal_,this);Ih.listen(this.overlays_,ba.ADD,(function(t){this.addOverlayInternal_(t.element)}),this);Ih.listen(this.overlays_,ba.REMOVE,(function(t){var i=t.element;var s=i.getId();if(s!==undefined){delete this.overlayIdIndex_[s.toString()]}t.element.setMap(null)}),this)};kh.inherits(ao,Ph);ao.prototype.addControl=function(t){this.getControls().push(t)};ao.prototype.addInteraction=function(t){this.getInteractions().push(t)};ao.prototype.addLayer=function(t){var i=this.getLayerGroup().getLayers();i.push(t)};ao.prototype.addOverlay=function(t){this.getOverlays().push(t)};ao.prototype.addOverlayInternal_=function(t){var i=t.getId();if(i!==undefined){this.overlayIdIndex_[i.toString()]=t}t.setMap(this)};ao.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose();Ih.unlisten(this.viewport_,Ah.WHEEL,this.handleBrowserEvent,this);Ih.unlisten(this.viewport_,Ah.MOUSEWHEEL,this.handleBrowserEvent,this);if(this.handleResize_!==undefined){window.removeEventListener(Ah.RESIZE,this.handleResize_,false);this.handleResize_=undefined}if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_);this.animationDelayKey_=undefined}this.setTarget(null);Ph.prototype.disposeInternal.call(this)};ao.prototype.forEachFeatureAtPixel=function(t,i,s){if(!this.frameState_){return}var e=this.getCoordinateFromPixel(t);s=s!==undefined?s:{};var r=s.hitTolerance!==undefined?s.hitTolerance*this.frameState_.pixelRatio:0;var n=s.layerFilter!==undefined?s.layerFilter:Yh.TRUE;return this.renderer_.forEachFeatureAtCoordinate(e,this.frameState_,r,i,null,n,null)};ao.prototype.getFeaturesAtPixel=function(t,i){var s=null;this.forEachFeatureAtPixel(t,(function(t){if(!s){s=[]}s.push(t)}),i);return s};ao.prototype.forEachLayerAtPixel=function(t,i,s,e,r){if(!this.frameState_){return}var n=s!==undefined?s:null;var h=e!==undefined?e:Yh.TRUE;var a=r!==undefined?r:null;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,n,h,a)};ao.prototype.hasFeatureAtPixel=function(t,i){if(!this.frameState_){return false}var s=this.getCoordinateFromPixel(t);i=i!==undefined?i:{};var e=i.layerFilter!==undefined?i.layerFilter:Yh.TRUE;var r=i.hitTolerance!==undefined?i.hitTolerance*this.frameState_.pixelRatio:0;return this.renderer_.hasFeatureAtCoordinate(s,this.frameState_,r,e,null)};ao.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))};ao.prototype.getEventPixel=function(t){var i=this.viewport_.getBoundingClientRect();var s=t.changedTouches?t.changedTouches[0]:t;return[s.clientX-i.left,s.clientY-i.top]};ao.prototype.getTarget=function(){return this.get(Ga.TARGET)};ao.prototype.getTargetElement=function(){var t=this.getTarget();if(t!==undefined){return typeof t==="string"?document.getElementById(t):t}else{return null}};ao.prototype.getCoordinateFromPixel=function(t){var i=this.frameState_;if(!i){return null}else{return sa.apply(i.pixelToCoordinateTransform,t.slice())}};ao.prototype.getControls=function(){return this.controls};ao.prototype.getOverlays=function(){return this.overlays_};ao.prototype.getOverlayById=function(t){var i=this.overlayIdIndex_[t.toString()];return i!==undefined?i:null};ao.prototype.getInteractions=function(){return this.interactions};ao.prototype.getLayerGroup=function(){return this.get(Ga.LAYERGROUP)};ao.prototype.getLayers=function(){var t=this.getLayerGroup().getLayers();return t};ao.prototype.getPixelFromCoordinate=function(t){var i=this.frameState_;if(!i){return null}else{return sa.apply(i.coordinateToPixelTransform,t.slice(0,2))}};ao.prototype.getRenderer=function(){return this.renderer_};ao.prototype.getSize=function(){return this.get(Ga.SIZE)};ao.prototype.getView=function(){return this.get(Ga.VIEW)};ao.prototype.getViewport=function(){return this.viewport_};ao.prototype.getOverlayContainer=function(){return this.overlayContainer_};ao.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_};ao.prototype.getTilePriority=function(t,i,s,e){var r=this.frameState_;if(!r||!(i in r.wantedTiles)){return ja.DROP}if(!r.wantedTiles[i][t.getKey()]){return ja.DROP}var n=s[0]-r.focus[0];var h=s[1]-r.focus[1];return 65536*Math.log(e)+Math.sqrt(n*n+h*h)/e};ao.prototype.handleBrowserEvent=function(t,i){var s=i||t.type;var e=new Ea(s,this,t);this.handleMapBrowserEvent(e)};ao.prototype.handleMapBrowserEvent=function(t){if(!this.frameState_){return}this.focus_=t.coordinate;t.frameState=this.frameState_;var i=this.getInteractions().getArray();var s;if(this.dispatchEvent(t)!==false){for(s=i.length-1;s>=0;s--){var e=i[s];if(!e.getActive()){continue}var r=e.handleEvent(t);if(!r){break}}}};ao.prototype.handlePostRender=function(){var t=this.frameState_;var i=this.tileQueue_;if(!i.isEmpty()){var s=16;var e=s;if(t){var r=t.viewHints;if(r[Ya.ANIMATING]){s=this.loadTilesWhileAnimating_?8:0;e=2}if(r[Ya.INTERACTING]){s=this.loadTilesWhileInteracting_?8:0;e=2}}if(i.getTilesLoading()<s){i.reprioritize();i.loadMoreTiles(s,e)}}var n=this.postRenderFunctions_;var h,a;for(h=0,a=n.length;h<a;++h){n[h](this,t)}n.length=0};ao.prototype.handleSizeChanged_=function(){this.render()};ao.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()){t=this.getTargetElement()}if(this.keyHandlerKeys_){for(var i=0,s=this.keyHandlerKeys_.length;i<s;++i){Ih.unlistenByKey(this.keyHandlerKeys_[i])}this.keyHandlerKeys_=null}if(!t){this.renderer_.removeLayerRenderers();$a.removeNode(this.viewport_);if(this.handleResize_!==undefined){window.removeEventListener(Ah.RESIZE,this.handleResize_,false);this.handleResize_=undefined}}else{t.appendChild(this.viewport_);var e=!this.keyboardEventTarget_?t:this.keyboardEventTarget_;this.keyHandlerKeys_=[Ih.listen(e,Ah.KEYDOWN,this.handleBrowserEvent,this),Ih.listen(e,Ah.KEYPRESS,this.handleBrowserEvent,this)];if(!this.handleResize_){this.handleResize_=this.updateSize.bind(this);window.addEventListener(Ah.RESIZE,this.handleResize_,false)}}this.updateSize()};ao.prototype.handleTileChange_=function(){this.render()};ao.prototype.handleViewPropertyChanged_=function(){this.render()};ao.prototype.handleViewChanged_=function(){if(this.viewPropertyListenerKey_){Ih.unlistenByKey(this.viewPropertyListenerKey_);this.viewPropertyListenerKey_=null}if(this.viewChangeListenerKey_){Ih.unlistenByKey(this.viewChangeListenerKey_);this.viewChangeListenerKey_=null}var t=this.getView();if(t){this.viewport_.setAttribute("data-view",kh.getUid(t));this.viewPropertyListenerKey_=Ih.listen(t,Nh.PROPERTYCHANGE,this.handleViewPropertyChanged_,this);this.viewChangeListenerKey_=Ih.listen(t,Ah.CHANGE,this.handleViewPropertyChanged_,this)}this.render()};ao.prototype.handleLayerGroupChanged_=function(){if(this.layerGroupPropertyListenerKeys_){this.layerGroupPropertyListenerKeys_.forEach(Ih.unlistenByKey);this.layerGroupPropertyListenerKeys_=null}var t=this.getLayerGroup();if(t){this.layerGroupPropertyListenerKeys_=[Ih.listen(t,Nh.PROPERTYCHANGE,this.render,this),Ih.listen(t,Ah.CHANGE,this.render,this)]}this.render()};ao.prototype.isRendered=function(){return!!this.frameState_};ao.prototype.renderSync=function(){if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_)}this.animationDelay_()};ao.prototype.render=function(){if(this.animationDelayKey_===undefined){this.animationDelayKey_=requestAnimationFrame(this.animationDelay_)}};ao.prototype.removeControl=function(t){return this.getControls().remove(t)};ao.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)};ao.prototype.removeLayer=function(t){var i=this.getLayerGroup().getLayers();return i.remove(t)};ao.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)};ao.prototype.renderFrame_=function(t){var i,s,e;var r=this.getSize();var n=this.getView();var h=qh.createEmpty();var a=this.frameState_;var o=null;if(r!==undefined&&ho.hasArea(r)&&n&&n.isDef()){var f=n.getHints(this.frameState_?this.frameState_.viewHints:undefined);var u=this.getLayerGroup().getLayerStatesArray();var v={};for(i=0,s=u.length;i<s;++i){v[kh.getUid(u[i].layer)]=u[i]}e=n.getState();var l=e.center;var c=e.resolution/this.pixelRatio_;l[0]=Math.round(l[0]/c)*c;l[1]=Math.round(l[1]/c)*c;o={animate:false,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:h,focus:!this.focus_?l:this.focus_,index:this.frameIndex_++,layerStates:v,layerStatesArray:u,logos:Ch.assign({},this.logos_),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:e,viewHints:f,wantedTiles:{}}}if(o){o.extent=qh.getForViewAndSize(e.center,e.resolution,e.rotation,o.size,h)}this.frameState_=o;this.renderer_.renderFrame(o);if(o){if(o.animate){this.render()}Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions);if(a){var d=!this.previousExtent_||!qh.isEmpty(this.previousExtent_)&&!qh.equals(o.extent,this.previousExtent_);if(d){this.dispatchEvent(new ka(Fa.MOVESTART,this,a));this.previousExtent_=qh.createOrUpdateEmpty(this.previousExtent_)}}var m=this.previousExtent_&&!o.viewHints[Ya.ANIMATING]&&!o.viewHints[Ya.INTERACTING]&&!qh.equals(o.extent,this.previousExtent_);if(m){this.dispatchEvent(new ka(Fa.MOVEEND,this,o));qh.clone(o.extent,this.previousExtent_)}}this.dispatchEvent(new ka(Fa.POSTRENDER,this,o));setTimeout(this.handlePostRender.bind(this),0)};ao.prototype.setLayerGroup=function(t){this.set(Ga.LAYERGROUP,t)};ao.prototype.setSize=function(t){this.set(Ga.SIZE,t)};ao.prototype.setTarget=function(t){this.set(Ga.TARGET,t)};ao.prototype.setView=function(t){this.set(Ga.VIEW,t)};ao.prototype.skipFeature=function(t){var i=kh.getUid(t).toString();this.skippedFeatureUids_[i]=true;this.render()};ao.prototype.updateSize=function(){var t=this.getTargetElement();if(!t){this.setSize(undefined)}else{var i=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(i["borderLeftWidth"])-parseFloat(i["paddingLeft"])-parseFloat(i["paddingRight"])-parseFloat(i["borderRightWidth"]),t.offsetHeight-parseFloat(i["borderTopWidth"])-parseFloat(i["paddingTop"])-parseFloat(i["paddingBottom"])-parseFloat(i["borderBottomWidth"])])}};ao.prototype.unskipFeature=function(t){var i=kh.getUid(t).toString();delete this.skippedFeatureUids_[i];this.render()};ao.DEFAULT_RENDERER_TYPES=[no.CANVAS,no.WEBGL];ao.LOGO_URL="data:image/png;base64,"+"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBI"+"WXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAA"+"AhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszW"+"WMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvY"+"asvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvX"+"H1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1Vk"+"bMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW"+"2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLP"+"VcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqT"+"acrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaar"+"ldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+Hi"+"zeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDn"+"BAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSF"+"hYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJ"+"REFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxC"+"Brb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe"+"0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8"+"a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7a"+"hgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCn"+"B3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDg"+"q82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC";ao.createOptionsInternal=function(t){var i=null;if(t.keyboardEventTarget!==undefined){i=typeof t.keyboardEventTarget==="string"?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget}var s={};var e={};if(t.logo===undefined||typeof t.logo==="boolean"&&t.logo){e[ao.LOGO_URL]="https://openlayers.org/"}else{var r=t.logo;if(typeof r==="string"){e[r]=""}else if(r instanceof HTMLElement){e[kh.getUid(r).toString()]=r}else if(r){Dh.assert(typeof r.href=="string",44);Dh.assert(typeof r.src=="string",45);e[r.src]=r.href}}var n=t.layers instanceof so?t.layers:new so({layers:t.layers});s[Ga.LAYERGROUP]=n;s[Ga.TARGET]=t.target;s[Ga.VIEW]=t.view!==undefined?t.view:new Ka;var h;if(t.renderer!==undefined){if(Array.isArray(t.renderer)){h=t.renderer}else if(typeof t.renderer==="string"){h=[t.renderer]}else{Dh.assert(false,46)}if(h.indexOf("dom")>=0){h=h.concat(ao.DEFAULT_RENDERER_TYPES)}}else{h=ao.DEFAULT_RENDERER_TYPES}var a;var o=ro.getMapRendererPlugins();t:for(var f=0,u=h.length;f<u;++f){var v=h[f];for(var l=0,c=o.length;l<c;++l){var d=o[l];if(d["handles"](v)){a=d;break t}}}if(!a){throw new Error("Unable to create a map renderer for types: "+h.join(", "))}var m;if(t.controls!==undefined){if(Array.isArray(t.controls)){m=new xa(t.controls.slice())}else{Dh.assert(t.controls instanceof xa,47);m=t.controls}}var p;if(t.interactions!==undefined){if(Array.isArray(t.interactions)){p=new xa(t.interactions.slice())}else{Dh.assert(t.interactions instanceof xa,48);p=t.interactions}}var M;if(t.overlays!==undefined){if(Array.isArray(t.overlays)){M=new xa(t.overlays.slice())}else{Dh.assert(t.overlays instanceof xa,49);M=t.overlays}}else{M=new xa}return{controls:m,interactions:p,keyboardEventTarget:i,logos:e,overlays:M,mapRendererPlugin:a,values:s}};var oo=function(t){Ph.call(this);this.element=t.element?t.element:null;this.target_=null;this.map_=null;this.listenerKeys=[];this.render=t.render?t.render:kh.nullFunction;if(t.target){this.setTarget(t.target)}};kh.inherits(oo,Ph);oo.prototype.disposeInternal=function(){$a.removeNode(this.element);Ph.prototype.disposeInternal.call(this)};oo.prototype.getMap=function(){return this.map_};oo.prototype.setMap=function(t){if(this.map_){$a.removeNode(this.element)}for(var i=0,s=this.listenerKeys.length;i<s;++i){Ih.unlistenByKey(this.listenerKeys[i])}this.listenerKeys.length=0;this.map_=t;if(this.map_){var e=this.target_?this.target_:t.getOverlayContainerStopEvent();e.appendChild(this.element);if(this.render!==kh.nullFunction){this.listenerKeys.push(Ih.listen(t,Fa.POSTRENDER,this.render,this))}t.render()}};oo.prototype.setTarget=function(t){this.target_=typeof t==="string"?document.getElementById(t):t};var fo={};fo.CLASS_HIDDEN="ol-hidden";fo.CLASS_SELECTABLE="ol-selectable";fo.CLASS_UNSELECTABLE="ol-unselectable";fo.CLASS_UNSUPPORTED="ol-unsupported";fo.CLASS_CONTROL="ol-control";fo.getFontFamilies=function(){var t;var i={};return function(s){if(!t){t=document.createElement("div").style}if(!(s in i)){t.font=s;var e=t.fontFamily;t.font="";if(!e){return null}i[s]=e.split(/,\s?/)}return i[s]}}();var uo={POSTCOMPOSE:"postcompose",PRECOMPOSE:"precompose",RENDER:"render"};var vo=function(t){var i=Ch.assign({},t);delete i.source;to.call(this,i);this.mapPrecomposeKey_=null;this.mapRenderKey_=null;this.sourceChangeKey_=null;if(t.map){this.setMap(t.map)}Ih.listen(this,Ph.getChangeEventType(Qa.SOURCE),this.handleSourcePropertyChange_,this);var s=t.source?t.source:null;this.setSource(s)};kh.inherits(vo,to);vo.visibleAtResolution=function(t,i){return t.visible&&i>=t.minResolution&&i<t.maxResolution};vo.prototype.getLayersArray=function(t){var i=t?t:[];i.push(this);return i};vo.prototype.getLayerStatesArray=function(t){var i=t?t:[];i.push(this.getLayerState());return i};vo.prototype.getSource=function(){var t=this.get(Qa.SOURCE);return t||null};vo.prototype.getSourceState=function(){var t=this.getSource();return!t?io.UNDEFINED:t.getState()};vo.prototype.handleSourceChange_=function(){this.changed()};vo.prototype.handleSourcePropertyChange_=function(){if(this.sourceChangeKey_){Ih.unlistenByKey(this.sourceChangeKey_);this.sourceChangeKey_=null}var t=this.getSource();if(t){this.sourceChangeKey_=Ih.listen(t,Ah.CHANGE,this.handleSourceChange_,this)}this.changed()};vo.prototype.setMap=function(t){if(this.mapPrecomposeKey_){Ih.unlistenByKey(this.mapPrecomposeKey_);this.mapPrecomposeKey_=null}if(!t){this.changed()}if(this.mapRenderKey_){Ih.unlistenByKey(this.mapRenderKey_);this.mapRenderKey_=null}if(t){this.mapPrecomposeKey_=Ih.listen(t,uo.PRECOMPOSE,(function(t){var i=this.getLayerState();i.managed=false;i.zIndex=Infinity;t.frameState.layerStatesArray.push(i);t.frameState.layerStates[kh.getUid(this)]=i}),this);this.mapRenderKey_=Ih.listen(this,Ah.CHANGE,t.render,t);this.changed()}};vo.prototype.setSource=function(t){this.set(Qa.SOURCE,t)};var lo=function(t){var i=t?t:{};this.ulElement_=document.createElement("UL");this.logoLi_=document.createElement("LI");this.ulElement_.appendChild(this.logoLi_);this.logoLi_.style.display="none";this.collapsed_=i.collapsed!==undefined?i.collapsed:true;this.collapsible_=i.collapsible!==undefined?i.collapsible:true;if(!this.collapsible_){this.collapsed_=false}var s=i.className!==undefined?i.className:"ol-attribution";var e=i.tipLabel!==undefined?i.tipLabel:"Attributions";var r=i.collapseLabel!==undefined?i.collapseLabel:"»";if(typeof r==="string"){this.collapseLabel_=document.createElement("span");this.collapseLabel_.textContent=r}else{this.collapseLabel_=r}var n=i.label!==undefined?i.label:"i";if(typeof n==="string"){this.label_=document.createElement("span");this.label_.textContent=n}else{this.label_=n}var h=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;var a=document.createElement("button");a.setAttribute("type","button");a.title=e;a.appendChild(h);Ih.listen(a,Ah.CLICK,this.handleClick_,this);var o=s+" "+fo.CLASS_UNSELECTABLE+" "+fo.CLASS_CONTROL+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible");var f=document.createElement("div");f.className=o;f.appendChild(this.ulElement_);f.appendChild(a);var u=i.render?i.render:lo.render;oo.call(this,{element:f,render:u,target:i.target});this.renderedAttributions_=[];this.renderedVisible_=true;this.logoElements_={}};kh.inherits(lo,oo);lo.prototype.getSourceAttributions_=function(t){var i={};var s=[];var e=t.layerStatesArray;var r=t.viewState.resolution;for(var n=0,h=e.length;n<h;++n){var a=e[n];if(!vo.visibleAtResolution(a,r)){continue}var o=a.layer.getSource();if(!o){continue}var f=o.getAttributions2();if(!f){continue}var u=f(t);if(!u){continue}if(Array.isArray(u)){for(var v=0,l=u.length;v<l;++v){if(!(u[v]in i)){s.push(u[v]);i[u[v]]=true}}}else{if(!(u in i)){s.push(u);i[u]=true}}}return s};lo.render=function(t){this.updateElement_(t.frameState)};lo.prototype.updateElement_=function(t){if(!t){if(this.renderedVisible_){this.element.style.display="none";this.renderedVisible_=false}return}var i=this.getSourceAttributions_(t);if(jh.equals(i,this.renderedAttributions_)){return}while(this.ulElement_.lastChild!==this.logoLi_){this.ulElement_.removeChild(this.ulElement_.lastChild)}for(var s=0,e=i.length;s<e;++s){var r=document.createElement("LI");r.innerHTML=i[s];this.ulElement_.appendChild(r)}if(i.length===0&&this.renderedAttributions_.length>0){this.element.classList.add("ol-logo-only")}else if(this.renderedAttributions_.length===0&&i.length>0){this.element.classList.remove("ol-logo-only")}var n=i.length>0||!Ch.isEmpty(t.logos);if(this.renderedVisible_!=n){this.element.style.display=n?"":"none";this.renderedVisible_=n}this.renderedAttributions_=i;this.insertLogos_(t)};lo.prototype.insertLogos_=function(t){var i;var s=t.logos;var e=this.logoElements_;for(i in e){if(!(i in s)){$a.removeNode(e[i]);delete e[i]}}var r,n,h;for(h in s){var a=s[h];if(a instanceof HTMLElement){this.logoLi_.appendChild(a);e[h]=a}if(!(h in e)){r=new Image;r.src=h;if(a===""){n=r}else{n=document.createElement("a");n.href=a;n.appendChild(r)}this.logoLi_.appendChild(n);e[h]=n}}this.logoLi_.style.display=!Ch.isEmpty(s)?"":"none"};lo.prototype.handleClick_=function(t){t.preventDefault();this.handleToggle_()};lo.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed");if(this.collapsed_){$a.replaceNode(this.collapseLabel_,this.label_)}else{$a.replaceNode(this.label_,this.collapseLabel_)}this.collapsed_=!this.collapsed_};lo.prototype.getCollapsible=function(){return this.collapsible_};lo.prototype.setCollapsible=function(t){if(this.collapsible_===t){return}this.collapsible_=t;this.element.classList.toggle("ol-uncollapsible");if(!t&&this.collapsed_){this.handleToggle_()}};lo.prototype.setCollapsed=function(t){if(!this.collapsible_||this.collapsed_===t){return}this.handleToggle_()};lo.prototype.getCollapsed=function(){return this.collapsed_};var co=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-rotate";var e=i.label!==undefined?i.label:"⇧";this.label_=null;if(typeof e==="string"){this.label_=document.createElement("span");this.label_.className="ol-compass";this.label_.textContent=e}else{this.label_=e;this.label_.classList.add("ol-compass")}var r=i.tipLabel?i.tipLabel:"Reset rotation";var n=document.createElement("button");n.className=s+"-reset";n.setAttribute("type","button");n.title=r;n.appendChild(this.label_);Ih.listen(n,Ah.CLICK,co.prototype.handleClick_,this);var h=s+" "+fo.CLASS_UNSELECTABLE+" "+fo.CLASS_CONTROL;var a=document.createElement("div");a.className=h;a.appendChild(n);var o=i.render?i.render:co.render;this.callResetNorth_=i.resetNorth?i.resetNorth:undefined;oo.call(this,{element:a,render:o,target:i.target});this.duration_=i.duration!==undefined?i.duration:250;this.autoHide_=i.autoHide!==undefined?i.autoHide:true;this.rotation_=undefined;if(this.autoHide_){this.element.classList.add(fo.CLASS_HIDDEN)}};kh.inherits(co,oo);co.prototype.handleClick_=function(t){t.preventDefault();if(this.callResetNorth_!==undefined){this.callResetNorth_()}else{this.resetNorth_()}};co.prototype.resetNorth_=function(){var t=this.getMap();var i=t.getView();if(!i){return}if(i.getRotation()!==undefined){if(this.duration_>0){i.animate({rotation:0,duration:this.duration_,easing:Za.easeOut})}else{i.setRotation(0)}}};co.render=function(t){var i=t.frameState;if(!i){return}var s=i.viewState.rotation;if(s!=this.rotation_){var e="rotate("+s+"rad)";if(this.autoHide_){var r=this.element.classList.contains(fo.CLASS_HIDDEN);if(!r&&s===0){this.element.classList.add(fo.CLASS_HIDDEN)}else if(r&&s!==0){this.element.classList.remove(fo.CLASS_HIDDEN)}}this.label_.style.msTransform=e;this.label_.style.webkitTransform=e;this.label_.style.transform=e}this.rotation_=s};var mo=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-zoom";var e=i.delta!==undefined?i.delta:1;var r=i.zoomInLabel!==undefined?i.zoomInLabel:"+";var n=i.zoomOutLabel!==undefined?i.zoomOutLabel:"−";var h=i.zoomInTipLabel!==undefined?i.zoomInTipLabel:"Zoom in";var a=i.zoomOutTipLabel!==undefined?i.zoomOutTipLabel:"Zoom out";var o=document.createElement("button");o.className=s+"-in";o.setAttribute("type","button");o.title=h;o.appendChild(typeof r==="string"?document.createTextNode(r):r);Ih.listen(o,Ah.CLICK,mo.prototype.handleClick_.bind(this,e));var f=document.createElement("button");f.className=s+"-out";f.setAttribute("type","button");f.title=a;f.appendChild(typeof n==="string"?document.createTextNode(n):n);Ih.listen(f,Ah.CLICK,mo.prototype.handleClick_.bind(this,-e));var u=s+" "+fo.CLASS_UNSELECTABLE+" "+fo.CLASS_CONTROL;var v=document.createElement("div");v.className=u;v.appendChild(o);v.appendChild(f);oo.call(this,{element:v,target:i.target});this.duration_=i.duration!==undefined?i.duration:250};kh.inherits(mo,oo);mo.prototype.handleClick_=function(t,i){i.preventDefault();this.zoomByDelta_(t)};mo.prototype.zoomByDelta_=function(t){var i=this.getMap();var s=i.getView();if(!s){return}var e=s.getResolution();if(e){var r=s.constrainResolution(e,t);if(this.duration_>0){if(s.getAnimating()){s.cancelAnimations()}s.animate({resolution:r,duration:this.duration_,easing:Za.easeOut})}else{s.setResolution(r)}}};var po={};po.defaults=function(t){var i=t?t:{};var s=new xa;var e=i.zoom!==undefined?i.zoom:true;if(e){s.push(new mo(i.zoomOptions))}var r=i.rotate!==undefined?i.rotate:true;if(r){s.push(new co(i.rotateOptions))}var n=i.attribution!==undefined?i.attribution:true;if(n){s.push(new lo(i.attributionOptions))}return s};var Mo=function(t,i,s){this.decay_=t;this.minVelocity_=i;this.delay_=s;this.points_=[];this.angle_=0;this.initialVelocity_=0};Mo.prototype.begin=function(){this.points_.length=0;this.angle_=0;this.initialVelocity_=0};Mo.prototype.update=function(t,i){this.points_.push(t,i,Date.now())};Mo.prototype.end=function(){if(this.points_.length<6){return false}var t=Date.now()-this.delay_;var i=this.points_.length-3;if(this.points_[i+2]<t){return false}var s=i-3;while(s>0&&this.points_[s+2]>t){s-=3}var e=this.points_[i+2]-this.points_[s+2];if(e<1e3/60){return false}var r=this.points_[i]-this.points_[s];var n=this.points_[i+1]-this.points_[s+1];this.angle_=Math.atan2(n,r);this.initialVelocity_=Math.sqrt(r*r+n*n)/e;return this.initialVelocity_>this.minVelocity_};Mo.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_};Mo.prototype.getAngle=function(){return this.angle_};var zo={ACTIVE:"active"};var _o=function(t){Ph.call(this);this.map_=null;this.setActive(true);this.handleEvent=t.handleEvent};kh.inherits(_o,Ph);_o.prototype.getActive=function(){return this.get(zo.ACTIVE)};_o.prototype.getMap=function(){return this.map_};_o.prototype.setActive=function(t){this.set(zo.ACTIVE,t)};_o.prototype.setMap=function(t){this.map_=t};_o.pan=function(t,i,s){var e=t.getCenter();if(e){var r=t.constrainCenter([e[0]+i[0],e[1]+i[1]]);if(s){t.animate({duration:s,easing:Za.linear,center:r})}else{t.setCenter(r)}}};_o.rotate=function(t,i,s,e){i=t.constrainRotation(i,0);_o.rotateWithoutConstraints(t,i,s,e)};_o.rotateWithoutConstraints=function(t,i,s,e){if(i!==undefined){var r=t.getRotation();var n=t.getCenter();if(r!==undefined&&n&&e>0){t.animate({rotation:i,anchor:s,duration:e,easing:Za.easeOut})}else{t.rotate(i,s)}}};_o.zoom=function(t,i,s,e,r){i=t.constrainResolution(i,0,r);_o.zoomWithoutConstraints(t,i,s,e)};_o.zoomByDelta=function(t,i,s,e){var r=t.getResolution();var n=t.constrainResolution(r,i,0);if(n!==undefined){var h=t.getResolutions();n=Fh.clamp(n,t.getMinResolution()||h[h.length-1],t.getMaxResolution()||h[0])}if(s&&n!==undefined&&n!==r){var a=t.getCenter();var o=t.calculateCenterZoom(n,s);o=t.constrainCenter(o);s=[(n*a[0]-r*o[0])/(n-r),(n*a[1]-r*o[1])/(n-r)]}_o.zoomWithoutConstraints(t,n,s,e)};_o.zoomWithoutConstraints=function(t,i,s,e){if(i){var r=t.getResolution();var n=t.getCenter();if(r!==undefined&&n&&i!==r&&e){t.animate({resolution:i,anchor:s,duration:e,easing:Za.easeOut})}else{if(s){var h=t.calculateCenterZoom(i,s);t.setCenter(h)}t.setResolution(i)}}};var go=function(t){var i=t?t:{};this.delta_=i.delta?i.delta:1;_o.call(this,{handleEvent:go.handleEvent});this.duration_=i.duration!==undefined?i.duration:250};kh.inherits(go,_o);go.handleEvent=function(t){var i=false;var s=t.originalEvent;if(t.type==Na.DBLCLICK){var e=t.map;var r=t.coordinate;var n=s.shiftKey?-this.delta_:this.delta_;var h=e.getView();_o.zoomByDelta(h,n,r,this.duration_);t.preventDefault();i=true}return!i};var wo={};wo.altKeyOnly=function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey};wo.altShiftKeysOnly=function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey};wo.always=Yh.TRUE;wo.click=function(t){return t.type==Na.CLICK};wo.mouseActionButton=function(t){var i=t.originalEvent;return i.button==0&&!(ga.WEBKIT&&ga.MAC&&i.ctrlKey)};wo.never=Yh.FALSE;wo.pointerMove=function(t){return t.type=="pointermove"};wo.singleClick=function(t){return t.type==Na.SINGLECLICK};wo.doubleClick=function(t){return t.type==Na.DBLCLICK};wo.noModifierKeys=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey};wo.platformModifierKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&(ga.MAC?i.metaKey:i.ctrlKey)&&!i.shiftKey};wo.shiftKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey};wo.targetNotEditable=function(t){var i=t.originalEvent.target;var s=i.tagName;return s!=="INPUT"&&s!=="SELECT"&&s!=="TEXTAREA"};wo.mouseOnly=function(t){Dh.assert(t.pointerEvent,56);return t.pointerEvent.pointerType=="mouse"};wo.primaryAction=function(t){var i=t.pointerEvent;return i.isPrimary&&i.button===0};var yo=function(t){var i=t?t:{};var s=i.handleEvent?i.handleEvent:yo.handleEvent;_o.call(this,{handleEvent:s});this.handleDownEvent_=i.handleDownEvent?i.handleDownEvent:yo.handleDownEvent;this.handleDragEvent_=i.handleDragEvent?i.handleDragEvent:yo.handleDragEvent;this.handleMoveEvent_=i.handleMoveEvent?i.handleMoveEvent:yo.handleMoveEvent;this.handleUpEvent_=i.handleUpEvent?i.handleUpEvent:yo.handleUpEvent;this.handlingDownUpSequence=false;this.trackedPointers_={};this.targetPointers=[]};kh.inherits(yo,_o);yo.centroid=function(t){var i=t.length;var s=0;var e=0;for(var r=0;r<i;r++){s+=t[r].clientX;e+=t[r].clientY}return[s/i,e/i]};yo.prototype.isPointerDraggingEvent_=function(t){var i=t.type;return i===Na.POINTERDOWN||i===Na.POINTERDRAG||i===Na.POINTERUP};yo.prototype.updateTrackedPointers_=function(t){if(this.isPointerDraggingEvent_(t)){var i=t.pointerEvent;var s=i.pointerId.toString();if(t.type==Na.POINTERUP){delete this.trackedPointers_[s]}else if(t.type==Na.POINTERDOWN){this.trackedPointers_[s]=i}else if(s in this.trackedPointers_){this.trackedPointers_[s]=i}this.targetPointers=Ch.getValues(this.trackedPointers_)}};yo.handleDragEvent=kh.nullFunction;yo.handleUpEvent=Yh.FALSE;yo.handleDownEvent=Yh.FALSE;yo.handleMoveEvent=kh.nullFunction;yo.handleEvent=function(t){if(!(t instanceof Ca)){return true}var i=false;this.updateTrackedPointers_(t);if(this.handlingDownUpSequence){if(t.type==Na.POINTERDRAG){this.handleDragEvent_(t)}else if(t.type==Na.POINTERUP){var s=this.handleUpEvent_(t);this.handlingDownUpSequence=s&&this.targetPointers.length>0}}else{if(t.type==Na.POINTERDOWN){var e=this.handleDownEvent_(t);this.handlingDownUpSequence=e;i=this.shouldStopEvent(e)}else if(t.type==Na.POINTERMOVE){this.handleMoveEvent_(t)}}return!i};yo.prototype.shouldStopEvent=function(t){return t};var bo=function(t){yo.call(this,{handleDownEvent:bo.handleDownEvent_,handleDragEvent:bo.handleDragEvent_,handleUpEvent:bo.handleUpEvent_});var i=t?t:{};this.kinetic_=i.kinetic;this.lastCentroid=null;this.condition_=i.condition?i.condition:wo.noModifierKeys;this.noKinetic_=false};kh.inherits(bo,yo);bo.handleDragEvent_=function(t){var i=this.targetPointers;var s=yo.centroid(i);if(i.length==this.lastPointersCount_){if(this.kinetic_){this.kinetic_.update(s[0],s[1])}if(this.lastCentroid){var e=this.lastCentroid[0]-s[0];var r=s[1]-this.lastCentroid[1];var n=t.map;var h=n.getView();var a=h.getState();var o=[e,r];Ja.scale(o,a.resolution);Ja.rotate(o,a.rotation);Ja.add(o,a.center);o=h.constrainCenter(o);h.setCenter(o)}}else if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=s;this.lastPointersCount_=i.length};bo.handleUpEvent_=function(t){var i=t.map;var s=i.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var e=this.kinetic_.getDistance();var r=this.kinetic_.getAngle();var n=s.getCenter();var h=i.getPixelFromCoordinate(n);var a=i.getCoordinateFromPixel([h[0]-e*Math.cos(r),h[1]-e*Math.sin(r)]);s.animate({center:s.constrainCenter(a),duration:500,easing:Za.easeOut})}s.setHint(Ya.INTERACTING,-1);return false}else{if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=null;return true}};bo.handleDownEvent_=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var i=t.map;var s=i.getView();this.lastCentroid=null;if(!this.handlingDownUpSequence){s.setHint(Ya.INTERACTING,1)}if(s.getAnimating()){s.setCenter(t.frameState.viewState.center)}if(this.kinetic_){this.kinetic_.begin()}this.noKinetic_=this.targetPointers.length>1;return true}else{return false}};bo.prototype.shouldStopEvent=Yh.FALSE;var xo=function(t){var i=t?t:{};yo.call(this,{handleDownEvent:xo.handleDownEvent_,handleDragEvent:xo.handleDragEvent_,handleUpEvent:xo.handleUpEvent_});this.condition_=i.condition?i.condition:wo.altShiftKeysOnly;this.lastAngle_=undefined;this.duration_=i.duration!==undefined?i.duration:250};kh.inherits(xo,yo);xo.handleDragEvent_=function(t){if(!wo.mouseOnly(t)){return}var i=t.map;var s=i.getView();if(s.getConstraints().rotation===Xa.disable){return}var e=i.getSize();var r=t.pixel;var n=Math.atan2(e[1]/2-r[1],r[0]-e[0]/2);if(this.lastAngle_!==undefined){var h=n-this.lastAngle_;var a=s.getRotation();_o.rotateWithoutConstraints(s,a-h)}this.lastAngle_=n};xo.handleUpEvent_=function(t){if(!wo.mouseOnly(t)){return true}var i=t.map;var s=i.getView();s.setHint(Ya.INTERACTING,-1);var e=s.getRotation();_o.rotate(s,e,undefined,this.duration_);return false};xo.handleDownEvent_=function(t){if(!wo.mouseOnly(t)){return false}if(wo.mouseActionButton(t)&&this.condition_(t)){var i=t.map;i.getView().setHint(Ya.INTERACTING,1);this.lastAngle_=undefined;return true}else{return false}};xo.prototype.shouldStopEvent=Yh.FALSE;var ko=function(t){this.geometry_=null;this.element_=document.createElement("div");this.element_.style.position="absolute";this.element_.className="ol-box "+t;this.map_=null;this.startPixel_=null;this.endPixel_=null};kh.inherits(ko,Sh);ko.prototype.disposeInternal=function(){this.setMap(null)};ko.prototype.render_=function(){var t=this.startPixel_;var i=this.endPixel_;var s="px";var e=this.element_.style;e.left=Math.min(t[0],i[0])+s;e.top=Math.min(t[1],i[1])+s;e.width=Math.abs(i[0]-t[0])+s;e.height=Math.abs(i[1]-t[1])+s};ko.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var i=this.element_.style;i.left=i.top=i.width=i.height="inherit"}this.map_=t;if(this.map_){this.map_.getOverlayContainer().appendChild(this.element_)}};ko.prototype.setPixels=function(t,i){this.startPixel_=t;this.endPixel_=i;this.createOrUpdateGeometry();this.render_()};ko.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_;var i=this.endPixel_;var s=[t,[t[0],i[1]],i,[i[0],t[1]]];var e=s.map(this.map_.getCoordinateFromPixel,this.map_);e[4]=e[0].slice();if(!this.geometry_){this.geometry_=new za([e])}else{this.geometry_.setCoordinates([e])}};ko.prototype.getGeometry=function(){return this.geometry_};var Eo=function(t){yo.call(this,{handleDownEvent:Eo.handleDownEvent_,handleDragEvent:Eo.handleDragEvent_,handleUpEvent:Eo.handleUpEvent_});var i=t?t:{};this.box_=new ko(i.className||"ol-dragbox");this.minArea_=i.minArea!==undefined?i.minArea:64;this.startPixel_=null;this.condition_=i.condition?i.condition:wo.always;this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:Eo.defaultBoxEndCondition};kh.inherits(Eo,yo);Eo.defaultBoxEndCondition=function(t,i,s){var e=s[0]-i[0];var r=s[1]-i[1];return e*e+r*r>=this.minArea_};Eo.handleDragEvent_=function(t){if(!wo.mouseOnly(t)){return}this.box_.setPixels(this.startPixel_,t.pixel);this.dispatchEvent(new Eo.Event(Eo.EventType_.BOXDRAG,t.coordinate,t))};Eo.prototype.getGeometry=function(){return this.box_.getGeometry()};Eo.prototype.onBoxEnd=kh.nullFunction;Eo.handleUpEvent_=function(t){if(!wo.mouseOnly(t)){return true}this.box_.setMap(null);if(this.boxEndCondition_(t,this.startPixel_,t.pixel)){this.onBoxEnd(t);this.dispatchEvent(new Eo.Event(Eo.EventType_.BOXEND,t.coordinate,t))}return false};Eo.handleDownEvent_=function(t){if(!wo.mouseOnly(t)){return false}if(wo.mouseActionButton(t)&&this.condition_(t)){this.startPixel_=t.pixel;this.box_.setMap(t.map);this.box_.setPixels(this.startPixel_,this.startPixel_);this.dispatchEvent(new Eo.Event(Eo.EventType_.BOXSTART,t.coordinate,t));return true}else{return false}};Eo.EventType_={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"};Eo.Event=function(t,i,s){Oh.call(this,t);this.coordinate=i;this.mapBrowserEvent=s};kh.inherits(Eo.Event,Oh);var No=function(t){var i=t?t:{};var s=i.condition?i.condition:wo.shiftKeyOnly;this.duration_=i.duration!==undefined?i.duration:200;this.out_=i.out!==undefined?i.out:false;Eo.call(this,{condition:s,className:i.className||"ol-dragzoom"})};kh.inherits(No,Eo);No.prototype.onBoxEnd=function(){var t=this.getMap();var i=t.getView();var s=t.getSize();var e=this.getGeometry().getExtent();if(this.out_){var r=i.calculateExtent(s);var n=qh.createOrUpdateFromCoordinates([t.getPixelFromCoordinate(qh.getBottomLeft(e)),t.getPixelFromCoordinate(qh.getTopRight(e))]);var h=i.getResolutionForExtent(n,s);qh.scaleFromCenter(r,1/h);e=r}var a=i.constrainResolution(i.getResolutionForExtent(e,s));var o=qh.getCenter(e);o=i.constrainCenter(o);i.animate({resolution:a,center:o,duration:this.duration_,easing:Za.easeOut})};var Co={LEFT:37,UP:38,RIGHT:39,DOWN:40};var Io=function(t){_o.call(this,{handleEvent:Io.handleEvent});var i=t||{};this.defaultCondition_=function(t){return wo.noModifierKeys(t)&&wo.targetNotEditable(t)};this.condition_=i.condition!==undefined?i.condition:this.defaultCondition_;this.duration_=i.duration!==undefined?i.duration:100;this.pixelDelta_=i.pixelDelta!==undefined?i.pixelDelta:128};kh.inherits(Io,_o);Io.handleEvent=function(t){var i=false;if(t.type==Ah.KEYDOWN){var s=t.originalEvent;var e=s.keyCode;if(this.condition_(t)&&(e==Co.DOWN||e==Co.LEFT||e==Co.RIGHT||e==Co.UP)){var r=t.map;var n=r.getView();var h=n.getResolution()*this.pixelDelta_;var a=0,o=0;if(e==Co.DOWN){o=-h}else if(e==Co.LEFT){a=-h}else if(e==Co.RIGHT){a=h}else{o=h}var f=[a,o];Ja.rotate(f,n.getRotation());_o.pan(n,f,this.duration_);t.preventDefault();i=true}}return!i};var So=function(t){_o.call(this,{handleEvent:So.handleEvent});var i=t?t:{};this.condition_=i.condition?i.condition:wo.targetNotEditable;this.delta_=i.delta?i.delta:1;this.duration_=i.duration!==undefined?i.duration:100};kh.inherits(So,_o);So.handleEvent=function(t){var i=false;if(t.type==Ah.KEYDOWN||t.type==Ah.KEYPRESS){var s=t.originalEvent;var e=s.charCode;if(this.condition_(t)&&(e=="+".charCodeAt(0)||e=="-".charCodeAt(0))){var r=t.map;var n=e=="+".charCodeAt(0)?this.delta_:-this.delta_;var h=r.getView();_o.zoomByDelta(h,n,undefined,this.duration_);t.preventDefault();i=true}}return!i};var Oo=function(t){_o.call(this,{handleEvent:Oo.handleEvent});var i=t||{};this.delta_=0;this.duration_=i.duration!==undefined?i.duration:250;this.timeout_=i.timeout!==undefined?i.timeout:80;this.useAnchor_=i.useAnchor!==undefined?i.useAnchor:true;this.constrainResolution_=i.constrainResolution||false;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_=undefined;this.mode_=undefined;this.trackpadEventGap_=400;this.trackpadTimeoutId_=undefined;this.trackpadDeltaPerZoom_=300;this.trackpadZoomBuffer_=1.5};kh.inherits(Oo,_o);Oo.handleEvent=function(t){var i=t.type;if(i!==Ah.WHEEL&&i!==Ah.MOUSEWHEEL){return true}t.preventDefault();var s=t.map;var e=t.originalEvent;if(this.useAnchor_){this.lastAnchor_=t.coordinate}var r;if(t.type==Ah.WHEEL){r=e.deltaY;if(ga.FIREFOX&&e.deltaMode===WheelEvent.DOM_DELTA_PIXEL){r/=ga.DEVICE_PIXEL_RATIO}if(e.deltaMode===WheelEvent.DOM_DELTA_LINE){r*=40}}else if(t.type==Ah.MOUSEWHEEL){r=-e.wheelDeltaY;if(ga.SAFARI){r/=3}}if(r===0){return false}var n=Date.now();if(this.startTime_===undefined){this.startTime_=n}if(!this.mode_||n-this.startTime_>this.trackpadEventGap_){this.mode_=Math.abs(r)<4?Oo.Mode_.TRACKPAD:Oo.Mode_.WHEEL}if(this.mode_===Oo.Mode_.TRACKPAD){var h=s.getView();if(this.trackpadTimeoutId_){clearTimeout(this.trackpadTimeoutId_)}else{h.setHint(Ya.INTERACTING,1)}this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=h.getResolution()*Math.pow(2,r/this.trackpadDeltaPerZoom_);var o=h.getMinResolution();var f=h.getMaxResolution();var u=0;if(a<o){a=Math.max(a,o/this.trackpadZoomBuffer_);u=1}else if(a>f){a=Math.min(a,f*this.trackpadZoomBuffer_);u=-1}if(this.lastAnchor_){var v=h.calculateCenterZoom(a,this.lastAnchor_);h.setCenter(h.constrainCenter(v))}h.setResolution(a);if(u===0&&this.constrainResolution_){h.animate({resolution:h.constrainResolution(a,r>0?-1:1),easing:Za.easeOut,anchor:this.lastAnchor_,duration:this.duration_})}if(u>0){h.animate({resolution:o,easing:Za.easeOut,anchor:this.lastAnchor_,duration:500})}else if(u<0){h.animate({resolution:f,easing:Za.easeOut,anchor:this.lastAnchor_,duration:500})}this.startTime_=n;return false}this.delta_+=r;var l=Math.max(this.timeout_-(n-this.startTime_),0);clearTimeout(this.timeoutId_);this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,s),l);return false};Oo.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=undefined;var t=this.getMap().getView();t.setHint(Ya.INTERACTING,-1)};Oo.prototype.handleWheelZoom_=function(t){var i=t.getView();if(i.getAnimating()){i.cancelAnimations()}var s=kh.MOUSEWHEELZOOM_MAXDELTA;var e=Fh.clamp(this.delta_,-s,s);_o.zoomByDelta(i,-e,this.lastAnchor_,this.duration_);this.mode_=undefined;this.delta_=0;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_=undefined};Oo.prototype.setMouseAnchor=function(t){this.useAnchor_=t;if(!t){this.lastAnchor_=null}};Oo.Mode_={TRACKPAD:"trackpad",WHEEL:"wheel"};var To=function(t){yo.call(this,{handleDownEvent:To.handleDownEvent_,handleDragEvent:To.handleDragEvent_,handleUpEvent:To.handleUpEvent_});var i=t||{};this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;this.threshold_=i.threshold!==undefined?i.threshold:.3;this.duration_=i.duration!==undefined?i.duration:250};kh.inherits(To,yo);To.handleDragEvent_=function(t){var i=0;var s=this.targetPointers[0];var e=this.targetPointers[1];var r=Math.atan2(e.clientY-s.clientY,e.clientX-s.clientX);if(this.lastAngle_!==undefined){var n=r-this.lastAngle_;this.rotationDelta_+=n;if(!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_){this.rotating_=true}i=n}this.lastAngle_=r;var h=t.map;var a=h.getView();if(a.getConstraints().rotation===Xa.disable){return}var o=h.getViewport().getBoundingClientRect();var f=yo.centroid(this.targetPointers);f[0]-=o.left;f[1]-=o.top;this.anchor_=h.getCoordinateFromPixel(f);if(this.rotating_){var u=a.getRotation();h.render();_o.rotateWithoutConstraints(a,u+i,this.anchor_)}};To.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map;var s=i.getView();s.setHint(Ya.INTERACTING,-1);if(this.rotating_){var e=s.getRotation();_o.rotate(s,e,this.anchor_,this.duration_)}return false}else{return true}};To.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;if(!this.handlingDownUpSequence){i.getView().setHint(Ya.INTERACTING,1)}return true}else{return false}};To.prototype.shouldStopEvent=Yh.FALSE;var Ao=function(t){yo.call(this,{handleDownEvent:Ao.handleDownEvent_,handleDragEvent:Ao.handleDragEvent_,handleUpEvent:Ao.handleUpEvent_});var i=t?t:{};this.constrainResolution_=i.constrainResolution||false;this.anchor_=null;this.duration_=i.duration!==undefined?i.duration:400;this.lastDistance_=undefined;this.lastScaleDelta_=1};kh.inherits(Ao,yo);Ao.handleDragEvent_=function(t){var i=1;var s=this.targetPointers[0];var e=this.targetPointers[1];var r=s.clientX-e.clientX;var n=s.clientY-e.clientY;var h=Math.sqrt(r*r+n*n);if(this.lastDistance_!==undefined){i=this.lastDistance_/h}this.lastDistance_=h;var a=t.map;var o=a.getView();var f=o.getResolution();var u=o.getMaxResolution();var v=o.getMinResolution();var l=f*i;if(l>u){i=u/f;l=u}else if(l<v){i=v/f;l=v}if(i!=1){this.lastScaleDelta_=i}var c=a.getViewport().getBoundingClientRect();var d=yo.centroid(this.targetPointers);d[0]-=c.left;d[1]-=c.top;this.anchor_=a.getCoordinateFromPixel(d);a.render();_o.zoomWithoutConstraints(o,l,this.anchor_)};Ao.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map;var s=i.getView();s.setHint(Ya.INTERACTING,-1);var e=s.getResolution();if(this.constrainResolution_||e<s.getMinResolution()||e>s.getMaxResolution()){var r=this.lastScaleDelta_-1;_o.zoom(s,e,this.anchor_,this.duration_,r)}return false}else{return true}};Ao.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;this.anchor_=null;this.lastDistance_=undefined;this.lastScaleDelta_=1;if(!this.handlingDownUpSequence){i.getView().setHint(Ya.INTERACTING,1)}return true}else{return false}};Ao.prototype.shouldStopEvent=Yh.FALSE;var Ro={};Ro.defaults=function(t){var i=t?t:{};var s=new xa;var e=new Mo(-.005,.05,100);var r=i.altShiftDragRotate!==undefined?i.altShiftDragRotate:true;if(r){s.push(new xo)}var n=i.doubleClickZoom!==undefined?i.doubleClickZoom:true;if(n){s.push(new go({delta:i.zoomDelta,duration:i.zoomDuration}))}var h=i.dragPan!==undefined?i.dragPan:true;if(h){s.push(new bo({kinetic:e}))}var a=i.pinchRotate!==undefined?i.pinchRotate:true;if(a){s.push(new To)}var o=i.pinchZoom!==undefined?i.pinchZoom:true;if(o){s.push(new Ao({constrainResolution:i.constrainResolution,duration:i.zoomDuration}))}var f=i.keyboard!==undefined?i.keyboard:true;if(f){s.push(new Io);s.push(new So({delta:i.zoomDelta,duration:i.zoomDuration}))}var u=i.mouseWheelZoom!==undefined?i.mouseWheelZoom:true;if(u){s.push(new Oo({constrainResolution:i.constrainResolution,duration:i.zoomDuration}))}var v=i.shiftDragZoom!==undefined?i.shiftDragZoom:true;if(v){s.push(new No({duration:i.zoomDuration}))}return s};var Po=function(t,i,s,e){Th.call(this);this.extent=t;this.pixelRatio_=s;this.resolution=i;this.state=e};kh.inherits(Po,Th);Po.prototype.changed=function(){this.dispatchEvent(Ah.CHANGE)};Po.prototype.getExtent=function(){return this.extent};Po.prototype.getImage=function(){};Po.prototype.getPixelRatio=function(){return this.pixelRatio_};Po.prototype.getResolution=function(){return this.resolution};Po.prototype.getState=function(){return this.state};Po.prototype.load=function(){};var Lo={IDLE:0,LOADING:1,LOADED:2,ERROR:3};var Do=function(t,i,s,e,r){this.loader_=r!==undefined?r:null;var n=r!==undefined?Lo.IDLE:Lo.LOADED;Po.call(this,t,i,s,n);this.canvas_=e;this.error_=null};kh.inherits(Do,Po);Do.prototype.getError=function(){return this.error_};Do.prototype.handleLoad_=function(t){if(t){this.error_=t;this.state=Lo.ERROR}else{this.state=Lo.LOADED}this.changed()};Do.prototype.load=function(){if(this.state==Lo.IDLE){this.state=Lo.LOADING;this.changed();this.loader_(this.handleLoad_.bind(this))}};Do.prototype.getImage=function(){return this.canvas_};var Fo={IMAGE:"IMAGE",TILE:"TILE",VECTOR_TILE:"VECTOR_TILE",VECTOR:"VECTOR"};var Go={IMAGE:"image",VECTOR:"vector"};var Wo=function(t,i,s,e,r){Oh.call(this,t);this.vectorContext=i;this.frameState=s;this.context=e;this.glContext=r};kh.inherits(Wo,Oh);var jo=function(t){Th.call(this);this.highWaterMark=t!==undefined?t:2048;this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null};kh.inherits(jo,Th);jo.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark};jo.prototype.clear=function(){this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null;this.dispatchEvent(Ah.CLEAR)};jo.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)};jo.prototype.forEach=function(t,i){var s=this.oldest_;while(s){t.call(i,s.value_,s.key_,this);s=s.newer}};jo.prototype.get=function(t){var i=this.entries_[t];Dh.assert(i!==undefined,15);if(i===this.newest_){return i.value_}else if(i===this.oldest_){this.oldest_=this.oldest_.newer;this.oldest_.older=null}else{i.newer.older=i.older;i.older.newer=i.newer}i.newer=null;i.older=this.newest_;this.newest_.newer=i;this.newest_=i;return i.value_};jo.prototype.remove=function(t){var i=this.entries_[t];Dh.assert(i!==undefined,15);if(i===this.newest_){this.newest_=i.older;if(this.newest_){this.newest_.newer=null}}else if(i===this.oldest_){this.oldest_=i.newer;if(this.oldest_){this.oldest_.older=null}}else{i.newer.older=i.older;i.older.newer=i.newer}delete this.entries_[t];--this.count_;return i.value_};jo.prototype.getCount=function(){return this.count_};jo.prototype.getKeys=function(){var t=new Array(this.count_);var i=0;var s;for(s=this.newest_;s;s=s.older){t[i++]=s.key_}return t};jo.prototype.getValues=function(){var t=new Array(this.count_);var i=0;var s;for(s=this.newest_;s;s=s.older){t[i++]=s.value_}return t};jo.prototype.peekLast=function(){return this.oldest_.value_};jo.prototype.peekLastKey=function(){return this.oldest_.key_};jo.prototype.peekFirstKey=function(){return this.newest_.key_};jo.prototype.pop=function(){var t=this.oldest_;delete this.entries_[t.key_];if(t.newer){t.newer.older=null}this.oldest_=t.newer;if(!this.oldest_){this.newest_=null}--this.count_;return t.value_};jo.prototype.replace=function(t,i){this.get(t);this.entries_[t].value_=i};jo.prototype.set=function(t,i){Dh.assert(!(t in this.entries_),16);var s={key_:t,newer:null,older:this.newest_,value_:i};if(!this.newest_){this.oldest_=s}else{this.newest_.newer=s}this.newest_=s;this.entries_[t]=s;++this.count_};jo.prototype.prune=function(){while(this.canExpireCache()){this.pop()}};var Vo={};Vo.defaultFont="10px sans-serif";Vo.defaultFillStyle=[0,0,0,1];Vo.defaultLineCap="round";Vo.defaultLineDash=[];Vo.defaultLineDashOffset=0;Vo.defaultLineJoin="round";Vo.defaultMiterLimit=10;Vo.defaultStrokeStyle=[0,0,0,1];Vo.defaultTextAlign="center";Vo.defaultTextBaseline="middle";Vo.defaultPadding=[0,0,0,0];Vo.defaultLineWidth=1;Vo.labelCache=new jo;Vo.checkedFonts_={};Vo.measureContext_=null;Vo.textHeights_={};Vo.checkFont=function(){var t=60;var i=Vo.checkedFonts_;var s=Vo.labelCache;var e="32px monospace";var r="wmytzilWMYTZIL@#/&?$%10";var n,h;function a(t){var i=Vo.getMeasureContext();i.font=e;h=i.measureText(r).width;var s=true;if(t!="monospace"){i.font="32px "+t+",monospace";var n=i.measureText(r).width;s=n!=h}return s}function o(){var e=true;for(var r in i){if(i[r]<t){if(a(r)){i[r]=t;Ch.clear(Vo.textHeights_);Vo.measureContext_=null;s.clear()}else{++i[r];e=false}}}if(e){window.clearInterval(n);n=undefined}}return function(s){var e=fo.getFontFamilies(s);if(!e){return}for(var r=0,h=e.length;r<h;++r){var f=e[r];if(!(f in i)){i[f]=t;if(!a(f)){i[f]=0;if(n===undefined){n=window.setInterval(o,32)}}}}}}();Vo.getMeasureContext=function(){var t=Vo.measureContext_;if(!t){t=Vo.measureContext_=$a.createCanvasContext2D(1,1)}return t};Vo.measureTextHeight=function(){var t;var i=Vo.textHeights_;return function(s){var e=i[s];if(e==undefined){if(!t){t=document.createElement("span");t.textContent="M";t.style.margin=t.style.padding="0 !important";t.style.position="absolute !important";t.style.left="-99999px !important"}t.style.font=s;document.body.appendChild(t);e=i[s]=t.offsetHeight;document.body.removeChild(t)}return e}}();Vo.measureTextWidth=function(t,i){var s=Vo.getMeasureContext();if(t!=s.font){s.font=t}return s.measureText(i).width};Vo.rotateAtOffset=function(t,i,s,e){if(i!==0){t.translate(s,e);t.rotate(i);t.translate(-s,-e)}};Vo.resetTransform_=sa.create();Vo.drawImage=function(t,i,s,e,r,n,h,a,o,f,u){var v;if(s!=1){v=t.globalAlpha;t.globalAlpha=v*s}if(i){t.setTransform.apply(t,i)}t.drawImage(e,r,n,h,a,o,f,h*u,a*u);if(v){t.globalAlpha=v}if(i){t.setTransform.apply(t,Vo.resetTransform_)}};var Uo={};Uo.HEX_COLOR_RE_=/^#(?:[0-9a-f]{3,4}){1,2}$/i;Uo.NAMED_COLOR_RE_=/^([a-z]*)$/i;Uo.asArray=function(t){if(Array.isArray(t)){return t}else{return Uo.fromString(t)}};Uo.asString=function(t){if(typeof t==="string"){return t}else{return Uo.toString(t)}};Uo.fromNamed=function(t){var i=document.createElement("div");i.style.color=t;document.body.appendChild(i);var s=getComputedStyle(i).color;document.body.removeChild(i);return s};Uo.fromString=function(){var t=1024;var i={};var s=0;return function(e){var r;if(i.hasOwnProperty(e)){r=i[e]}else{if(s>=t){var n=0;var h;for(h in i){if((n++&3)===0){delete i[h];--s}}}r=Uo.fromStringInternal_(e);i[e]=r;++s}return r}}();Uo.fromStringInternal_=function(t){var i,s,e,r,n,h;if(Uo.NAMED_COLOR_RE_.exec(t)){t=Uo.fromNamed(t)}if(Uo.HEX_COLOR_RE_.exec(t)){var a=t.length-1;var o;if(a<=4){o=1}else{o=2}var f=a===4||a===8;i=parseInt(t.substr(1+0*o,o),16);s=parseInt(t.substr(1+1*o,o),16);e=parseInt(t.substr(1+2*o,o),16);if(f){r=parseInt(t.substr(1+3*o,o),16)}else{r=255}if(o==1){i=(i<<4)+i;s=(s<<4)+s;e=(e<<4)+e;if(f){r=(r<<4)+r}}n=[i,s,e,r/255]}else if(t.indexOf("rgba(")==0){h=t.slice(5,-1).split(",").map(Number);n=Uo.normalize(h)}else if(t.indexOf("rgb(")==0){h=t.slice(4,-1).split(",").map(Number);h.push(1);n=Uo.normalize(h)}else{Dh.assert(false,14)}return n};Uo.normalize=function(t,i){var s=i||[];s[0]=Fh.clamp(t[0]+.5|0,0,255);s[1]=Fh.clamp(t[1]+.5|0,0,255);s[2]=Fh.clamp(t[2]+.5|0,0,255);s[3]=Fh.clamp(t[3],0,1);return s};Uo.toString=function(t){var i=t[0];if(i!=(i|0)){i=i+.5|0}var s=t[1];if(s!=(s|0)){s=s+.5|0}var e=t[2];if(e!=(e|0)){e=e+.5|0}var r=t[3]===undefined?1:t[3];return"rgba("+i+","+s+","+e+","+r+")"};var qo={};qo.asColorLike=function(t){if(qo.isColorLike(t)){return t}else{return Uo.asString(t)}};qo.isColorLike=function(t){return typeof t==="string"||t instanceof CanvasPattern||t instanceof CanvasGradient};var Xo=function(){};Xo.prototype.drawCustom=function(t,i,s){};Xo.prototype.drawGeometry=function(t){};Xo.prototype.setStyle=function(t){};Xo.prototype.drawCircle=function(t,i){};Xo.prototype.drawFeature=function(t,i){};Xo.prototype.drawGeometryCollection=function(t,i){};Xo.prototype.drawLineString=function(t,i){};Xo.prototype.drawMultiLineString=function(t,i){};Xo.prototype.drawMultiPoint=function(t,i){};Xo.prototype.drawMultiPolygon=function(t,i){};Xo.prototype.drawPoint=function(t,i){};Xo.prototype.drawPolygon=function(t,i){};Xo.prototype.drawText=function(t,i){};Xo.prototype.setFillStrokeStyle=function(t,i){};Xo.prototype.setImageStyle=function(t,i){};Xo.prototype.setTextStyle=function(t,i){};var Yo=function(t,i,s,e,r){Xo.call(this);this.context_=t;this.pixelRatio_=i;this.extent_=s;this.transform_=e;this.viewRotation_=r;this.contextFillState_=null;this.contextStrokeState_=null;this.contextTextState_=null;this.fillState_=null;this.strokeState_=null;this.image_=null;this.imageAnchorX_=0;this.imageAnchorY_=0;this.imageHeight_=0;this.imageOpacity_=0;this.imageOriginX_=0;this.imageOriginY_=0;this.imageRotateWithView_=false;this.imageRotation_=0;this.imageScale_=0;this.imageSnapToPixel_=false;this.imageWidth_=0;this.text_="";this.textOffsetX_=0;this.textOffsetY_=0;this.textRotateWithView_=false;this.textRotation_=0;this.textScale_=0;this.textFillState_=null;this.textStrokeState_=null;this.textState_=null;this.pixelCoordinates_=[];this.tmpLocalTransform_=sa.create()};kh.inherits(Yo,Xo);Yo.prototype.drawImages_=function(t,i,s,e){if(!this.image_){return}var r=Bh.transform2D(t,i,s,2,this.transform_,this.pixelCoordinates_);var n=this.context_;var h=this.tmpLocalTransform_;var a=n.globalAlpha;if(this.imageOpacity_!=1){n.globalAlpha=a*this.imageOpacity_}var o=this.imageRotation_;if(this.imageRotateWithView_){o+=this.viewRotation_}var f,u;for(f=0,u=r.length;f<u;f+=2){var v=r[f]-this.imageAnchorX_;var l=r[f+1]-this.imageAnchorY_;if(this.imageSnapToPixel_){v=Math.round(v);l=Math.round(l)}if(o!==0||this.imageScale_!=1){var c=v+this.imageAnchorX_;var d=l+this.imageAnchorY_;sa.compose(h,c,d,this.imageScale_,this.imageScale_,o,-c,-d);n.setTransform.apply(n,h)}n.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,v,l,this.imageWidth_,this.imageHeight_)}if(o!==0||this.imageScale_!=1){n.setTransform(1,0,0,1,0,0)}if(this.imageOpacity_!=1){n.globalAlpha=a}};Yo.prototype.drawText_=function(t,i,s,e){if(!this.textState_||this.text_===""){return}if(this.textFillState_){this.setContextFillState_(this.textFillState_)}if(this.textStrokeState_){this.setContextStrokeState_(this.textStrokeState_)}this.setContextTextState_(this.textState_);var r=Bh.transform2D(t,i,s,e,this.transform_,this.pixelCoordinates_);var n=this.context_;var h=this.textRotation_;if(this.textRotateWithView_){h+=this.viewRotation_}for(;i<s;i+=e){var a=r[i]+this.textOffsetX_;var o=r[i+1]+this.textOffsetY_;if(h!==0||this.textScale_!=1){var f=sa.compose(this.tmpLocalTransform_,a,o,this.textScale_,this.textScale_,h,-a,-o);n.setTransform.apply(n,f)}if(this.textStrokeState_){n.strokeText(this.text_,a,o)}if(this.textFillState_){n.fillText(this.text_,a,o)}}if(h!==0||this.textScale_!=1){n.setTransform(1,0,0,1,0,0)}};Yo.prototype.moveToLineTo_=function(t,i,s,e,r){var n=this.context_;var h=Bh.transform2D(t,i,s,e,this.transform_,this.pixelCoordinates_);n.moveTo(h[0],h[1]);var a=h.length;if(r){a-=2}for(var o=2;o<a;o+=2){n.lineTo(h[o],h[o+1])}if(r){n.closePath()}return s};Yo.prototype.drawRings_=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){i=this.moveToLineTo_(t,i,s[r],e,true)}return i};Yo.prototype.drawCircle=function(t){if(!qh.intersects(this.extent_,t.getExtent())){return}if(this.fillState_||this.strokeState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=ra.transform2D(t,this.transform_,this.pixelCoordinates_);var s=i[2]-i[0];var e=i[3]-i[1];var r=Math.sqrt(s*s+e*e);var n=this.context_;n.beginPath();n.arc(i[0],i[1],r,0,2*Math.PI);if(this.fillState_){n.fill()}if(this.strokeState_){n.stroke()}}if(this.text_!==""){this.drawText_(t.getCenter(),0,2,2)}};Yo.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke());this.setImageStyle(t.getImage());this.setTextStyle(t.getText())};Yo.prototype.drawGeometry=function(t){var i=t.getType();switch(i){case Gh.POINT:this.drawPoint(t);break;case Gh.LINE_STRING:this.drawLineString(t);break;case Gh.POLYGON:this.drawPolygon(t);break;case Gh.MULTI_POINT:this.drawMultiPoint(t);break;case Gh.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case Gh.MULTI_POLYGON:this.drawMultiPolygon(t);break;case Gh.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case Gh.CIRCLE:this.drawCircle(t);break}};Yo.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);if(!s||!qh.intersects(this.extent_,s.getExtent())){return}this.setStyle(i);this.drawGeometry(s)};Yo.prototype.drawGeometryCollection=function(t){var i=t.getGeometriesArray();var s,e;for(s=0,e=i.length;s<e;++s){this.drawGeometry(i[s])}};Yo.prototype.drawPoint=function(t){var i=t.getFlatCoordinates();var s=t.getStride();if(this.image_){this.drawImages_(i,0,i.length,s)}if(this.text_!==""){this.drawText_(i,0,i.length,s)}};Yo.prototype.drawMultiPoint=function(t){var i=t.getFlatCoordinates();var s=t.getStride();if(this.image_){this.drawImages_(i,0,i.length,s)}if(this.text_!==""){this.drawText_(i,0,i.length,s)}};Yo.prototype.drawLineString=function(t){if(!qh.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_;var s=t.getFlatCoordinates();i.beginPath();this.moveToLineTo_(s,0,s.length,t.getStride(),false);i.stroke()}if(this.text_!==""){var e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}};Yo.prototype.drawMultiLineString=function(t){var i=t.getExtent();if(!qh.intersects(this.extent_,i)){return}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var s=this.context_;var e=t.getFlatCoordinates();var r=0;var n=t.getEnds();var h=t.getStride();s.beginPath();var a,o;for(a=0,o=n.length;a<o;++a){r=this.moveToLineTo_(e,r,n[a],h,false)}s.stroke()}if(this.text_!==""){var f=t.getFlatMidpoints();this.drawText_(f,0,f.length,2)}};Yo.prototype.drawPolygon=function(t){if(!qh.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_||this.fillState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=this.context_;i.beginPath();this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride());if(this.fillState_){i.fill()}if(this.strokeState_){i.stroke()}}if(this.text_!==""){var s=t.getFlatInteriorPoint();this.drawText_(s,0,2,2)}};Yo.prototype.drawMultiPolygon=function(t){if(!qh.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_||this.fillState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=this.context_;var s=t.getOrientedFlatCoordinates();var e=0;var r=t.getEndss();var n=t.getStride();var h,a;i.beginPath();for(h=0,a=r.length;h<a;++h){var o=r[h];e=this.drawRings_(s,e,o,n)}if(this.fillState_){i.fill()}if(this.strokeState_){i.stroke()}}if(this.text_!==""){var f=t.getFlatInteriorPoints();this.drawText_(f,0,f.length,2)}};Yo.prototype.setContextFillState_=function(t){var i=this.context_;var s=this.contextFillState_;if(!s){i.fillStyle=t.fillStyle;this.contextFillState_={fillStyle:t.fillStyle}}else{if(s.fillStyle!=t.fillStyle){s.fillStyle=i.fillStyle=t.fillStyle}}};Yo.prototype.setContextStrokeState_=function(t){var i=this.context_;var s=this.contextStrokeState_;if(!s){i.lineCap=t.lineCap;if(ga.CANVAS_LINE_DASH){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.lineJoin=t.lineJoin;i.lineWidth=t.lineWidth;i.miterLimit=t.miterLimit;i.strokeStyle=t.strokeStyle;this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle}}else{if(s.lineCap!=t.lineCap){s.lineCap=i.lineCap=t.lineCap}if(ga.CANVAS_LINE_DASH){if(!jh.equals(s.lineDash,t.lineDash)){i.setLineDash(s.lineDash=t.lineDash)}if(s.lineDashOffset!=t.lineDashOffset){s.lineDashOffset=i.lineDashOffset=t.lineDashOffset}}if(s.lineJoin!=t.lineJoin){s.lineJoin=i.lineJoin=t.lineJoin}if(s.lineWidth!=t.lineWidth){s.lineWidth=i.lineWidth=t.lineWidth}if(s.miterLimit!=t.miterLimit){s.miterLimit=i.miterLimit=t.miterLimit}if(s.strokeStyle!=t.strokeStyle){s.strokeStyle=i.strokeStyle=t.strokeStyle}}};Yo.prototype.setContextTextState_=function(t){var i=this.context_;var s=this.contextTextState_;var e=t.textAlign?t.textAlign:Vo.defaultTextAlign;if(!s){i.font=t.font;i.textAlign=e;i.textBaseline=t.textBaseline;this.contextTextState_={font:t.font,textAlign:e,textBaseline:t.textBaseline}}else{if(s.font!=t.font){s.font=i.font=t.font}if(s.textAlign!=e){s.textAlign=e}if(s.textBaseline!=t.textBaseline){s.textBaseline=i.textBaseline=t.textBaseline}}};Yo.prototype.setFillStrokeStyle=function(t,i){if(!t){this.fillState_=null}else{var s=t.getColor();this.fillState_={fillStyle:qo.asColorLike(s?s:Vo.defaultFillStyle)}}if(!i){this.strokeState_=null}else{var e=i.getColor();var r=i.getLineCap();var n=i.getLineDash();var h=i.getLineDashOffset();var a=i.getLineJoin();var o=i.getWidth();var f=i.getMiterLimit();this.strokeState_={lineCap:r!==undefined?r:Vo.defaultLineCap,lineDash:n?n:Vo.defaultLineDash,lineDashOffset:h?h:Vo.defaultLineDashOffset,lineJoin:a!==undefined?a:Vo.defaultLineJoin,lineWidth:this.pixelRatio_*(o!==undefined?o:Vo.defaultLineWidth),miterLimit:f!==undefined?f:Vo.defaultMiterLimit,strokeStyle:qo.asColorLike(e?e:Vo.defaultStrokeStyle)}}};Yo.prototype.setImageStyle=function(t){if(!t){this.image_=null}else{var i=t.getAnchor();var s=t.getImage(1);var e=t.getOrigin();var r=t.getSize();this.imageAnchorX_=i[0];this.imageAnchorY_=i[1];this.imageHeight_=r[1];this.image_=s;this.imageOpacity_=t.getOpacity();this.imageOriginX_=e[0];this.imageOriginY_=e[1];this.imageRotateWithView_=t.getRotateWithView();this.imageRotation_=t.getRotation();this.imageScale_=t.getScale()*this.pixelRatio_;this.imageSnapToPixel_=t.getSnapToPixel();this.imageWidth_=r[0]}};Yo.prototype.setTextStyle=function(t){if(!t){this.text_=""}else{var i=t.getFill();if(!i){this.textFillState_=null}else{var s=i.getColor();this.textFillState_={fillStyle:qo.asColorLike(s?s:Vo.defaultFillStyle)}}var e=t.getStroke();if(!e){this.textStrokeState_=null}else{var r=e.getColor();var n=e.getLineCap();var h=e.getLineDash();var a=e.getLineDashOffset();var o=e.getLineJoin();var f=e.getWidth();var u=e.getMiterLimit();this.textStrokeState_={lineCap:n!==undefined?n:Vo.defaultLineCap,lineDash:h?h:Vo.defaultLineDash,lineDashOffset:a?a:Vo.defaultLineDashOffset,lineJoin:o!==undefined?o:Vo.defaultLineJoin,lineWidth:f!==undefined?f:Vo.defaultLineWidth,miterLimit:u!==undefined?u:Vo.defaultMiterLimit,strokeStyle:qo.asColorLike(r?r:Vo.defaultStrokeStyle)}}var v=t.getFont();var l=t.getOffsetX();var c=t.getOffsetY();var d=t.getRotateWithView();var m=t.getRotation();var p=t.getScale();var M=t.getText();var z=t.getTextAlign();var _=t.getTextBaseline();this.textState_={font:v!==undefined?v:Vo.defaultFont,textAlign:z!==undefined?z:Vo.defaultTextAlign,textBaseline:_!==undefined?_:Vo.defaultTextBaseline};this.text_=M!==undefined?M:"";this.textOffsetX_=l!==undefined?this.pixelRatio_*l:0;this.textOffsetY_=c!==undefined?this.pixelRatio_*c:0;this.textRotateWithView_=d!==undefined?d:false;this.textRotation_=m!==undefined?m:0;this.textScale_=this.pixelRatio_*(p!==undefined?p:1)}};var Bo=function(t){Rh.call(this);this.layer_=t};kh.inherits(Bo,Rh);Bo.prototype.forEachFeatureAtCoordinate=kh.nullFunction;Bo.prototype.hasFeatureAtCoordinate=Yh.FALSE;Bo.prototype.createLoadedTileFinder=function(t,i,s){return function(e,r){function n(t){if(!s[e]){s[e]={}}s[e][t.tileCoord.toString()]=t}return t.forEachLoadedTile(i,e,r,n)}};Bo.prototype.getLayer=function(){return this.layer_};Bo.prototype.handleImageChange_=function(t){var i=t.target;if(i.getState()===Lo.LOADED){this.renderIfReadyAndVisible()}};Bo.prototype.loadImage=function(t){var i=t.getState();if(i!=Lo.LOADED&&i!=Lo.ERROR){Ih.listen(t,Ah.CHANGE,this.handleImageChange_,this)}if(i==Lo.IDLE){t.load();i=t.getState()}return i==Lo.LOADED};Bo.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();if(t.getVisible()&&t.getSourceState()==io.READY){this.changed()}};Bo.prototype.scheduleExpireCache=function(t,i){if(i.canExpireCache()){var s=function(t,i,s){var e=kh.getUid(t).toString();if(e in s.usedTiles){t.expireCache(s.viewState.projection,s.usedTiles[e])}}.bind(null,i);t.postRenderFunctions.push(s)}};Bo.prototype.updateLogos=function(t,i){var s=i.getLogo();if(s!==undefined){if(typeof s==="string"){t.logos[s]=""}else if(s){Dh.assert(typeof s.href=="string",44);Dh.assert(typeof s.src=="string",45);t.logos[s.src]=s.href}}};Bo.prototype.updateUsedTiles=function(t,i,s,e){var r=kh.getUid(i).toString();var n=s.toString();if(r in t){if(n in t[r]){t[r][n].extend(e)}else{t[r][n]=e}}else{t[r]={};t[r][n]=e}};Bo.prototype.manageTilePyramid=function(t,i,s,e,r,n,h,a,o,f){var u=kh.getUid(i).toString();if(!(u in t.wantedTiles)){t.wantedTiles[u]={}}var v=t.wantedTiles[u];var l=t.tileQueue;var c=s.getMinZoom();var d,m,p,M,z,_;for(_=c;_<=h;++_){m=s.getTileRangeForExtentAndZ(n,_,m);p=s.getResolution(_);for(M=m.minX;M<=m.maxX;++M){for(z=m.minY;z<=m.maxY;++z){if(h-_<=a){d=i.getTile(_,M,z,e,r);if(d.getState()==Wa.IDLE){v[d.getKey()]=true;if(!l.isKeyQueued(d.getKey())){l.enqueue([d,u,s.getTileCoordCenter(d.tileCoord),p])}}if(o!==undefined){o.call(f,d)}}else{i.useTile(_,M,z,r)}}}}};var Ho=function(t){Bo.call(this,t);this.transform_=sa.create()};kh.inherits(Ho,Bo);Ho.prototype.clip=function(t,i,s){var e=i.pixelRatio;var r=i.size[0]*e;var n=i.size[1]*e;var h=i.viewState.rotation;var a=qh.getTopLeft(s);var o=qh.getTopRight(s);var f=qh.getBottomRight(s);var u=qh.getBottomLeft(s);sa.apply(i.coordinateToPixelTransform,a);sa.apply(i.coordinateToPixelTransform,o);sa.apply(i.coordinateToPixelTransform,f);sa.apply(i.coordinateToPixelTransform,u);t.save();Vo.rotateAtOffset(t,-h,r/2,n/2);t.beginPath();t.moveTo(a[0]*e,a[1]*e);t.lineTo(o[0]*e,o[1]*e);t.lineTo(f[0]*e,f[1]*e);t.lineTo(u[0]*e,u[1]*e);t.clip();Vo.rotateAtOffset(t,h,r/2,n/2)};Ho.prototype.dispatchComposeEvent_=function(t,i,s,e){var r=this.getLayer();if(r.hasListener(t)){var n=s.size[0]*s.pixelRatio;var h=s.size[1]*s.pixelRatio;var a=s.viewState.rotation;Vo.rotateAtOffset(i,-a,n/2,h/2);var o=e!==undefined?e:this.getTransform(s,0);var f=new Yo(i,s.pixelRatio,s.extent,o,s.viewState.rotation);var u=new Wo(t,f,s,i,null);r.dispatchEvent(u);Vo.rotateAtOffset(i,a,n/2,h/2)}};Ho.prototype.forEachLayerAtCoordinate=function(t,i,s,e){var r=this.forEachFeatureAtCoordinate(t,i,0,Yh.TRUE,this);if(r){return s.call(e,this.getLayer(),null)}else{return undefined}};Ho.prototype.postCompose=function(t,i,s,e){this.dispatchComposeEvent_(uo.POSTCOMPOSE,t,i,e)};Ho.prototype.preCompose=function(t,i,s){this.dispatchComposeEvent_(uo.PRECOMPOSE,t,i,s)};Ho.prototype.dispatchRenderEvent=function(t,i,s){this.dispatchComposeEvent_(uo.RENDER,t,i,s)};Ho.prototype.getTransform=function(t,i){var s=t.viewState;var e=t.pixelRatio;var r=e*t.size[0]/2;var n=e*t.size[1]/2;var h=e/s.resolution;var a=-h;var o=-s.rotation;var f=-s.center[0]+i;var u=-s.center[1];return sa.compose(this.transform_,r,n,h,a,o,f,u)};Ho.prototype.composeFrame=function(t,i,s){};Ho.prototype.prepareFrame=function(t,i){};var Jo=function(t){Ho.call(this,t);this.coordinateToCanvasPixelTransform=sa.create();this.hitCanvasContext_=null};kh.inherits(Jo,Ho);Jo.prototype.composeFrame=function(t,i,s){this.preCompose(s,t);var e=this.getImage();if(e){var r=i.extent;var n=r!==undefined&&!qh.containsExtent(r,t.extent)&&qh.intersects(r,t.extent);if(n){this.clip(s,t,r)}var h=this.getImageTransform();var a=s.globalAlpha;s.globalAlpha=i.opacity;var o=h[4];var f=h[5];var u=e.width*h[0];var v=e.height*h[3];s.drawImage(e,0,0,+e.width,+e.height,Math.round(o),Math.round(f),Math.round(u),Math.round(v));s.globalAlpha=a;if(n){s.restore()}}this.postCompose(s,t,i)};Jo.prototype.getImage=function(){};Jo.prototype.getImageTransform=function(){};Jo.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=this.getLayer();var h=n.getSource();var a=i.viewState.resolution;var o=i.viewState.rotation;var f=i.skippedFeatureUids;return h.forEachFeatureAtCoordinate(t,a,o,s,f,(function(t){return e.call(r,t,n)}))};Jo.prototype.forEachLayerAtCoordinate=function(t,i,s,e){if(!this.getImage()){return undefined}if(this.getLayer().getSource().forEachFeatureAtCoordinate!==kh.nullFunction){return Ho.prototype.forEachLayerAtCoordinate.apply(this,arguments)}else{var r=sa.apply(this.coordinateToCanvasPixelTransform,t.slice());Ja.scale(r,i.viewState.resolution/this.renderedResolution);if(!this.hitCanvasContext_){this.hitCanvasContext_=$a.createCanvasContext2D(1,1)}this.hitCanvasContext_.clearRect(0,0,1,1);this.hitCanvasContext_.drawImage(this.getImage(),r[0],r[1],1,1,0,0,1,1);var n=this.hitCanvasContext_.getImageData(0,0,1,1).data;if(n[3]>0){return s.call(e,this.getLayer(),n)}else{return undefined}}};var Zo=function(t){Jo.call(this,t);this.image_=null;this.imageTransform_=sa.create();this.skippedFeatures_=[];this.vectorRenderer_=null};kh.inherits(Zo,Jo);Zo["handles"]=function(t,i){return t===no.CANVAS&&(i.getType()===Fo.IMAGE||i.getType()===Fo.VECTOR&&i.getRenderMode()===Go.IMAGE)};Zo["create"]=function(t,i){var s=new Zo(i);if(i.getType()===Fo.VECTOR){var e=ro.getLayerRendererPlugins();for(var r=0,n=e.length;r<n;++r){var h=e[r];if(h!==Zo&&h["handles"](no.CANVAS,i)){s.setVectorRenderer(h["create"](t,i))}}}return s};Zo.prototype.getImage=function(){return!this.image_?null:this.image_.getImage()};Zo.prototype.getImageTransform=function(){return this.imageTransform_};Zo.prototype.prepareFrame=function(t,i){var s=t.pixelRatio;var e=t.size;var r=t.viewState;var n=r.center;var h=r.resolution;var a;var o=this.getLayer();var f=o.getSource();var u=t.viewHints;var v=t.extent;if(i.extent!==undefined){v=qh.getIntersection(v,i.extent)}if(!u[Ya.ANIMATING]&&!u[Ya.INTERACTING]&&!qh.isEmpty(v)){var l=r.projection;if(!kh.ENABLE_RASTER_REPROJECTION){var c=f.getProjection();if(c){l=c}}var d=this.vectorRenderer_;if(d){var m=d.context;var p=Ch.assign({},t,{size:[qh.getWidth(v)/h,qh.getHeight(v)/h],viewState:Ch.assign({},t.viewState,{rotation:0})});var M=Object.keys(p.skippedFeatureUids).sort();if(d.prepareFrame(p,i)&&(d.replayGroupChanged||!jh.equals(M,this.skippedFeatures_))){m.canvas.width=p.size[0]*s;m.canvas.height=p.size[1]*s;d.composeFrame(p,i,m);this.image_=new Do(v,h,s,m.canvas);this.skippedFeatures_=M}}else{a=f.getImage(v,h,s,l);if(a){var z=this.loadImage(a);if(z){this.image_=a}}}}if(this.image_){a=this.image_;var _=a.getExtent();var g=a.getResolution();var w=a.getPixelRatio();var y=s*g/(h*w);var b=sa.compose(this.imageTransform_,s*e[0]/2,s*e[1]/2,y,y,0,w*(_[0]-n[0])/g,w*(n[1]-_[3])/g);sa.compose(this.coordinateToCanvasPixelTransform,s*e[0]/2-b[4],s*e[1]/2-b[5],s/h,-s/h,0,-n[0],-n[1]);this.updateLogos(t,f);this.renderedResolution=g*s/w}return!!this.image_};Zo.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(this.vectorRenderer_){return this.vectorRenderer_.forEachFeatureAtCoordinate(t,i,s,e,r)}else{return Jo.prototype.forEachFeatureAtCoordinate.call(this,t,i,s,e,r)}};Zo.prototype.setVectorRenderer=function(t){this.vectorRenderer_=t};var Ko=function(){this.cache_={};this.cacheSize_=0;this.maxCacheSize_=32};Ko.getKey=function(t,i,s){var e=s?Uo.asString(s):"null";return i+":"+t+":"+e};Ko.prototype.clear=function(){this.cache_={};this.cacheSize_=0};Ko.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t=0;var i,s;for(i in this.cache_){s=this.cache_[i];if((t++&3)===0&&!s.hasListener()){delete this.cache_[i];--this.cacheSize_}}}};Ko.prototype.get=function(t,i,s){var e=Ko.getKey(t,i,s);return e in this.cache_?this.cache_[e]:null};Ko.prototype.set=function(t,i,s,e){var r=Ko.getKey(t,i,s);this.cache_[r]=e;++this.cacheSize_};Ko.prototype.setSize=function(t){this.maxCacheSize_=t;this.expire()};var $o={};$o.iconImageCache=new Ko;var Qo=function(t,i){Sh.call(this);this.map_=i;this.layerRenderers_={};this.layerRendererListeners_={}};kh.inherits(Qo,Sh);Qo.prototype.calculateMatrices2D=function(t){var i=t.viewState;var s=t.coordinateToPixelTransform;var e=t.pixelToCoordinateTransform;sa.compose(s,t.size[0]/2,t.size[1]/2,1/i.resolution,-1/i.resolution,-i.rotation,-i.center[0],-i.center[1]);sa.invert(sa.setFromArray(e,s))};Qo.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_){this.removeLayerRendererByKey_(t).dispose()}};Qo.expireIconCache_=function(t,i){var s=$o.iconImageCache;s.expire()};Qo.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){var a;var o=i.viewState;var f=o.resolution;function u(t,s){var n=kh.getUid(t).toString();var h=i.layerStates[kh.getUid(s)].managed;if(!(n in i.skippedFeatureUids&&!h)){return e.call(r,t,h?s:null)}}var v=o.projection;var l=t;if(v.canWrapX()){var c=v.getExtent();var d=qh.getWidth(c);var m=t[0];if(m<c[0]||m>c[2]){var p=Math.ceil((c[0]-m)/d);l=[m+d*p,t[1]]}}var M=i.layerStatesArray;var z=M.length;var _;for(_=z-1;_>=0;--_){var g=M[_];var w=g.layer;if(vo.visibleAtResolution(g,f)&&n.call(h,w)){var y=this.getLayerRenderer(w);if(w.getSource()){a=y.forEachFeatureAtCoordinate(w.getSource().getWrapX()?l:t,i,s,u,r)}if(a){return a}}}return undefined};Qo.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){};Qo.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r){var n=this.forEachFeatureAtCoordinate(t,i,s,Yh.TRUE,this,e,r);return n!==undefined};Qo.prototype.getLayerRenderer=function(t){var i=kh.getUid(t).toString();if(i in this.layerRenderers_){return this.layerRenderers_[i]}else{var s=ro.getLayerRendererPlugins();var e;var r=this.getType();for(var n=0,h=s.length;n<h;++n){var a=s[n];if(a["handles"](r,t)){e=a["create"](this,t);break}}if(e){this.layerRenderers_[i]=e;this.layerRendererListeners_[i]=Ih.listen(e,Ah.CHANGE,this.handleLayerRendererChange_,this)}else{throw new Error("Unable to create renderer for layer: "+t.getType())}return e}};Qo.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]};Qo.prototype.getLayerRenderers=function(){return this.layerRenderers_};Qo.prototype.getMap=function(){return this.map_};Qo.prototype.getType=function(){};Qo.prototype.handleLayerRendererChange_=function(){this.map_.render()};Qo.prototype.removeLayerRendererByKey_=function(t){var i=this.layerRenderers_[t];delete this.layerRenderers_[t];Ih.unlistenByKey(this.layerRendererListeners_[t]);delete this.layerRendererListeners_[t];return i};Qo.prototype.renderFrame=kh.nullFunction;Qo.prototype.removeUnusedLayerRenderers_=function(t,i){var s;for(s in this.layerRenderers_){if(!i||!(s in i.layerStates)){this.removeLayerRendererByKey_(s).dispose()}}};Qo.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(Qo.expireIconCache_)};Qo.prototype.scheduleRemoveUnusedLayerRenderers=function(t){var i;for(i in this.layerRenderers_){if(!(i in t.layerStates)){t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this));return}}};Qo.sortByZIndex=function(t,i){return t.zIndex-i.zIndex};var tf=function(t,i){Qo.call(this,t,i);this.context_=$a.createCanvasContext2D();this.canvas_=this.context_.canvas;this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=fo.CLASS_UNSELECTABLE;t.insertBefore(this.canvas_,t.childNodes[0]||null);this.renderedVisible_=true;this.transform_=sa.create()};kh.inherits(tf,Qo);tf["handles"]=function(t){return t===no.CANVAS};tf["create"]=function(t,i){return new tf(t,i)};tf.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();var e=this.context_;if(s.hasListener(t)){var r=i.extent;var n=i.pixelRatio;var h=i.viewState;var a=h.rotation;var o=this.getTransform(i);var f=new Yo(e,n,r,o,a);var u=new Wo(t,f,i,e,null);s.dispatchEvent(u)}};tf.prototype.getTransform=function(t){var i=t.viewState;var s=this.canvas_.width/2;var e=this.canvas_.height/2;var r=t.pixelRatio/i.resolution;var n=-r;var h=-i.rotation;var a=-i.center[0];var o=-i.center[1];return sa.compose(this.transform_,s,e,r,n,h,a,o)};tf.prototype.getType=function(){return no.CANVAS};tf.prototype.renderFrame=function(t){if(!t){if(this.renderedVisible_){this.canvas_.style.display="none";this.renderedVisible_=false}return}var i=this.context_;var s=t.pixelRatio;var e=Math.round(t.size[0]*s);var r=Math.round(t.size[1]*s);if(this.canvas_.width!=e||this.canvas_.height!=r){this.canvas_.width=e;this.canvas_.height=r}else{i.clearRect(0,0,e,r)}var n=t.viewState.rotation;this.calculateMatrices2D(t);this.dispatchComposeEvent_(uo.PRECOMPOSE,t);var h=t.layerStatesArray;jh.stableSort(h,Qo.sortByZIndex);if(n){i.save();Vo.rotateAtOffset(i,n,e/2,r/2)}var a=t.viewState.resolution;var o,f,u,v,l;for(o=0,f=h.length;o<f;++o){l=h[o];u=l.layer;v=this.getLayerRenderer(u);if(!vo.visibleAtResolution(l,a)||l.sourceState!=io.READY){continue}if(v.prepareFrame(t,l)){v.composeFrame(t,l,i)}}if(n){i.restore()}this.dispatchComposeEvent_(uo.POSTCOMPOSE,t);if(!this.renderedVisible_){this.canvas_.style.display="";this.renderedVisible_=true}this.scheduleRemoveUnusedLayerRenderers(t);this.scheduleExpireIconCache(t)};tf.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){var h;var a=i.viewState;var o=a.resolution;var f=i.layerStatesArray;var u=f.length;var v=sa.apply(i.pixelToCoordinateTransform,t.slice());var l;for(l=u-1;l>=0;--l){var c=f[l];var d=c.layer;if(vo.visibleAtResolution(c,o)&&r.call(n,d)){var m=this.getLayerRenderer(d);h=m.forEachLayerAtCoordinate(v,i,s,e);if(h){return h}}}return undefined};var sf=function(t,i,s,e){this.minX=t;this.maxX=i;this.minY=s;this.maxY=e};sf.createOrUpdate=function(t,i,s,e,r){if(r!==undefined){r.minX=t;r.maxX=i;r.minY=s;r.maxY=e;return r}else{return new sf(t,i,s,e)}};sf.prototype.contains=function(t){return this.containsXY(t[1],t[2])};sf.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY};sf.prototype.containsXY=function(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY};sf.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY};sf.prototype.extend=function(t){if(t.minX<this.minX){this.minX=t.minX}if(t.maxX>this.maxX){this.maxX=t.maxX}if(t.minY<this.minY){this.minY=t.minY}if(t.maxY>this.maxY){this.maxY=t.maxY}};sf.prototype.getHeight=function(){return this.maxY-this.minY+1};sf.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]};sf.prototype.getWidth=function(){return this.maxX-this.minX+1};sf.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var ef=function(t){Jo.call(this,t);this.context=this.context===null?null:$a.createCanvasContext2D();this.renderedExtent_=null;this.renderedTiles=[];this.tmpExtent=qh.createEmpty();this.tmpTileRange_=new sf(0,0,0,0);this.imageTransform_=sa.create();this.zDirection=0};kh.inherits(ef,Jo);ef["handles"]=function(t,i){return t===no.CANVAS&&i.getType()===Fo.TILE};ef["create"]=function(t,i){return new ef(i)};ef.prototype.isDrawableTile_=function(t){var i=t.getState();var s=this.getLayer().getUseInterimTilesOnError();return i==Wa.LOADED||i==Wa.EMPTY||i==Wa.ERROR&&!s};ef.prototype.prepareFrame=function(t,i){var s=t.pixelRatio;var e=t.size;var r=t.viewState;var n=r.projection;var h=r.resolution;var a=r.center;var o=this.getLayer();var f=o.getSource();var u=f.getRevision();var v=f.getTileGridForProjection(n);var l=v.getZForResolution(h,this.zDirection);var c=v.getResolution(l);var d=Math.round(h/c)||1;var m=t.extent;if(i.extent!==undefined){m=qh.getIntersection(m,i.extent)}if(qh.isEmpty(m)){return false}var p=v.getTileRangeForExtentAndZ(m,l);var M=v.getTileRangeExtent(l,p);var z=f.getTilePixelRatio(s);var _={};_[l]={};var g=this.createLoadedTileFinder(f,n,_);var w=this.tmpExtent;var y=this.tmpTileRange_;var b=false;var x,k,E;for(k=p.minX;k<=p.maxX;++k){for(E=p.minY;E<=p.maxY;++E){x=f.getTile(l,k,E,s,n);if(x.getState()==Wa.ERROR){if(!o.getUseInterimTilesOnError()){x.setState(Wa.LOADED)}else if(o.getPreload()>0){b=true}}if(!this.isDrawableTile_(x)){x=x.getInterimTile()}if(this.isDrawableTile_(x)){var N=kh.getUid(this);if(x.getState()==Wa.LOADED){_[l][x.tileCoord.toString()]=x;var C=x.inTransition(N);if(!b&&(C||this.renderedTiles.indexOf(x)===-1)){b=true}}if(x.getAlpha(N,t.time)===1){continue}}var I=v.getTileCoordChildTileRange(x.tileCoord,y,w);var S=false;if(I){S=g(l+1,I)}if(!S){v.forEachTileCoordParentTileRange(x.tileCoord,g,null,y,w)}}}var O=c*s/z*d;var T=t.viewHints;var A=T[Ya.ANIMATING]||T[Ya.INTERACTING];if(!(this.renderedResolution&&Date.now()-t.time>16&&A)&&(b||!(this.renderedExtent_&&qh.containsExtent(this.renderedExtent_,m))||this.renderedRevision!=u||d!=this.oversampling_||!A&&O!=this.renderedResolution)){var R=this.context;if(R){var P=f.getTilePixelSize(l,s,n);var L=Math.round(p.getWidth()*P[0]/d);var D=Math.round(p.getHeight()*P[1]/d);var F=R.canvas;if(F.width!=L||F.height!=D){this.oversampling_=d;F.width=L;F.height=D}else{if(this.renderedExtent_&&!qh.equals(M,this.renderedExtent_)){R.clearRect(0,0,L,D)}d=this.oversampling_}}this.renderedTiles.length=0;var G=Object.keys(_).map(Number);G.sort((function(t,i){if(t===l){return 1}else if(i===l){return-1}else{return t>i?1:t<i?-1:0}}));var W,j,V,U,q,X;var Y,B,H,J,Z;for(q=0,X=G.length;q<X;++q){U=G[q];V=f.getTilePixelSize(U,s,n);W=v.getResolution(U);j=W/c;B=z*f.getGutter(n);H=_[U];for(var K in H){x=H[K];Y=v.getTileCoordExtent(x.getTileCoord(),w);k=(Y[0]-M[0])/c*z/d;E=(M[3]-Y[3])/c*z/d;J=V[0]*j/d;Z=V[1]*j/d;this.drawTileImage(x,t,i,k,E,J,Z,B,l===U);this.renderedTiles.push(x)}}this.renderedRevision=u;this.renderedResolution=c*s/z*d;this.renderedExtent_=M}var $=this.renderedResolution/h;var Q=sa.compose(this.imageTransform_,s*e[0]/2,s*e[1]/2,$,$,0,(this.renderedExtent_[0]-a[0])/this.renderedResolution*s,(a[1]-this.renderedExtent_[3])/this.renderedResolution*s);sa.compose(this.coordinateToCanvasPixelTransform,s*e[0]/2-Q[4],s*e[1]/2-Q[5],s/h,-s/h,0,-a[0],-a[1]);this.updateUsedTiles(t.usedTiles,f,l,p);this.manageTilePyramid(t,f,v,s,n,m,l,o.getPreload());this.scheduleExpireCache(t,f);this.updateLogos(t,f);return this.renderedTiles.length>0};ef.prototype.drawTileImage=function(t,i,s,e,r,n,h,a,o){var f=t.getImage(this.getLayer());if(!f){return}var u=kh.getUid(this);var v=o?t.getAlpha(u,i.time):1;if(v===1&&!this.getLayer().getSource().getOpaque(i.viewState.projection)){this.context.clearRect(e,r,n,h)}var l=v!==this.context.globalAlpha;if(l){this.context.save();this.context.globalAlpha=v}this.context.drawImage(f,a,a,f.width-2*a,f.height-2*a,e,r,n,h);if(l){this.context.restore()}if(v!==1){i.animate=true}else if(o){t.endTransition(u)}};ef.prototype.getImage=function(){var t=this.context;return t?t.canvas:null};ef.prototype.getImageTransform=function(){return this.imageTransform_};var rf={exports:{}};(function(t,i){(function(i,s){t.exports=s()})(c,(function(){function t(t,s,r,n,h){i(t,s,r||0,n||t.length-1,h||e)}function i(t,e,r,n,h){while(n>r){if(n-r>600){var a=n-r+1;var o=e-r+1;var f=Math.log(a);var u=.5*Math.exp(2*f/3);var v=.5*Math.sqrt(f*u*(a-u)/a)*(o-a/2<0?-1:1);var l=Math.max(r,Math.floor(e-o*u/a+v));var c=Math.min(n,Math.floor(e+(a-o)*u/a+v));i(t,e,l,c,h)}var d=t[e];var m=r;var p=n;s(t,r,e);if(h(t[n],d)>0)s(t,r,n);while(m<p){s(t,m,p);m++;p--;while(h(t[m],d)<0)m++;while(h(t[p],d)>0)p--}if(h(t[r],d)===0)s(t,r,p);else{p++;s(t,p,n)}if(p<=e)r=p+1;if(e<=p)n=p-1}}function s(t,i,s){var e=t[i];t[i]=t[s];t[s]=e}function e(t,i){return t<i?-1:t>i?1:0}return t}))})(rf);var nf=af;var hf=rf.exports;function af(t,i){if(!(this instanceof af))return new af(t,i);this._maxEntries=Math.max(4,t||9);this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4));if(i){this._initFormat(i)}this.clear()}af.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,s=[],e=this.toBBox;if(!_f(t,i))return s;var r=[],n,h,a,o;while(i){for(n=0,h=i.children.length;n<h;n++){a=i.children[n];o=i.leaf?e(a):a;if(_f(t,o)){if(i.leaf)s.push(a);else if(zf(t,o))this._all(a,s);else r.push(a)}}i=r.pop()}return s},collides:function(t){var i=this.data,s=this.toBBox;if(!_f(t,i))return false;var e=[],r,n,h,a;while(i){for(r=0,n=i.children.length;r<n;r++){h=i.children[r];a=i.leaf?s(h):h;if(_f(t,a)){if(i.leaf||zf(t,a))return true;e.push(h)}}i=e.pop()}return false},load:function(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(var i=0,s=t.length;i<s;i++){this.insert(t[i])}return this}var e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length){this.data=e}else if(this.data.height===e.height){this._splitRoot(this.data,e)}else{if(this.data.height<e.height){var r=this.data;this.data=e;e=r}this._insert(e,this.data.height-e.height-1,true)}return this},insert:function(t){if(t)this._insert(t,this.data.height-1);return this},clear:function(){this.data=gf([]);return this},remove:function(t,i){if(!t)return this;var s=this.data,e=this.toBBox(t),r=[],n=[],h,a,o,f;while(s||r.length){if(!s){s=r.pop();a=r[r.length-1];h=n.pop();f=true}if(s.leaf){o=of(t,s.children,i);if(o!==-1){s.children.splice(o,1);r.push(s);this._condense(r);return this}}if(!f&&!s.leaf&&zf(s,e)){r.push(s);n.push(h);h=0;a=s;s=s.children[0]}else if(a){h++;s=a.children[h];f=false}else s=null}return this},toBBox:function(t){return t},compareMinX:lf,compareMinY:cf,toJSON:function(){return this.data},fromJSON:function(t){this.data=t;return this},_all:function(t,i){var s=[];while(t){if(t.leaf)i.push.apply(i,t.children);else s.push.apply(s,t.children);t=s.pop()}return i},_build:function(t,i,s,e){var r=s-i+1,n=this._maxEntries,h;if(r<=n){h=gf(t.slice(i,s+1));ff(h,this.toBBox);return h}if(!e){e=Math.ceil(Math.log(r)/Math.log(n));n=Math.ceil(r/Math.pow(n,e-1))}h=gf([]);h.leaf=false;h.height=e;var a=Math.ceil(r/n),o=a*Math.ceil(Math.sqrt(n)),f,u,v,l;wf(t,i,s,o,this.compareMinX);for(f=i;f<=s;f+=o){v=Math.min(f+o-1,s);wf(t,f,v,a,this.compareMinY);for(u=f;u<=v;u+=a){l=Math.min(u+a-1,v);h.children.push(this._build(t,u,l,e-1))}}ff(h,this.toBBox);return h},_chooseSubtree:function(t,i,s,e){var r,n,h,a,o,f,u,v;while(true){e.push(i);if(i.leaf||e.length-1===s)break;u=v=Infinity;for(r=0,n=i.children.length;r<n;r++){h=i.children[r];o=df(h);f=pf(t,h)-o;if(f<v){v=f;u=o<u?o:u;a=h}else if(f===v){if(o<u){u=o;a=h}}}i=a||i.children[0]}return i},_insert:function(t,i,s){var e=this.toBBox,r=s?t:e(t),n=[];var h=this._chooseSubtree(r,this.data,i,n);h.children.push(t);vf(h,r);while(i>=0){if(n[i].children.length>this._maxEntries){this._split(n,i);i--}else break}this._adjustParentBBoxes(r,n,i)},_split:function(t,i){var s=t[i],e=s.children.length,r=this._minEntries;this._chooseSplitAxis(s,r,e);var n=this._chooseSplitIndex(s,r,e);var h=gf(s.children.splice(n,s.children.length-n));h.height=s.height;h.leaf=s.leaf;ff(s,this.toBBox);ff(h,this.toBBox);if(i)t[i-1].children.push(h);else this._splitRoot(s,h)},_splitRoot:function(t,i){this.data=gf([t,i]);this.data.height=t.height+1;this.data.leaf=false;ff(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,s){var e,r,n,h,a,o,f,u;o=f=Infinity;for(e=i;e<=s-i;e++){r=uf(t,0,e,this.toBBox);n=uf(t,e,s,this.toBBox);h=Mf(r,n);a=df(r)+df(n);if(h<o){o=h;u=e;f=a<f?a:f}else if(h===o){if(a<f){f=a;u=e}}}return u},_chooseSplitAxis:function(t,i,s){var e=t.leaf?this.compareMinX:lf,r=t.leaf?this.compareMinY:cf,n=this._allDistMargin(t,i,s,e),h=this._allDistMargin(t,i,s,r);if(n<h)t.children.sort(e)},_allDistMargin:function(t,i,s,e){t.children.sort(e);var r=this.toBBox,n=uf(t,0,i,r),h=uf(t,s-i,s,r),a=mf(n)+mf(h),o,f;for(o=i;o<s-i;o++){f=t.children[o];vf(n,t.leaf?r(f):f);a+=mf(n)}for(o=s-i-1;o>=i;o--){f=t.children[o];vf(h,t.leaf?r(f):f);a+=mf(h)}return a},_adjustParentBBoxes:function(t,i,s){for(var e=s;e>=0;e--){vf(i[e],t)}},_condense:function(t){for(var i=t.length-1,s;i>=0;i--){if(t[i].children.length===0){if(i>0){s=t[i-1].children;s.splice(s.indexOf(t[i]),1)}else this.clear()}else ff(t[i],this.toBBox)}},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0]));this.compareMinY=new Function("a","b",i.join(t[1]));this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};function of(t,i,s){if(!s)return i.indexOf(t);for(var e=0;e<i.length;e++){if(s(t,i[e]))return e}return-1}function ff(t,i){uf(t,0,t.children.length,i,t)}function uf(t,i,s,e,r){if(!r)r=gf(null);r.minX=Infinity;r.minY=Infinity;r.maxX=-Infinity;r.maxY=-Infinity;for(var n=i,h;n<s;n++){h=t.children[n];vf(r,t.leaf?e(h):h)}return r}function vf(t,i){t.minX=Math.min(t.minX,i.minX);t.minY=Math.min(t.minY,i.minY);t.maxX=Math.max(t.maxX,i.maxX);t.maxY=Math.max(t.maxY,i.maxY);return t}function lf(t,i){return t.minX-i.minX}function cf(t,i){return t.minY-i.minY}function df(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function mf(t){return t.maxX-t.minX+(t.maxY-t.minY)}function pf(t,i){return(Math.max(i.maxX,t.maxX)-Math.min(i.minX,t.minX))*(Math.max(i.maxY,t.maxY)-Math.min(i.minY,t.minY))}function Mf(t,i){var s=Math.max(t.minX,i.minX),e=Math.max(t.minY,i.minY),r=Math.min(t.maxX,i.maxX),n=Math.min(t.maxY,i.maxY);return Math.max(0,r-s)*Math.max(0,n-e)}function zf(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function _f(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function gf(t){return{children:t,height:1,leaf:true,minX:Infinity,minY:Infinity,maxX:-Infinity,maxY:-Infinity}}function wf(t,i,s,e,r){var n=[i,s],h;while(n.length){s=n.pop();i=n.pop();if(s-i<=e)continue;h=i+Math.ceil((s-i)/e/2)*e;hf(t,h,i,s,r);n.push(i,h,h,s)}}var yf=function(){};yf.prototype.getReplay=function(t,i){};yf.prototype.isEmpty=function(){};var bf={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};var xf={};xf.lineString=function(t,i,s,e){var r=t[i];var n=t[i+1];var h=0;var a;for(a=i+e;a<s;a+=e){var o=t[a];var f=t[a+1];h+=Math.sqrt((o-r)*(o-r)+(f-n)*(f-n));r=o;n=f}return h};xf.linearRing=function(t,i,s,e){var r=xf.lineString(t,i,s,e);var n=t[s-e]-t[i];var h=t[s-e+1]-t[i+1];r+=Math.sqrt(n*n+h*h);return r};var kf={};kf.lineString=function(t,i,s,e,r,n,h,a){var o=[];var f=t[i]>t[s-e];var u=r.length;var v=t[i];var l=t[i+1];i+=e;var c=t[i];var d=t[i+1];var m=0;var p=Math.sqrt(Math.pow(c-v,2)+Math.pow(d-l,2));var M="";var z=0;var _,g,w;for(var y=0;y<u;++y){g=f?u-y-1:y;var b=r.charAt(g);M=f?b+M:M+b;var x=n(M)-z;z+=x;var k=h+x/2;while(i<s-e&&m+p<k){v=c;l=d;i+=e;c=t[i];d=t[i+1];m+=p;p=Math.sqrt(Math.pow(c-v,2)+Math.pow(d-l,2))}var E=k-m;var N=Math.atan2(d-l,c-v);if(f){N+=N>0?-Math.PI:Math.PI}if(w!==undefined){var C=N-w;C+=C>Math.PI?-2*Math.PI:C<-Math.PI?2*Math.PI:0;if(Math.abs(C)>a){return null}}var I=E/p;var S=Fh.lerp(v,c,I);var O=Fh.lerp(l,d,I);if(w==N){if(f){_[0]=S;_[1]=O;_[2]=x/2}_[4]=M}else{M=b;z=x;_=[S,O,x/2,N,M];if(f){o.unshift(_)}else{o.push(_)}w=N}h+=x}return o};var Ef={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12};var Nf={};Nf.ORDER=[bf.POLYGON,bf.CIRCLE,bf.LINE_STRING,bf.IMAGE,bf.TEXT,bf.DEFAULT];Nf.TEXT_ALIGN={};Nf.TEXT_ALIGN["left"]=0;Nf.TEXT_ALIGN["end"]=0;Nf.TEXT_ALIGN["center"]=.5;Nf.TEXT_ALIGN["right"]=1;Nf.TEXT_ALIGN["start"]=1;Nf.TEXT_ALIGN["top"]=0;Nf.TEXT_ALIGN["middle"]=.5;Nf.TEXT_ALIGN["hanging"]=.2;Nf.TEXT_ALIGN["alphabetic"]=.8;Nf.TEXT_ALIGN["ideographic"]=.8;Nf.TEXT_ALIGN["bottom"]=1;var Cf=function(t,i,s,e,r,n){Xo.call(this);this.declutterTree=n;this.tmpExtent_=qh.createEmpty();this.tolerance=t;this.maxExtent=i;this.overlaps=r;this.pixelRatio=e;this.maxLineWidth=0;this.resolution=s;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_=null;this.bufferedMaxExtent_=null;this.instructions=[];this.coordinates=[];this.coordinateCache_={};this.renderedTransform_=sa.create();this.hitDetectionInstructions=[];this.pixelCoordinates_=null;this.state={};this.viewRotation_=0;this.tmpLocalTransform_=sa.create();this.resetTransform_=sa.create()};kh.inherits(Cf,Xo);Cf.prototype.replayTextBackground_=function(t,i,s,e,r,n,h){t.beginPath();t.moveTo.apply(t,i);t.lineTo.apply(t,s);t.lineTo.apply(t,e);t.lineTo.apply(t,r);t.lineTo.apply(t,i);if(n){this.fillOrigin_=n[2];this.fill_(t)}if(h){this.setStrokeStyle_(t,h);t.stroke()}};Cf.prototype.replayImage_=function(t,i,s,e,r,n,h,a,o,f,u,v,l,c,d,m,p,M){var z=p||M;var _=this.tmpLocalTransform_;r*=l;n*=l;i-=r;s-=n;if(c){i=Math.round(i);s=Math.round(s)}var g=d+f>e.width?e.width-f:d;var w=a+u>e.height?e.height-u:a;var y=this.tmpExtent_;var b=m[3]+g*l+m[1];var x=m[0]+w*l+m[2];var k=i-m[3];var E=s-m[0];var N;var C;var I;var S;if(z||v!==0){N=[k,E];C=[k+b,E];I=[k+b,E+x];S=[k,E+x]}var O=null;if(v!==0){var T=i+r;var A=s+n;O=sa.compose(_,T,A,1,1,v,-T,-A);qh.createOrUpdateEmpty(y);qh.extendCoordinate(y,sa.apply(_,N));qh.extendCoordinate(y,sa.apply(_,C));qh.extendCoordinate(y,sa.apply(_,I));qh.extendCoordinate(y,sa.apply(_,S))}else{qh.createOrUpdate(k,E,k+b,E+x,y)}var R=t.canvas;var P=y[0]<=R.width&&y[2]>=0&&y[1]<=R.height&&y[3]>=0;if(h){if(!P&&h[4]==1){return}qh.extend(h,y);var L=P?[t,O?O.slice(0):null,o,e,f,u,g,w,i,s,l]:null;if(L&&z){L.push(p,M,N,C,I,S)}h.push(L)}else if(P){if(z){this.replayTextBackground_(t,N,C,I,S,p,M)}Vo.drawImage(t,O,o,e,f,u,g,w,i,s,l)}};Cf.prototype.applyPixelRatio=function(t){var i=this.pixelRatio;return i==1?t:t.map((function(t){return t*i}))};Cf.prototype.appendFlatCoordinates=function(t,i,s,e,r,n){var h=this.coordinates.length;var a=this.getBufferedMaxExtent();if(n){i+=e}var o=[t[i],t[i+1]];var f=[NaN,NaN];var u=true;var v,l,c;for(v=i+e;v<s;v+=e){f[0]=t[v];f[1]=t[v+1];c=qh.coordinateRelationship(a,f);if(c!==l){if(u){this.coordinates[h++]=o[0];this.coordinates[h++]=o[1]}this.coordinates[h++]=f[0];this.coordinates[h++]=f[1];u=false}else if(c===Uh.INTERSECTING){this.coordinates[h++]=f[0];this.coordinates[h++]=f[1];u=false}else{u=true}o[0]=f[0];o[1]=f[1];l=c}if(r&&u||v===i+e){this.coordinates[h++]=o[0];this.coordinates[h++]=o[1]}return h};Cf.prototype.drawCustomCoordinates_=function(t,i,s,e,r){for(var n=0,h=s.length;n<h;++n){var a=s[n];var o=this.appendFlatCoordinates(t,i,a,e,false,false);r.push(o);i=a}return i};Cf.prototype.drawCustom=function(t,i,s){this.beginGeometry(t,i);var e=t.getType();var r=t.getStride();var n=this.coordinates.length;var h,a,o,f;var u;if(e==Gh.MULTI_POLYGON){t=t;h=t.getOrientedFlatCoordinates();f=[];var v=t.getEndss();u=0;for(var l=0,c=v.length;l<c;++l){var d=[];u=this.drawCustomCoordinates_(h,u,v[l],r,d);f.push(d)}this.instructions.push([Ef.CUSTOM,n,f,t,s,oa.coordinatesss])}else if(e==Gh.POLYGON||e==Gh.MULTI_LINE_STRING){o=[];h=e==Gh.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates();u=this.drawCustomCoordinates_(h,0,t.getEnds(),r,o);this.instructions.push([Ef.CUSTOM,n,o,t,s,oa.coordinatess])}else if(e==Gh.LINE_STRING||e==Gh.MULTI_POINT){h=t.getFlatCoordinates();a=this.appendFlatCoordinates(h,0,h.length,r,false,false);this.instructions.push([Ef.CUSTOM,n,a,t,s,oa.coordinates])}else if(e==Gh.POINT){h=t.getFlatCoordinates();this.coordinates.push(h[0],h[1]);a=this.coordinates.length;this.instructions.push([Ef.CUSTOM,n,a,t,s])}this.endGeometry(t,i)};Cf.prototype.beginGeometry=function(t,i){this.beginGeometryInstruction1_=[Ef.BEGIN_GEOMETRY,i,0];this.instructions.push(this.beginGeometryInstruction1_);this.beginGeometryInstruction2_=[Ef.BEGIN_GEOMETRY,i,0];this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)};Cf.prototype.fill_=function(t){if(this.fillOrigin_){var i=sa.apply(this.renderedTransform_,this.fillOrigin_.slice());t.translate(i[0],i[1]);t.rotate(this.viewRotation_)}t.fill();if(this.fillOrigin_){t.setTransform.apply(t,Vo.resetTransform_)}};Cf.prototype.setStrokeStyle_=function(t,i){t.strokeStyle=i[1];t.lineWidth=i[2];t.lineCap=i[3];t.lineJoin=i[4];t.miterLimit=i[5];if(ga.CANVAS_LINE_DASH){t.lineDashOffset=i[7];t.setLineDash(i[6])}};Cf.prototype.renderDeclutter_=function(t,i){if(t&&t.length>5){var s=t[4];if(s==1||s==t.length-5){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};if(!this.declutterTree.collides(e)){this.declutterTree.insert(e);var r=Vo.drawImage;for(var n=5,h=t.length;n<h;++n){var a=t[n];if(a){if(a.length>11){this.replayTextBackground_(a[0],a[13],a[14],a[15],a[16],a[11],a[12])}r.apply(undefined,a)}}}t.length=5;qh.createOrUpdateEmpty(t)}}};Cf.prototype.replay_=function(t,i,s,e,r,n){var h;if(this.pixelCoordinates_&&jh.equals(i,this.renderedTransform_)){h=this.pixelCoordinates_}else{if(!this.pixelCoordinates_){this.pixelCoordinates_=[]}h=Bh.transform2D(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_);sa.setFromArray(this.renderedTransform_,i)}var a=!Ch.isEmpty(s);var o=0;var f=e.length;var u=0;var v;var l,c,d,m,p,M,z,_;var g=0;var w=0;var y=null;var b=null;var x=this.coordinateCache_;var k=this.viewRotation_;var E={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k};var N=this.instructions!=e||this.overlaps?0:200;while(o<f){var C=e[o];var I=C[0];var S,O,T;switch(I){case Ef.BEGIN_GEOMETRY:S=C[1];if(a&&s[kh.getUid(S).toString()]||!S.getGeometry()){o=C[2]}else if(n!==undefined&&!qh.intersects(n,S.getGeometry().getExtent())){o=C[2]+1}else{++o}break;case Ef.BEGIN_PATH:if(g>N){this.fill_(t);g=0}if(w>N){t.stroke();w=0}if(!g&&!w){t.beginPath();d=m=NaN}++o;break;case Ef.CIRCLE:u=C[1];var A=h[u];var R=h[u+1];var P=h[u+2];var L=h[u+3];var D=P-A;var F=L-R;var G=Math.sqrt(D*D+F*F);t.moveTo(A+G,R);t.arc(A,R,G,0,2*Math.PI,true);++o;break;case Ef.CLOSE_PATH:t.closePath();++o;break;case Ef.CUSTOM:u=C[1];v=C[2];var W=C[3];var j=C[4];var V=C.length==6?C[5]:undefined;E.geometry=W;E.feature=S;if(!(o in x)){x[o]=[]}var U=x[o];if(V){V(h,u,v,2,U)}else{U[0]=h[u];U[1]=h[u+1];U.length=2}j(U,E);++o;break;case Ef.DRAW_IMAGE:u=C[1];v=C[2];_=C[3];l=C[4];c=C[5];z=r?null:C[6];var q=C[7];var X=C[8];var Y=C[9];var B=C[10];var H=C[11];var J=C[12];var Z=C[13];var K=C[14];var $=C[15];var Q,tt,it;if(C.length>16){Q=C[16];tt=C[17];it=C[18]}else{Q=Vo.defaultPadding;tt=it=false}if(H){J+=k}for(;u<v;u+=2){this.replayImage_(t,h[u],h[u+1],_,l,c,z,q,X,Y,B,J,Z,K,$,Q,tt?y:null,it?b:null)}this.renderDeclutter_(z,S);++o;break;case Ef.DRAW_CHARS:var st=C[1];var et=C[2];var rt=C[3];z=r?null:C[4];var nt=C[5];var ht=C[6];var at=C[7];var ot=C[8];var ft=C[9];var ut=C[10];var vt=C[11];var lt=C[12];var ct=C[13];var dt=C[14];var mt=xf.lineString(h,st,et,2);var pt=ot(lt);if(nt||pt<=mt){var Mt=this.textStates[ct].textAlign;var zt=(mt-pt)*Nf.TEXT_ALIGN[Mt];var _t=kf.lineString(h,st,et,2,lt,ot,zt,at);if(_t){var gt,wt,yt,bt,xt;if(ut){for(gt=0,wt=_t.length;gt<wt;++gt){xt=_t[gt];yt=xt[4];bt=this.getImage(yt,ct,"",ut);l=xt[2]+vt;c=rt*bt.height+(.5-rt)*2*vt-ft;this.replayImage_(t,xt[0],xt[1],bt,l,c,z,bt.height,1,0,0,xt[3],dt,false,bt.width,Vo.defaultPadding,null,null)}}if(ht){for(gt=0,wt=_t.length;gt<wt;++gt){xt=_t[gt];yt=xt[4];bt=this.getImage(yt,ct,ht,"");l=xt[2];c=rt*bt.height-ft;this.replayImage_(t,xt[0],xt[1],bt,l,c,z,bt.height,1,0,0,xt[3],dt,false,bt.width,Vo.defaultPadding,null,null)}}}}this.renderDeclutter_(z,S);++o;break;case Ef.END_GEOMETRY:if(r!==undefined){S=C[1];var kt=r(S);if(kt){return kt}}++o;break;case Ef.FILL:if(N){g++}else{this.fill_(t)}++o;break;case Ef.MOVE_TO_LINE_TO:u=C[1];v=C[2];O=h[u];T=h[u+1];p=O+.5|0;M=T+.5|0;if(p!==d||M!==m){t.moveTo(O,T);d=p;m=M}for(u+=2;u<v;u+=2){O=h[u];T=h[u+1];p=O+.5|0;M=T+.5|0;if(u==v-2||p!==d||M!==m){t.lineTo(O,T);d=p;m=M}}++o;break;case Ef.SET_FILL_STYLE:y=C;this.fillOrigin_=C[2];if(g){this.fill_(t);g=0;if(w){t.stroke();w=0}}t.fillStyle=C[1];++o;break;case Ef.SET_STROKE_STYLE:b=C;if(w){t.stroke();w=0}this.setStrokeStyle_(t,C);++o;break;case Ef.STROKE:if(N){w++}else{t.stroke()}++o;break;default:++o;break}}if(g){this.fill_(t)}if(w){t.stroke()}return undefined};Cf.prototype.replay=function(t,i,s,e){this.viewRotation_=s;this.replay_(t,i,e,this.instructions,undefined,undefined)};Cf.prototype.replayHitDetection=function(t,i,s,e,r,n){this.viewRotation_=s;return this.replay_(t,i,e,this.hitDetectionInstructions,r,n)};Cf.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var i;var s=t.length;var e;var r;var n=-1;for(i=0;i<s;++i){e=t[i];r=e[0];if(r==Ef.END_GEOMETRY){n=i}else if(r==Ef.BEGIN_GEOMETRY){e[2]=i;jh.reverseSubArray(this.hitDetectionInstructions,n,i);n=-1}}};Cf.prototype.setFillStrokeStyle=function(t,i){var s=this.state;if(t){var e=t.getColor();s.fillStyle=qo.asColorLike(e?e:Vo.defaultFillStyle)}else{s.fillStyle=undefined}if(i){var r=i.getColor();s.strokeStyle=qo.asColorLike(r?r:Vo.defaultStrokeStyle);var n=i.getLineCap();s.lineCap=n!==undefined?n:Vo.defaultLineCap;var h=i.getLineDash();s.lineDash=h?h.slice():Vo.defaultLineDash;var a=i.getLineDashOffset();s.lineDashOffset=a?a:Vo.defaultLineDashOffset;var o=i.getLineJoin();s.lineJoin=o!==undefined?o:Vo.defaultLineJoin;var f=i.getWidth();s.lineWidth=f!==undefined?f:Vo.defaultLineWidth;var u=i.getMiterLimit();s.miterLimit=u!==undefined?u:Vo.defaultMiterLimit;if(s.lineWidth>this.maxLineWidth){this.maxLineWidth=s.lineWidth;this.bufferedMaxExtent_=null}}else{s.strokeStyle=undefined;s.lineCap=undefined;s.lineDash=null;s.lineDashOffset=undefined;s.lineJoin=undefined;s.lineWidth=undefined;s.miterLimit=undefined}};Cf.prototype.applyFill=function(t,i){var s=t.fillStyle;var e=[Ef.SET_FILL_STYLE,s];if(typeof s!=="string"){var r=i.getExtent();e.push([r[0],r[3]])}this.instructions.push(e)};Cf.prototype.applyStroke=function(t){this.instructions.push([Ef.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio])};Cf.prototype.updateFillStyle=function(t,i,s){var e=t.fillStyle;if(typeof e!=="string"||t.currentFillStyle!=e){i.call(this,t,s);t.currentFillStyle=e}};Cf.prototype.updateStrokeStyle=function(t,i){var s=t.strokeStyle;var e=t.lineCap;var r=t.lineDash;var n=t.lineDashOffset;var h=t.lineJoin;var a=t.lineWidth;var o=t.miterLimit;if(t.currentStrokeStyle!=s||t.currentLineCap!=e||r!=t.currentLineDash&&!jh.equals(t.currentLineDash,r)||t.currentLineDashOffset!=n||t.currentLineJoin!=h||t.currentLineWidth!=a||t.currentMiterLimit!=o){i.call(this,t);t.currentStrokeStyle=s;t.currentLineCap=e;t.currentLineDash=r;t.currentLineDashOffset=n;t.currentLineJoin=h;t.currentLineWidth=a;t.currentMiterLimit=o}};Cf.prototype.endGeometry=function(t,i){this.beginGeometryInstruction1_[2]=this.instructions.length;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length;this.beginGeometryInstruction2_=null;var s=[Ef.END_GEOMETRY,i];this.instructions.push(s);this.hitDetectionInstructions.push(s)};Cf.prototype.finish=kh.nullFunction;Cf.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_){this.bufferedMaxExtent_=qh.clone(this.maxExtent);if(this.maxLineWidth>0){var t=this.resolution*(this.maxLineWidth+1)/2;qh.buffer(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}}return this.bufferedMaxExtent_};var If=function(t,i,s,e,r,n){Cf.call(this,t,i,s,e,r,n);this.declutterGroup_=null;this.hitDetectionImage_=null;this.image_=null;this.anchorX_=undefined;this.anchorY_=undefined;this.height_=undefined;this.opacity_=undefined;this.originX_=undefined;this.originY_=undefined;this.rotateWithView_=undefined;this.rotation_=undefined;this.scale_=undefined;this.snapToPixel_=undefined;this.width_=undefined};kh.inherits(If,Cf);If.prototype.drawCoordinates_=function(t,i,s,e){return this.appendFlatCoordinates(t,i,s,e,false,false)};If.prototype.drawPoint=function(t,i){if(!this.image_){return}this.beginGeometry(t,i);var s=t.getFlatCoordinates();var e=t.getStride();var r=this.coordinates.length;var n=this.drawCoordinates_(s,0,s.length,e);this.instructions.push([Ef.DRAW_IMAGE,r,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([Ef.DRAW_IMAGE,r,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(t,i)};If.prototype.drawMultiPoint=function(t,i){if(!this.image_){return}this.beginGeometry(t,i);var s=t.getFlatCoordinates();var e=t.getStride();var r=this.coordinates.length;var n=this.drawCoordinates_(s,0,s.length,e);this.instructions.push([Ef.DRAW_IMAGE,r,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([Ef.DRAW_IMAGE,r,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(t,i)};If.prototype.finish=function(){this.reverseHitDetectionInstructions();this.anchorX_=undefined;this.anchorY_=undefined;this.hitDetectionImage_=null;this.image_=null;this.height_=undefined;this.scale_=undefined;this.opacity_=undefined;this.originX_=undefined;this.originY_=undefined;this.rotateWithView_=undefined;this.rotation_=undefined;this.snapToPixel_=undefined;this.width_=undefined};If.prototype.setImageStyle=function(t,i){var s=t.getAnchor();var e=t.getSize();var r=t.getHitDetectionImage(1);var n=t.getImage(1);var h=t.getOrigin();this.anchorX_=s[0];this.anchorY_=s[1];this.declutterGroup_=i;this.hitDetectionImage_=r;this.image_=n;this.height_=e[1];this.opacity_=t.getOpacity();this.originX_=h[0];this.originY_=h[1];this.rotateWithView_=t.getRotateWithView();this.rotation_=t.getRotation();this.scale_=t.getScale();this.snapToPixel_=t.getSnapToPixel();this.width_=e[0]};var Sf=function(t,i,s,e,r,n){Cf.call(this,t,i,s,e,r,n)};kh.inherits(Sf,Cf);Sf.prototype.drawFlatCoordinates_=function(t,i,s,e){var r=this.coordinates.length;var n=this.appendFlatCoordinates(t,i,s,e,false,false);var h=[Ef.MOVE_TO_LINE_TO,r,n];this.instructions.push(h);this.hitDetectionInstructions.push(h);return s};Sf.prototype.drawLineString=function(t,i){var s=this.state;var e=s.strokeStyle;var r=s.lineWidth;if(e===undefined||r===undefined){return}this.updateStrokeStyle(s,this.applyStroke);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Ef.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[Ef.BEGIN_PATH]);var n=t.getFlatCoordinates();var h=t.getStride();this.drawFlatCoordinates_(n,0,n.length,h);this.hitDetectionInstructions.push([Ef.STROKE]);this.endGeometry(t,i)};Sf.prototype.drawMultiLineString=function(t,i){var s=this.state;var e=s.strokeStyle;var r=s.lineWidth;if(e===undefined||r===undefined){return}this.updateStrokeStyle(s,this.applyStroke);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Ef.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[Ef.BEGIN_PATH]);var n=t.getEnds();var h=t.getFlatCoordinates();var a=t.getStride();var o=0;var f,u;for(f=0,u=n.length;f<u;++f){o=this.drawFlatCoordinates_(h,o,n[f],a)}this.hitDetectionInstructions.push([Ef.STROKE]);this.endGeometry(t,i)};Sf.prototype.finish=function(){var t=this.state;if(t.lastStroke!=undefined&&t.lastStroke!=this.coordinates.length){this.instructions.push([Ef.STROKE])}this.reverseHitDetectionInstructions();this.state=null};Sf.prototype.applyStroke=function(t){if(t.lastStroke!=undefined&&t.lastStroke!=this.coordinates.length){this.instructions.push([Ef.STROKE]);t.lastStroke=this.coordinates.length}t.lastStroke=0;Cf.prototype.applyStroke.call(this,t);this.instructions.push([Ef.BEGIN_PATH])};var Of=function(t,i,s,e,r,n){Cf.call(this,t,i,s,e,r,n)};kh.inherits(Of,Cf);Of.prototype.drawFlatCoordinatess_=function(t,i,s,e){var r=this.state;var n=r.fillStyle!==undefined;var h=r.strokeStyle!=undefined;var a=s.length;var o=[Ef.BEGIN_PATH];this.instructions.push(o);this.hitDetectionInstructions.push(o);for(var f=0;f<a;++f){var u=s[f];var v=this.coordinates.length;var l=this.appendFlatCoordinates(t,i,u,e,true,!h);var c=[Ef.MOVE_TO_LINE_TO,v,l];this.instructions.push(c);this.hitDetectionInstructions.push(c);if(h){var d=[Ef.CLOSE_PATH];this.instructions.push(d);this.hitDetectionInstructions.push(d)}i=u}var m=[Ef.FILL];this.hitDetectionInstructions.push(m);if(n){this.instructions.push(m)}if(h){var p=[Ef.STROKE];this.instructions.push(p);this.hitDetectionInstructions.push(p)}return i};Of.prototype.drawCircle=function(t,i){var s=this.state;var e=s.fillStyle;var r=s.strokeStyle;if(e===undefined&&r===undefined){return}this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Ef.SET_FILL_STYLE,Uo.asString(Vo.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([Ef.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var n=t.getFlatCoordinates();var h=t.getStride();var a=this.coordinates.length;this.appendFlatCoordinates(n,0,n.length,h,false,false);var o=[Ef.BEGIN_PATH];var f=[Ef.CIRCLE,a];this.instructions.push(o,f);this.hitDetectionInstructions.push(o,f);var u=[Ef.FILL];this.hitDetectionInstructions.push(u);if(s.fillStyle!==undefined){this.instructions.push(u)}if(s.strokeStyle!==undefined){var v=[Ef.STROKE];this.instructions.push(v);this.hitDetectionInstructions.push(v)}this.endGeometry(t,i)};Of.prototype.drawPolygon=function(t,i){var s=this.state;this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Ef.SET_FILL_STYLE,Uo.asString(Vo.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([Ef.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var e=t.getEnds();var r=t.getOrientedFlatCoordinates();var n=t.getStride();this.drawFlatCoordinatess_(r,0,e,n);this.endGeometry(t,i)};Of.prototype.drawMultiPolygon=function(t,i){var s=this.state;var e=s.fillStyle;var r=s.strokeStyle;if(e===undefined&&r===undefined){return}this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Ef.SET_FILL_STYLE,Uo.asString(Vo.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([Ef.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var n=t.getEndss();var h=t.getOrientedFlatCoordinates();var a=t.getStride();var o=0;var f,u;for(f=0,u=n.length;f<u;++f){o=this.drawFlatCoordinatess_(h,o,n[f],a)}this.endGeometry(t,i)};Of.prototype.finish=function(){this.reverseHitDetectionInstructions();this.state=null;var t=this.tolerance;if(t!==0){var i=this.coordinates;var s,e;for(s=0,e=i.length;s<e;++s){i[s]=fa.snap(i[s],t)}}};Of.prototype.setFillStrokeStyles_=function(t){var i=this.state;var s=i.fillStyle;if(s!==undefined){this.updateFillStyle(i,this.applyFill,t)}if(i.strokeStyle!==undefined){this.updateStrokeStyle(i,this.applyStroke)}};var Tf={};Tf.lineString=function(t,i,s,e,r){var n=s;var h=s;var a=0;var o=0;var f=s;var u,v,l,c,d,m,p,M,z,_;for(v=s;v<e;v+=r){var g=i[v];var w=i[v+1];if(d!==undefined){z=g-d;_=w-m;c=Math.sqrt(z*z+_*_);if(p!==undefined){o+=l;u=Math.acos((p*z+M*_)/(l*c));if(u>t){if(o>a){a=o;n=f;h=v}o=0;f=v-r}}l=c;p=z;M=_}d=g;m=w}o+=c;return o>a?[f,v]:[n,h]};var Af={POINT:"point",LINE:"line"};var Rf=function(t,i,s,e,r,n){Cf.call(this,t,i,s,e,r,n);this.labels_=null;this.text_="";this.textOffsetX_=0;this.textOffsetY_=0;this.textRotateWithView_=undefined;this.textRotation_=0;this.textFillState_=null;this.fillStates={};this.textStrokeState_=null;this.strokeStates={};this.textState_={};this.textStates={};this.textKey_="";this.fillKey_="";this.strokeKey_="";this.widths_={};var h=Vo.labelCache;h.prune()};kh.inherits(Rf,Cf);Rf.measureTextWidths=function(t,i,s){var e=i.length;var r=0;var n,h;for(h=0;h<e;++h){n=Vo.measureTextWidth(t,i[h]);r=Math.max(r,n);s.push(n)}return r};Rf.prototype.drawText=function(t,i){var s=this.textFillState_;var e=this.textStrokeState_;var r=this.textState_;if(this.text_===""||!r||!s&&!e){return}var n=this.coordinates.length;var h=t.getType();var a=null;var o=2;var f=2;var u,v;if(r.placement===Af.LINE){if(!qh.intersects(this.getBufferedMaxExtent(),t.getExtent())){return}var l;a=t.getFlatCoordinates();f=t.getStride();if(h==Gh.LINE_STRING){l=[a.length]}else if(h==Gh.MULTI_LINE_STRING){l=t.getEnds()}else if(h==Gh.POLYGON){l=t.getEnds().slice(0,1)}else if(h==Gh.MULTI_POLYGON){var c=t.getEndss();l=[];for(u=0,v=c.length;u<v;++u){l.push(c[u][0])}}this.beginGeometry(t,i);var d=r.textAlign;var m=0;var p;for(var M=0,z=l.length;M<z;++M){if(d==undefined){var _=Tf.lineString(r.maxAngle,a,m,l[M],f);m=_[0];p=_[1]}else{p=l[M]}for(u=m;u<p;u+=f){this.coordinates.push(a[u],a[u+1])}o=this.coordinates.length;m=l[M];this.drawChars_(n,o,this.declutterGroup_);n=o}this.endGeometry(t,i)}else{var g=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_);var w=g.width/this.pixelRatio;switch(h){case Gh.POINT:case Gh.MULTI_POINT:a=t.getFlatCoordinates();o=a.length;break;case Gh.LINE_STRING:a=t.getFlatMidpoint();break;case Gh.CIRCLE:a=t.getCenter();break;case Gh.MULTI_LINE_STRING:a=t.getFlatMidpoints();o=a.length;break;case Gh.POLYGON:a=t.getFlatInteriorPoint();if(!r.overflow&&a[2]/this.resolution<w){return}f=3;break;case Gh.MULTI_POLYGON:var y=t.getFlatInteriorPoints();a=[];for(u=0,v=y.length;u<v;u+=3){if(r.overflow||y[u+2]/this.resolution>=w){a.push(y[u],y[u+1])}}o=a.length;if(o==0){return}break}o=this.appendFlatCoordinates(a,0,o,f,false,false);this.beginGeometry(t,i);if(r.backgroundFill||r.backgroundStroke){this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke);this.updateFillStyle(this.state,this.applyFill,t);this.updateStrokeStyle(this.state,this.applyStroke)}this.drawTextImage_(g,n,o);this.endGeometry(t,i)}};Rf.prototype.getImage=function(t,i,s,e){var r;var n=e+i+t+s+this.pixelRatio;var h=Vo.labelCache;if(!h.containsKey(n)){var a=e?this.strokeStates[e]||this.textStrokeState_:null;var o=s?this.fillStates[s]||this.textFillState_:null;var f=this.textStates[i]||this.textState_;var u=this.pixelRatio;var v=f.scale*u;var l=Nf.TEXT_ALIGN[f.textAlign||Vo.defaultTextAlign];var c=e&&a.lineWidth?a.lineWidth:0;var d=t.split("\n");var m=d.length;var p=[];var M=Rf.measureTextWidths(f.font,d,p);var z=Vo.measureTextHeight(f.font);var _=z*m;var g=M+c;var w=$a.createCanvasContext2D(Math.ceil(g*v),Math.ceil((_+c)*v));r=w.canvas;h.set(n,r);if(v!=1){w.scale(v,v)}w.font=f.font;if(e){w.strokeStyle=a.strokeStyle;w.lineWidth=c*(ga.SAFARI?v:1);w.lineCap=a.lineCap;w.lineJoin=a.lineJoin;w.miterLimit=a.miterLimit;if(ga.CANVAS_LINE_DASH&&a.lineDash.length){w.setLineDash(a.lineDash);w.lineDashOffset=a.lineDashOffset}}if(s){w.fillStyle=o.fillStyle}w.textBaseline="middle";w.textAlign="center";var y=.5-l;var b=l*r.width/v+y*c;var x;if(e){for(x=0;x<m;++x){w.strokeText(d[x],b+y*p[x],.5*(c+z)+x*z)}}if(s){for(x=0;x<m;++x){w.fillText(d[x],b+y*p[x],.5*(c+z)+x*z)}}}return h.get(n)};Rf.prototype.drawTextImage_=function(t,i,s){var e=this.textState_;var r=this.textStrokeState_;var n=this.pixelRatio;var h=Nf.TEXT_ALIGN[e.textAlign||Vo.defaultTextAlign];var a=Nf.TEXT_ALIGN[e.textBaseline];var o=r&&r.lineWidth?r.lineWidth:0;var f=h*t.width/n+2*(.5-h)*o;var u=a*t.height/n+2*(.5-a)*o;this.instructions.push([Ef.DRAW_IMAGE,i,s,t,(f-this.textOffsetX_)*n,(u-this.textOffsetY_)*n,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,true,t.width,e.padding==Vo.defaultPadding?Vo.defaultPadding:e.padding.map((function(t){return t*n})),!!e.backgroundFill,!!e.backgroundStroke]);this.hitDetectionInstructions.push([Ef.DRAW_IMAGE,i,s,t,(f-this.textOffsetX_)*n,(u-this.textOffsetY_)*n,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/n,true,t.width,e.padding,!!e.backgroundFill,!!e.backgroundStroke])};Rf.prototype.drawChars_=function(t,i,s){var e=this.textStrokeState_;var r=this.textState_;var n=this.textFillState_;var h=this.strokeKey_;if(e){if(!(h in this.strokeStates)){this.strokeStates[h]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}}}var a=this.textKey_;if(!(this.textKey_ in this.textStates)){this.textStates[this.textKey_]={font:r.font,textAlign:r.textAlign||Vo.defaultTextAlign,scale:r.scale}}var o=this.fillKey_;if(n){if(!(o in this.fillStates)){this.fillStates[o]={fillStyle:n.fillStyle}}}var f=this.pixelRatio;var u=Nf.TEXT_ALIGN[r.textBaseline];var v=this.textOffsetY_*f;var l=this.text_;var c=r.font;var d=r.scale;var m=e?e.lineWidth*d/2:0;var p=this.widths_[c];if(!p){this.widths_[c]=p={}}this.instructions.push([Ef.DRAW_CHARS,t,i,u,s,r.overflow,o,r.maxAngle,function(t){var i=p[t];if(!i){i=p[t]=Vo.measureTextWidth(c,t)}return i*d*f},v,h,m*f,l,a,1]);this.hitDetectionInstructions.push([Ef.DRAW_CHARS,t,i,u,s,r.overflow,o,r.maxAngle,function(t){var i=p[t];if(!i){i=p[t]=Vo.measureTextWidth(c,t)}return i*d},v,h,m,l,a,1/f])};Rf.prototype.setTextStyle=function(t,i){var s,e,r;if(!t){this.text_=""}else{this.declutterGroup_=i;var n=t.getFill();if(!n){e=this.textFillState_=null}else{e=this.textFillState_;if(!e){e=this.textFillState_={}}e.fillStyle=qo.asColorLike(n.getColor()||Vo.defaultFillStyle)}var h=t.getStroke();if(!h){r=this.textStrokeState_=null}else{r=this.textStrokeState_;if(!r){r=this.textStrokeState_={}}var a=h.getLineDash();var o=h.getLineDashOffset();var f=h.getWidth();var u=h.getMiterLimit();r.lineCap=h.getLineCap()||Vo.defaultLineCap;r.lineDash=a?a.slice():Vo.defaultLineDash;r.lineDashOffset=o===undefined?Vo.defaultLineDashOffset:o;r.lineJoin=h.getLineJoin()||Vo.defaultLineJoin;r.lineWidth=f===undefined?Vo.defaultLineWidth:f;r.miterLimit=u===undefined?Vo.defaultMiterLimit:u;r.strokeStyle=qo.asColorLike(h.getColor()||Vo.defaultStrokeStyle)}s=this.textState_;var v=t.getFont()||Vo.defaultFont;Vo.checkFont(v);var l=t.getScale();s.overflow=t.getOverflow();s.font=v;s.maxAngle=t.getMaxAngle();s.placement=t.getPlacement();s.textAlign=t.getTextAlign();s.textBaseline=t.getTextBaseline()||Vo.defaultTextBaseline;s.backgroundFill=t.getBackgroundFill();s.backgroundStroke=t.getBackgroundStroke();s.padding=t.getPadding()||Vo.defaultPadding;s.scale=l===undefined?1:l;var c=t.getOffsetX();var d=t.getOffsetY();var m=t.getRotateWithView();var p=t.getRotation();this.text_=t.getText()||"";this.textOffsetX_=c===undefined?0:c;this.textOffsetY_=d===undefined?0:d;this.textRotateWithView_=m===undefined?false:m;this.textRotation_=p===undefined?0:p;this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:kh.getUid(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"";this.textKey_=s.font+s.scale+(s.textAlign||"?");this.fillKey_=e?typeof e.fillStyle=="string"?e.fillStyle:"|"+kh.getUid(e.fillStyle):""}};var Pf=function(t,i,s,e,r,n,h){yf.call(this);this.declutterTree_=n;this.declutterGroup_=null;this.tolerance_=t;this.maxExtent_=i;this.overlaps_=r;this.pixelRatio_=e;this.resolution_=s;this.renderBuffer_=h;this.replaysByZIndex_={};this.hitDetectionContext_=$a.createCanvasContext2D(1,1);this.hitDetectionTransform_=sa.create()};kh.inherits(Pf,yf);Pf.circleArrayCache_={0:[[true]]};Pf.fillCircleArrayRowToMiddle_=function(t,i,s){var e;var r=Math.floor(t.length/2);if(i>=r){for(e=r;e<i;e++){t[e][s]=true}}else if(i<r){for(e=i+1;e<r;e++){t[e][s]=true}}};Pf.getCircleArray_=function(t){if(Pf.circleArrayCache_[t]!==undefined){return Pf.circleArrayCache_[t]}var i=t*2+1;var s=new Array(i);for(var e=0;e<i;e++){s[e]=new Array(i)}var r=t;var n=0;var h=0;while(r>=n){Pf.fillCircleArrayRowToMiddle_(s,t+r,t+n);Pf.fillCircleArrayRowToMiddle_(s,t+n,t+r);Pf.fillCircleArrayRowToMiddle_(s,t-n,t+r);Pf.fillCircleArrayRowToMiddle_(s,t-r,t+n);Pf.fillCircleArrayRowToMiddle_(s,t-r,t-n);Pf.fillCircleArrayRowToMiddle_(s,t-n,t-r);Pf.fillCircleArrayRowToMiddle_(s,t+n,t-r);Pf.fillCircleArrayRowToMiddle_(s,t+r,t-n);n++;h+=1+2*n;if(2*(h-r)+1>0){r-=1;h+=1-2*r}}Pf.circleArrayCache_[t]=s;return s};Pf.replayDeclutter=function(t,i,s){var e=Object.keys(t).map(Number).sort(jh.numberSafeCompareFunction);var r={};for(var n=0,h=e.length;n<h;++n){var a=t[e[n].toString()];for(var o=0,f=a.length;o<f;){var u=a[o++];var v=a[o++];u.replay(i,v,s,r)}}};Pf.prototype.addDeclutter=function(t){var i=null;if(this.declutterTree_){if(t){i=this.declutterGroup_;i[4]++}else{i=this.declutterGroup_=qh.createEmpty();i.push(1)}}return i};Pf.prototype.clip=function(t,i){var s=this.getClipCoords(i);t.beginPath();t.moveTo(s[0],s[1]);t.lineTo(s[2],s[3]);t.lineTo(s[4],s[5]);t.lineTo(s[6],s[7]);t.clip()};Pf.prototype.hasReplays=function(t){for(var i in this.replaysByZIndex_){var s=this.replaysByZIndex_[i];for(var e=0,r=t.length;e<r;++e){if(t[e]in s){return true}}}return false};Pf.prototype.finish=function(){var t;for(t in this.replaysByZIndex_){var i=this.replaysByZIndex_[t];var s;for(s in i){i[s].finish()}}};Pf.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){e=Math.round(e);var a=e*2+1;var o=sa.compose(this.hitDetectionTransform_,e+.5,e+.5,1/i,-1/i,-s,-t[0],-t[1]);var f=this.hitDetectionContext_;if(f.canvas.width!==a||f.canvas.height!==a){f.canvas.width=a;f.canvas.height=a}else{f.clearRect(0,0,a,a)}var u;if(this.renderBuffer_!==undefined){u=qh.createEmpty();qh.extendCoordinate(u,t);qh.buffer(u,i*(this.renderBuffer_+e),u)}var v=Pf.getCircleArray_(e);var l;if(this.declutterTree_){l=this.declutterTree_.all().map((function(t){return t.value}))}var c;function d(t){var i=f.getImageData(0,0,a,a).data;for(var s=0;s<a;s++){for(var e=0;e<a;e++){if(v[s][e]){if(i[(e*a+s)*4+3]>0){var r;if(!(l&&(c==bf.IMAGE||c==bf.TEXT))||l.indexOf(t)!==-1){r=n(t)}if(r){return r}else{f.clearRect(0,0,a,a);return undefined}}}}}}var m=Object.keys(this.replaysByZIndex_).map(Number);m.sort(jh.numberSafeCompareFunction);var p,M,z,_,g;for(p=m.length-1;p>=0;--p){var w=m[p].toString();z=this.replaysByZIndex_[w];for(M=Nf.ORDER.length-1;M>=0;--M){c=Nf.ORDER[M];_=z[c];if(_!==undefined){if(h&&(c==bf.IMAGE||c==bf.TEXT)){var y=h[w];if(!y){h[w]=[_,o.slice(0)]}else{y.push(_,o.slice(0))}}else{g=_.replayHitDetection(f,o,s,r,d,u);if(g){return g}}}}}return undefined};Pf.prototype.getClipCoords=function(t){var i=this.maxExtent_;var s=i[0];var e=i[1];var r=i[2];var n=i[3];var h=[s,e,s,n,r,n,r,e];Bh.transform2D(h,0,8,2,t,h);return h};Pf.prototype.getReplay=function(t,i){var s=t!==undefined?t.toString():"0";var e=this.replaysByZIndex_[s];if(e===undefined){e={};this.replaysByZIndex_[s]=e}var r=e[i];if(r===undefined){var n=Pf.BATCH_CONSTRUCTORS_[i];r=new n(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_);e[i]=r}return r};Pf.prototype.getReplays=function(){return this.replaysByZIndex_};Pf.prototype.isEmpty=function(){return Ch.isEmpty(this.replaysByZIndex_)};Pf.prototype.replay=function(t,i,s,e,r,n){var h=Object.keys(this.replaysByZIndex_).map(Number);h.sort(jh.numberSafeCompareFunction);t.save();this.clip(t,i);var a=r?r:Nf.ORDER;var o,f,u,v,l,c;for(o=0,f=h.length;o<f;++o){var d=h[o].toString();l=this.replaysByZIndex_[d];for(u=0,v=a.length;u<v;++u){var m=a[u];c=l[m];if(c!==undefined){if(n&&(m==bf.IMAGE||m==bf.TEXT)){var p=n[d];if(!p){n[d]=[c,i.slice(0)]}else{p.push(c,i.slice(0))}}else{c.replay(t,i,s,e)}}}}t.restore()};Pf.BATCH_CONSTRUCTORS_={Circle:Of,Default:Cf,Image:If,LineString:Sf,Polygon:Of,Text:Rf};var Lf={};Lf.defaultOrder=function(t,i){return kh.getUid(t)-kh.getUid(i)};Lf.getSquaredTolerance=function(t,i){var s=Lf.getTolerance(t,i);return s*s};Lf.getTolerance=function(t,i){return kh.SIMPLIFY_TOLERANCE*t/i};Lf.renderCircleGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(r||n){var h=t.getReplay(s.getZIndex(),bf.CIRCLE);h.setFillStrokeStyle(r,n);h.drawCircle(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),bf.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Lf.renderFeature=function(t,i,s,e,r,n){var h=false;var a,o;a=s.getImage();if(a){o=a.getImageState();if(o==Lo.LOADED||o==Lo.ERROR){a.unlistenImageChange(r,n)}else{if(o==Lo.IDLE){a.load()}o=a.getImageState();a.listenImageChange(r,n);h=true}}Lf.renderFeature_(t,i,s,e);return h};Lf.renderFeature_=function(t,i,s,e){var r=s.getGeometryFunction()(i);if(!r){return}var n=r.getSimplifiedGeometry(e);var h=s.getRenderer();if(h){Lf.renderGeometry_(t,n,s,i)}else{var a=Lf.GEOMETRY_RENDERERS_[n.getType()];a(t,n,s,i)}};Lf.renderGeometry_=function(t,i,s,e){if(i.getType()==Gh.GEOMETRY_COLLECTION){var r=i.getGeometries();for(var n=0,h=r.length;n<h;++n){Lf.renderGeometry_(t,r[n],s,e)}return}var a=t.getReplay(s.getZIndex(),bf.DEFAULT);a.drawCustom(i,e,s.getRenderer())};Lf.renderGeometryCollectionGeometry_=function(t,i,s,e){var r=i.getGeometriesArray();var n,h;for(n=0,h=r.length;n<h;++n){var a=Lf.GEOMETRY_RENDERERS_[r[n].getType()];a(t,r[n],s,e)}};Lf.renderLineStringGeometry_=function(t,i,s,e){var r=s.getStroke();if(r){var n=t.getReplay(s.getZIndex(),bf.LINE_STRING);n.setFillStrokeStyle(null,r);n.drawLineString(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),bf.TEXT);a.setTextStyle(h,t.addDeclutter(false));a.drawText(i,e)}};Lf.renderMultiLineStringGeometry_=function(t,i,s,e){var r=s.getStroke();if(r){var n=t.getReplay(s.getZIndex(),bf.LINE_STRING);n.setFillStrokeStyle(null,r);n.drawMultiLineString(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),bf.TEXT);a.setTextStyle(h,t.addDeclutter(false));a.drawText(i,e)}};Lf.renderMultiPolygonGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(n||r){var h=t.getReplay(s.getZIndex(),bf.POLYGON);h.setFillStrokeStyle(r,n);h.drawMultiPolygon(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),bf.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Lf.renderPointGeometry_=function(t,i,s,e){var r=s.getImage();if(r){if(r.getImageState()!=Lo.LOADED){return}var n=t.getReplay(s.getZIndex(),bf.IMAGE);n.setImageStyle(r,t.addDeclutter(false));n.drawPoint(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),bf.TEXT);a.setTextStyle(h,t.addDeclutter(!!r));a.drawText(i,e)}};Lf.renderMultiPointGeometry_=function(t,i,s,e){var r=s.getImage();if(r){if(r.getImageState()!=Lo.LOADED){return}var n=t.getReplay(s.getZIndex(),bf.IMAGE);n.setImageStyle(r,t.addDeclutter(false));n.drawMultiPoint(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),bf.TEXT);a.setTextStyle(h,t.addDeclutter(!!r));a.drawText(i,e)}};Lf.renderPolygonGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(r||n){var h=t.getReplay(s.getZIndex(),bf.POLYGON);h.setFillStrokeStyle(r,n);h.drawPolygon(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),bf.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Lf.GEOMETRY_RENDERERS_={Point:Lf.renderPointGeometry_,LineString:Lf.renderLineStringGeometry_,Polygon:Lf.renderPolygonGeometry_,MultiPoint:Lf.renderMultiPointGeometry_,MultiLineString:Lf.renderMultiLineStringGeometry_,MultiPolygon:Lf.renderMultiPolygonGeometry_,GeometryCollection:Lf.renderGeometryCollectionGeometry_,Circle:Lf.renderCircleGeometry_};var Df=function(t){Ho.call(this,t);this.declutterTree_=t.getDeclutter()?nf(9):null;this.dirty_=false;this.renderedRevision_=-1;this.renderedResolution_=NaN;this.renderedExtent_=qh.createEmpty();this.renderedRenderOrder_=null;this.replayGroup_=null;this.replayGroupChanged=true;this.context=$a.createCanvasContext2D();Ih.listen(Vo.labelCache,Ah.CLEAR,this.handleFontsChanged_,this)};kh.inherits(Df,Ho);Df["handles"]=function(t,i){return t===no.CANVAS&&i.getType()===Fo.VECTOR};Df["create"]=function(t,i){return new Df(i)};Df.prototype.disposeInternal=function(){Ih.unlisten(Vo.labelCache,Ah.CLEAR,this.handleFontsChanged_,this);Ho.prototype.disposeInternal.call(this)};Df.prototype.composeFrame=function(t,i,s){var e=t.extent;var r=t.pixelRatio;var n=i.managed?t.skippedFeatureUids:{};var h=t.viewState;var a=h.projection;var o=h.rotation;var f=a.getExtent();var u=this.getLayer().getSource();var v=this.getTransform(t,0);this.preCompose(s,t,v);var l=i.extent;var c=l!==undefined;if(c){this.clip(s,t,l)}var d=this.replayGroup_;if(d&&!d.isEmpty()){if(this.declutterTree_){this.declutterTree_.clear()}var m=this.getLayer();var p=0;var M=0;var z;var _=i.opacity!==1;var g=m.hasListener(uo.RENDER);if(_||g){var w=s.canvas.width;var y=s.canvas.height;if(o){var b=Math.round(Math.sqrt(w*w+y*y));p=(b-w)/2;M=(b-y)/2;w=y=b}this.context.canvas.width=w;this.context.canvas.height=y;z=this.context}else{z=s}var x=z.globalAlpha;if(!_){z.globalAlpha=i.opacity}if(z!=s){z.translate(p,M)}var k=t.size[0]*r;var E=t.size[1]*r;Vo.rotateAtOffset(z,-o,k/2,E/2);d.replay(z,v,o,n);if(u.getWrapX()&&a.canWrapX()&&!qh.containsExtent(f,e)){var N=e[0];var C=qh.getWidth(f);var I=0;var S;while(N<f[0]){--I;S=C*I;v=this.getTransform(t,S);d.replay(z,v,o,n);N+=C}I=0;N=e[2];while(N>f[2]){++I;S=C*I;v=this.getTransform(t,S);d.replay(z,v,o,n);N-=C}v=this.getTransform(t,0)}Vo.rotateAtOffset(z,o,k/2,E/2);if(z!=s){if(g){this.dispatchRenderEvent(z,t,v)}if(_){var O=s.globalAlpha;s.globalAlpha=i.opacity;s.drawImage(z.canvas,-p,-M);s.globalAlpha=O}else{s.drawImage(z.canvas,-p,-M)}z.translate(-p,-M)}if(!_){z.globalAlpha=x}}if(c){s.restore()}this.postCompose(s,t,i,v)};Df.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(!this.replayGroup_){return undefined}else{var n=i.viewState.resolution;var h=i.viewState.rotation;var a=this.getLayer();var o={};var f=this.replayGroup_.forEachFeatureAtCoordinate(t,n,h,s,{},(function(t){var i=kh.getUid(t).toString();if(!(i in o)){o[i]=true;return e.call(r,t,a)}}),null);return f}};Df.prototype.handleFontsChanged_=function(t){var i=this.getLayer();if(i.getVisible()&&this.replayGroup_){i.changed()}};Df.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};Df.prototype.prepareFrame=function(t,i){var s=this.getLayer();var e=s.getSource();this.updateLogos(t,e);var r=t.viewHints[Ya.ANIMATING];var n=t.viewHints[Ya.INTERACTING];var h=s.getUpdateWhileAnimating();var a=s.getUpdateWhileInteracting();if(!this.dirty_&&(!h&&r)||!a&&n){return true}var o=t.extent;var f=t.viewState;var u=f.projection;var v=f.resolution;var l=t.pixelRatio;var c=s.getRevision();var d=s.getRenderBuffer();var m=s.getRenderOrder();if(m===undefined){m=Lf.defaultOrder}var p=qh.buffer(o,d*v);var M=f.projection.getExtent();if(e.getWrapX()&&f.projection.canWrapX()&&!qh.containsExtent(M,t.extent)){var z=qh.getWidth(M);var _=Math.max(qh.getWidth(p)/2,z);p[0]=M[0]-_;p[2]=M[2]+_}if(!this.dirty_&&this.renderedResolution_==v&&this.renderedRevision_==c&&this.renderedRenderOrder_==m&&qh.containsExtent(this.renderedExtent_,p)){this.replayGroupChanged=false;return true}this.replayGroup_=null;this.dirty_=false;var g=new Pf(Lf.getTolerance(v,l),p,v,l,e.getOverlaps(),this.declutterTree_,s.getRenderBuffer());e.loadFeatures(p,v,u);var w=function(t){var i;var e=t.getStyleFunction();if(e){i=e.call(t,v)}else{e=s.getStyleFunction();if(e){i=e(t,v)}}if(i){var r=this.renderFeature(t,v,l,i,g);this.dirty_=this.dirty_||r}}.bind(this);if(m){var y=[];e.forEachFeatureInExtent(p,(function(t){y.push(t)}),this);y.sort(m);for(var b=0,x=y.length;b<x;++b){w(y[b])}}else{e.forEachFeatureInExtent(p,w,this)}g.finish();this.renderedResolution_=v;this.renderedRevision_=c;this.renderedRenderOrder_=m;this.renderedExtent_=p;this.replayGroup_=g;this.replayGroupChanged=true;return true};Df.prototype.renderFeature=function(t,i,s,e,r){if(!e){return false}var n=false;if(Array.isArray(e)){for(var h=0,a=e.length;h<a;++h){n=Lf.renderFeature(r,t,e[h],Lf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}}else{n=Lf.renderFeature(r,t,e,Lf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)}return n};var Ff={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"};var Gf=function(t){this.context=null;ef.call(this,t);this.declutterTree_=t.getDeclutter()?nf(9):null;this.dirty_=false;this.tmpTransform_=sa.create();this.zDirection=t.getRenderMode()==Ff.VECTOR?1:0;Ih.listen(Vo.labelCache,Ah.CLEAR,this.handleFontsChanged_,this)};kh.inherits(Gf,ef);Gf["handles"]=function(t,i){return t===no.CANVAS&&i.getType()===Fo.VECTOR_TILE};Gf["create"]=function(t,i){return new Gf(i)};Gf.IMAGE_REPLAYS={image:[bf.POLYGON,bf.CIRCLE,bf.LINE_STRING,bf.IMAGE,bf.TEXT],hybrid:[bf.POLYGON,bf.LINE_STRING]};Gf.VECTOR_REPLAYS={image:[bf.DEFAULT],hybrid:[bf.IMAGE,bf.TEXT,bf.DEFAULT],vector:Nf.ORDER};Gf.prototype.disposeInternal=function(){Ih.unlisten(Vo.labelCache,Ah.CLEAR,this.handleFontsChanged_,this);ef.prototype.disposeInternal.call(this)};Gf.prototype.prepareFrame=function(t,i){var s=this.getLayer();var e=s.getRevision();if(this.renderedLayerRevision_!=e){this.renderedTiles.length=0;var r=s.getRenderMode();if(!this.context&&r!=Ff.VECTOR){this.context=$a.createCanvasContext2D()}if(this.context&&r==Ff.VECTOR){this.context=null}}this.renderedLayerRevision_=e;return ef.prototype.prepareFrame.apply(this,arguments)};Gf.prototype.createReplayGroup_=function(t,i){var s=this.getLayer();var e=i.pixelRatio;var r=i.viewState.projection;var n=s.getRevision();var h=s.getRenderOrder()||null;var a=t.getReplayState(s);if(!a.dirty&&a.renderedRevision==n&&a.renderedRenderOrder==h){return}var o=s.getSource();var f=o.getTileGrid();var u=o.getTileGridForProjection(r);var v=u.getResolution(t.tileCoord[0]);var l=u.getTileCoordExtent(t.wrappedTileCoord);var c={};for(var d=0,m=t.tileKeys.length;d<m;++d){var p=t.getTile(t.tileKeys[d]);if(p.getState()==Wa.ERROR){continue}var M=p.tileCoord;var z=f.getTileCoordExtent(M);var _=qh.getIntersection(l,z);var g=qh.equals(z,_)?null:qh.buffer(_,s.getRenderBuffer()*v);var w=p.getProjection();var y=false;if(!ia.equivalent(r,w)){y=true;p.setProjection(r)}a.dirty=false;var b=new Pf(0,_,v,e,o.getOverlaps(),this.declutterTree_,s.getRenderBuffer());var x=Lf.getSquaredTolerance(v,e);var k=function(t){var i;var e=t.getStyleFunction();if(e){i=e.call(t,v)}else{e=s.getStyleFunction();if(e){i=e(t,v)}}if(i){var r=this.renderFeature(t,x,i,b);this.dirty_=this.dirty_||r;a.dirty=a.dirty||r}};var E=p.getFeatures();if(h&&h!==a.renderedRenderOrder){E.sort(h)}var N;for(var C=0,I=E.length;C<I;++C){N=E[C];if(y){if(w.getUnits()==Hh.TILE_PIXELS){w.setWorldExtent(z);w.setExtent(p.getExtent())}N.getGeometry().transform(w,r)}if(!g||qh.intersects(g,N.getGeometry().getExtent())){k.call(this,N)}}b.finish();for(var S in b.getReplays()){c[S]=true}p.setReplayGroup(s,t.tileCoord.toString(),b)}a.renderedRevision=n;a.renderedRenderOrder=h};Gf.prototype.drawTileImage=function(t,i,s,e,r,n,h,a,o){var f=t;this.createReplayGroup_(f,i);if(this.context){this.renderTileImage_(f,i,s);ef.prototype.drawTileImage.apply(this,arguments)}};Gf.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=i.viewState.resolution;var h=i.viewState.rotation;s=s==undefined?0:s;var a=this.getLayer();var o={};var f=this.renderedTiles;var u=a.getSource();var v=u.getTileGridForProjection(i.viewState.projection);var l,c;var d,m,p;var M,z,_;for(d=0,m=f.length;d<m;++d){M=f[d];z=M.wrappedTileCoord;_=v.getTileCoordExtent(z,this.tmpExtent);l=qh.buffer(_,s*n,l);if(!qh.containsCoordinate(l,t)){continue}for(var g=0,w=M.tileKeys.length;g<w;++g){var y=M.getTile(M.tileKeys[g]);if(y.getState()==Wa.ERROR){continue}p=y.getReplayGroup(a,M.tileCoord.toString());c=c||p.forEachFeatureAtCoordinate(t,n,h,s,{},(function(t){var i=kh.getUid(t).toString();if(!(i in o)){o[i]=true;return e.call(r,t,a)}}),null)}}return c};Gf.prototype.getReplayTransform_=function(t,i){var s=this.getLayer();var e=s.getSource();var r=e.getTileGrid();var n=t.tileCoord;var h=r.getResolution(n[0]);var a=i.viewState;var o=i.pixelRatio;var f=a.resolution/o;var u=r.getTileCoordExtent(n,this.tmpExtent);var v=a.center;var l=qh.getTopLeft(u);var c=i.size;var d=Math.round(o*c[0]/2);var m=Math.round(o*c[1]/2);return sa.compose(this.tmpTransform_,d,m,h/f,h/f,a.rotation,(l[0]-v[0])/h,(v[1]-l[1])/h)};Gf.prototype.handleFontsChanged_=function(t){var i=this.getLayer();if(i.getVisible()&&this.renderedLayerRevision_!==undefined){i.changed()}};Gf.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};Gf.prototype.postCompose=function(t,i,s){var e=this.getLayer();var r=e.getDeclutter()?{}:null;var n=e.getSource();var h=e.getRenderMode();var a=Gf.VECTOR_REPLAYS[h];var o=i.pixelRatio;var f=i.viewState.rotation;var u=i.size;var v,l;if(f){v=Math.round(o*u[0]/2);l=Math.round(o*u[1]/2);Vo.rotateAtOffset(t,-f,v,l)}if(r){this.declutterTree_.clear()}var c=this.renderedTiles;var d=n.getTileGridForProjection(i.viewState.projection);var m=[];var p=[];for(var M=c.length-1;M>=0;--M){var z=c[M];if(z.getState()==Wa.ABORT){continue}var _=z.tileCoord;var g=d.getTileCoordExtent(_)[0]-d.getTileCoordExtent(z.wrappedTileCoord)[0];var w=undefined;for(var y=0,b=z.tileKeys.length;y<b;++y){var x=z.getTile(z.tileKeys[y]);if(x.getState()==Wa.ERROR){continue}var k=x.getReplayGroup(e,_.toString());if(h!=Ff.VECTOR&&!k.hasReplays(a)){continue}if(!w){w=this.getTransform(i,g)}var E=x.tileCoord[0];var N=k.getClipCoords(w);t.save();t.globalAlpha=s.opacity;for(var C=0,I=m.length;C<I;++C){var S=m[C];if(E<p[C]){t.beginPath();t.moveTo(N[0],N[1]);t.lineTo(N[2],N[3]);t.lineTo(N[4],N[5]);t.lineTo(N[6],N[7]);t.moveTo(S[6],S[7]);t.lineTo(S[4],S[5]);t.lineTo(S[2],S[3]);t.lineTo(S[0],S[1]);t.clip()}}k.replay(t,w,f,{},a,r);t.restore();m.push(N);p.push(E)}}if(r){Pf.replayDeclutter(r,t,f)}if(f){Vo.rotateAtOffset(t,f,v,l)}ef.prototype.postCompose.apply(this,arguments)};Gf.prototype.renderFeature=function(t,i,s,e){if(!s){return false}var r=false;if(Array.isArray(s)){for(var n=0,h=s.length;n<h;++n){r=Lf.renderFeature(e,t,s[n],i,this.handleStyleImageChange_,this)||r}}else{r=Lf.renderFeature(e,t,s,i,this.handleStyleImageChange_,this)}return r};Gf.prototype.renderTileImage_=function(t,i,s){var e=this.getLayer();var r=t.getReplayState(e);var n=e.getRevision();var h=Gf.IMAGE_REPLAYS[e.getRenderMode()];if(h&&r.renderedTileRevision!==n){r.renderedTileRevision=n;var a=t.wrappedTileCoord;var o=a[0];var f=i.pixelRatio;var u=e.getSource();var v=u.getTileGridForProjection(i.viewState.projection);var l=v.getResolution(o);var c=t.getContext(e);var d=u.getTilePixelSize(o,f,i.viewState.projection);c.canvas.width=d[0];c.canvas.height=d[1];var m=v.getTileCoordExtent(a);for(var p=0,M=t.tileKeys.length;p<M;++p){var z=t.getTile(t.tileKeys[p]);if(z.getState()==Wa.ERROR){continue}var _=f/l;var g=sa.reset(this.tmpTransform_);sa.scale(g,_,-_);sa.translate(g,-m[0],-m[3]);var w=z.getReplayGroup(e,t.tileCoord.toString());w.replay(c,g,0,{},h)}}};var Wf=function(t){this.source_=t};Wf.prototype.getType=function(){};Wf.prototype.getSource=function(){return this.source_};Wf.prototype.isAnimated=Yh.FALSE;var jf=function(t){Wf.call(this,t)};kh.inherits(jf,Wf);jf.prototype.getType=function(){return _a.FRAGMENT_SHADER};var Vf=function(t){Wf.call(this,t)};kh.inherits(Vf,Wf);Vf.prototype.getType=function(){return _a.VERTEX_SHADER};var Uf={};Uf.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n":"precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(dist<radius-c){gl_FragColor.a=gl_FragColor.a-(radius-c-dist);}} else{gl_FragColor=n;float strokeDist=radius-c;float antialias=2.0*d;if(dist>strokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}");Uf.vertex=new Vf(kh.DEBUG_WEBGL?"varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n":"varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;//Until we get gl_VertexID in WebGL,we store an instruction.if(f==0.0){//Offsetting the edges of the triangle by lineWidth/2 is necessary,however//we should also leave some space for the antialiasing,thus we offset by lineWidth.offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}");var qf=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_lineWidth=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_lineWidth":"k");this.u_pixelRatio=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_pixelRatio":"l");this.u_opacity=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_opacity":"m");this.u_fillColor=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_fillColor":"n");this.u_strokeColor=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_strokeColor":"o");this.u_size=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_size":"p");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"e");this.a_instruction=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_instruction":"f");this.a_radius=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_radius":"g")};var Xf={};Xf.create=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]};Xf.fromTransform=function(t,i){t[0]=i[0];t[1]=i[1];t[4]=i[2];t[5]=i[3];t[12]=i[4];t[13]=i[5];return t};var Yf=function(t,i){Xo.call(this);this.tolerance=t;this.maxExtent=i;this.origin=qh.getCenter(i);this.projectionMatrix_=sa.create();this.offsetRotateMatrix_=sa.create();this.offsetScaleMatrix_=sa.create();this.tmpMat4_=Xf.create();this.indices=[];this.indicesBuffer=null;this.startIndices=[];this.startIndicesFeature=[];this.vertices=[];this.verticesBuffer=null;this.lineStringReplay=undefined};kh.inherits(Yf,Xo);Yf.prototype.getDeleteResourcesFunction=function(t){};Yf.prototype.finish=function(t){};Yf.prototype.setUpProgram=function(t,i,s,e){};Yf.prototype.shutDownProgram=function(t,i){};Yf.prototype.drawReplay=function(t,i,s,e){};Yf.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){};Yf.prototype.drawHitDetectionReplay=function(t,i,s,e,r,n){if(!r){return this.drawHitDetectionReplayAll(t,i,s,e)}else{return this.drawHitDetectionReplayOneByOne(t,i,s,e,n)}};Yf.prototype.drawHitDetectionReplayAll=function(t,i,s,e){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawReplay(t,i,s,true);var r=e(null);if(r){return r}else{return undefined}};Yf.prototype.replay=function(t,i,s,e,r,n,h,a,o,f,u){var v=t.getGL();var l,c,d,m,p,M,z,_;if(this.lineStringReplay){l=v.isEnabled(v.STENCIL_TEST);c=v.getParameter(v.STENCIL_FUNC);d=v.getParameter(v.STENCIL_VALUE_MASK);m=v.getParameter(v.STENCIL_REF);p=v.getParameter(v.STENCIL_WRITEMASK);M=v.getParameter(v.STENCIL_FAIL);z=v.getParameter(v.STENCIL_PASS_DEPTH_PASS);_=v.getParameter(v.STENCIL_PASS_DEPTH_FAIL);v.enable(v.STENCIL_TEST);v.clear(v.STENCIL_BUFFER_BIT);v.stencilMask(255);v.stencilFunc(v.ALWAYS,1,255);v.stencilOp(v.KEEP,v.KEEP,v.REPLACE);this.lineStringReplay.replay(t,i,s,e,r,n,h,a,o,f,u);v.stencilMask(0);v.stencilFunc(v.NOTEQUAL,1,255)}t.bindBuffer(_a.ARRAY_BUFFER,this.verticesBuffer);t.bindBuffer(_a.ELEMENT_ARRAY_BUFFER,this.indicesBuffer);var g=this.setUpProgram(v,t,r,n);var w=sa.reset(this.projectionMatrix_);sa.scale(w,2/(s*r[0]),2/(s*r[1]));sa.rotate(w,-e);sa.translate(w,-(i[0]-this.origin[0]),-(i[1]-this.origin[1]));var y=sa.reset(this.offsetScaleMatrix_);sa.scale(y,2/r[0],2/r[1]);var b=sa.reset(this.offsetRotateMatrix_);if(e!==0){sa.rotate(b,-e)}v.uniformMatrix4fv(g.u_projectionMatrix,false,Xf.fromTransform(this.tmpMat4_,w));v.uniformMatrix4fv(g.u_offsetScaleMatrix,false,Xf.fromTransform(this.tmpMat4_,y));v.uniformMatrix4fv(g.u_offsetRotateMatrix,false,Xf.fromTransform(this.tmpMat4_,b));v.uniform1f(g.u_opacity,h);var x;if(o===undefined){this.drawReplay(v,t,a,false)}else{x=this.drawHitDetectionReplay(v,t,a,o,f,u)}this.shutDownProgram(v,g);if(this.lineStringReplay){if(!l){v.disable(v.STENCIL_TEST)}v.clear(v.STENCIL_BUFFER_BIT);v.stencilFunc(c,m,d);v.stencilMask(p);v.stencilOp(M,_,z)}return x};Yf.prototype.drawElements=function(t,i,s,e){var r=i.hasOESElementIndexUint?_a.UNSIGNED_INT:_a.UNSIGNED_SHORT;var n=i.hasOESElementIndexUint?4:2;var h=e-s;var a=s*n;t.drawElements(_a.TRIANGLES,h,r,a)};var Bf={};Bf.defaultFont="10px sans-serif";Bf.defaultFillStyle=[0,0,0,1];Bf.defaultLineCap="round";Bf.defaultLineDash=[];Bf.defaultLineDashOffset=0;Bf.defaultLineJoin="round";Bf.defaultMiterLimit=10;Bf.defaultStrokeStyle=[0,0,0,1];Bf.defaultTextAlign=.5;Bf.defaultTextBaseline=.5;Bf.defaultLineWidth=1;Bf.triangleIsCounterClockwise=function(t,i,s,e,r,n){var h=(s-t)*(n-i)-(r-t)*(e-i);return h<=Bf.EPSILON&&h>=-Bf.EPSILON?undefined:h>0};Bf.EPSILON=Number.EPSILON||2220446049250313e-31;var Hf=function(t,i){this.arr_=t!==undefined?t:[];this.usage_=i!==undefined?i:Hf.Usage_.STATIC_DRAW};Hf.prototype.getArray=function(){return this.arr_};Hf.prototype.getUsage=function(){return this.usage_};Hf.Usage_={STATIC_DRAW:_a.STATIC_DRAW,STREAM_DRAW:_a.STREAM_DRAW,DYNAMIC_DRAW:_a.DYNAMIC_DRAW};var Jf=function(t,i){Yf.call(this,t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.radius_=0;this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:undefined,lineWidth:undefined,changed:false}};kh.inherits(Jf,Yf);Jf.prototype.drawCoordinates_=function(t,i,s,e){var r=this.vertices.length;var n=this.indices.length;var h=r/4;var a,o;for(a=i,o=s;a<o;a+=e){this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=0;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=1;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=2;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=3;this.vertices[r++]=this.radius_;this.indices[n++]=h;this.indices[n++]=h+1;this.indices[n++]=h+2;this.indices[n++]=h+2;this.indices[n++]=h+3;this.indices[n++]=h;h+=4}};Jf.prototype.drawCircle=function(t,i){var s=t.getRadius();var e=t.getStride();if(s){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.radius_=s;var r=t.getFlatCoordinates();r=Bh.translate(r,0,2,e,-this.origin[0],-this.origin[1]);this.drawCoordinates_(r,0,2,e)}else{if(this.state_.changed){this.styles_.pop();if(this.styles_.length){var n=this.styles_[this.styles_.length-1];this.state_.fillColor=n[0];this.state_.strokeColor=n[1];this.state_.lineWidth=n[2];this.state_.changed=false}}}};Jf.prototype.finish=function(t){this.verticesBuffer=new Hf(this.vertices);this.indicesBuffer=new Hf(this.indices);this.startIndices.push(this.indices.length);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};Jf.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;return function(){t.deleteBuffer(i);t.deleteBuffer(s)}};Jf.prototype.setUpProgram=function(t,i,s,e){var r,n;r=Uf.fragment;n=Uf.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new qf(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,_a.FLOAT,false,16,0);t.enableVertexAttribArray(a.a_instruction);t.vertexAttribPointer(a.a_instruction,1,_a.FLOAT,false,16,8);t.enableVertexAttribArray(a.a_radius);t.vertexAttribPointer(a.a_radius,1,_a.FLOAT,false,16,12);t.uniform2fv(a.u_size,s);t.uniform1f(a.u_pixelRatio,e);return a};Jf.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_instruction);t.disableVertexAttribArray(i.a_radius)};Jf.prototype.drawReplay=function(t,i,s,e){if(!Ch.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var r,n,h,a;h=this.startIndices[this.startIndices.length-1];for(r=this.styleIndices_.length-1;r>=0;--r){n=this.styleIndices_[r];a=this.styles_[r];this.setFillStyle_(t,a[0]);this.setStrokeStyle_(t,a[1],a[2]);this.drawElements(t,i,n,h);h=n}}};Jf.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,v,l;l=this.startIndices.length-2;a=this.startIndices[l+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setFillStyle_(t,o[0]);this.setStrokeStyle_(t,o[1],o[2]);f=this.styleIndices_[n];while(l>=0&&this.startIndices[l]>=f){h=this.startIndices[l];u=this.startIndicesFeature[l];v=kh.getUid(u).toString();if(s[v]===undefined&&u.getGeometry()&&(r===undefined||qh.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}l--;a=h}}return undefined};Jf.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,v;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setFillStyle_(t,h[0]);this.setStrokeStyle_(t,h[1],h[2]);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){v=this.startIndices[u];o=this.startIndicesFeature[u];f=kh.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n)}n=v}u--;r=v}if(r!==n){this.drawElements(t,i,r,n)}r=n=a}};Jf.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_fillColor,i)};Jf.prototype.setStrokeStyle_=function(t,i,s){t.uniform4fv(this.defaultLocations_.u_strokeColor,i);t.uniform1f(this.defaultLocations_.u_lineWidth,s)};Jf.prototype.setFillStrokeStyle=function(t,i){var s,e;if(i){var r=i.getLineDash();this.state_.lineDash=r?r:Bf.defaultLineDash;var n=i.getLineDashOffset();this.state_.lineDashOffset=n?n:Bf.defaultLineDashOffset;s=i.getColor();if(!(s instanceof CanvasGradient)&&!(s instanceof CanvasPattern)){s=Uo.asArray(s).map((function(t,i){return i!=3?t/255:t}))||Bf.defaultStrokeStyle}else{s=Bf.defaultStrokeStyle}e=i.getWidth();e=e!==undefined?e:Bf.defaultLineWidth}else{s=[0,0,0,0];e=0}var h=t?t.getColor():[0,0,0,0];if(!(h instanceof CanvasGradient)&&!(h instanceof CanvasPattern)){h=Uo.asArray(h).map((function(t,i){return i!=3?t/255:t}))||Bf.defaultFillStyle}else{h=Bf.defaultFillStyle}if(!this.state_.strokeColor||!jh.equals(this.state_.strokeColor,s)||!this.state_.fillColor||!jh.equals(this.state_.fillColor,h)||this.state_.lineWidth!==e){this.state_.changed=true;this.state_.fillColor=h;this.state_.strokeColor=s;this.state_.lineWidth=e;this.styles_.push([h,s,e])}};var Zf={};Zf.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");Zf.vertex=new Vf(kh.DEBUG_WEBGL?"varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n":"varying vec2 a;varying float b;attribute vec2 c;attribute vec2 d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;void main(void){mat4 offsetMatrix=i;if(g==1.0){offsetMatrix=i*j;}vec4 offsets=offsetMatrix*vec4(e,0.0,0.0);gl_Position=h*vec4(c,0.0,1.0)+offsets;a=d;b=f;}");var Kf=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_opacity=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_opacity":"k");this.u_image=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_image":"l");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"c");this.a_texCoord=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_texCoord":"d");this.a_offsets=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_offsets":"e");this.a_opacity=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_opacity":"f");this.a_rotateWithView=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_rotateWithView":"g")};var $f={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};var Qf=function(t,i){this.canvas_=t;this.gl_=i;this.bufferCache_={};this.shaderCache_={};this.programCache_={};this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null;this.hasOESElementIndexUint=jh.includes(kh.WEBGL_EXTENSIONS,"OES_element_index_uint");if(this.hasOESElementIndexUint){i.getExtension("OES_element_index_uint")}Ih.listen(this.canvas_,$f.LOST,this.handleWebGLContextLost,this);Ih.listen(this.canvas_,$f.RESTORED,this.handleWebGLContextRestored,this)};kh.inherits(Qf,Sh);Qf.prototype.bindBuffer=function(t,i){var s=this.getGL();var e=i.getArray();var r=String(kh.getUid(i));if(r in this.bufferCache_){var n=this.bufferCache_[r];s.bindBuffer(t,n.buffer)}else{var h=s.createBuffer();s.bindBuffer(t,h);var a;if(t==_a.ARRAY_BUFFER){a=new Float32Array(e)}else if(t==_a.ELEMENT_ARRAY_BUFFER){a=this.hasOESElementIndexUint?new Uint32Array(e):new Uint16Array(e)}s.bufferData(t,a,i.getUsage());this.bufferCache_[r]={buf:i,buffer:h}}};Qf.prototype.deleteBuffer=function(t){var i=this.getGL();var s=String(kh.getUid(t));var e=this.bufferCache_[s];if(!i.isContextLost()){i.deleteBuffer(e.buffer)}delete this.bufferCache_[s]};Qf.prototype.disposeInternal=function(){Ih.unlistenAll(this.canvas_);var t=this.getGL();if(!t.isContextLost()){var i;for(i in this.bufferCache_){t.deleteBuffer(this.bufferCache_[i].buffer)}for(i in this.programCache_){t.deleteProgram(this.programCache_[i])}for(i in this.shaderCache_){t.deleteShader(this.shaderCache_[i])}t.deleteFramebuffer(this.hitDetectionFramebuffer_);t.deleteRenderbuffer(this.hitDetectionRenderbuffer_);t.deleteTexture(this.hitDetectionTexture_)}};Qf.prototype.getCanvas=function(){return this.canvas_};Qf.prototype.getGL=function(){return this.gl_};Qf.prototype.getHitDetectionFramebuffer=function(){if(!this.hitDetectionFramebuffer_){this.initHitDetectionFramebuffer_()}return this.hitDetectionFramebuffer_};Qf.prototype.getShader=function(t){var i=String(kh.getUid(t));if(i in this.shaderCache_){return this.shaderCache_[i]}else{var s=this.getGL();var e=s.createShader(t.getType());s.shaderSource(e,t.getSource());s.compileShader(e);this.shaderCache_[i]=e;return e}};Qf.prototype.getProgram=function(t,i){var s=kh.getUid(t)+"/"+kh.getUid(i);if(s in this.programCache_){return this.programCache_[s]}else{var e=this.getGL();var r=e.createProgram();e.attachShader(r,this.getShader(t));e.attachShader(r,this.getShader(i));e.linkProgram(r);this.programCache_[s]=r;return r}};Qf.prototype.handleWebGLContextLost=function(){Ch.clear(this.bufferCache_);Ch.clear(this.shaderCache_);Ch.clear(this.programCache_);this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null};Qf.prototype.handleWebGLContextRestored=function(){};Qf.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_;var i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i);var s=Qf.createEmptyTexture(t,1,1);var e=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,e);t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1);t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e);t.bindTexture(t.TEXTURE_2D,null);t.bindRenderbuffer(t.RENDERBUFFER,null);t.bindFramebuffer(t.FRAMEBUFFER,null);this.hitDetectionFramebuffer_=i;this.hitDetectionTexture_=s;this.hitDetectionRenderbuffer_=e};Qf.prototype.useProgram=function(t){if(t==this.currentProgram_){return false}else{var i=this.getGL();i.useProgram(t);this.currentProgram_=t;return true}};Qf.createTexture_=function(t,i,s){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR);if(i!==undefined){t.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_WRAP_S,i)}if(s!==undefined){t.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_WRAP_T,s)}return e};Qf.createEmptyTexture=function(t,i,s,e,r){var n=Qf.createTexture_(t,e,r);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,i,s,0,t.RGBA,t.UNSIGNED_BYTE,null);return n};Qf.createTexture=function(t,i,s,e){var r=Qf.createTexture_(t,s,e);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i);return r};var tu=function(t,i){Yf.call(this,t,i);this.anchorX=undefined;this.anchorY=undefined;this.groupIndices=[];this.hitDetectionGroupIndices=[];this.height=undefined;this.imageHeight=undefined;this.imageWidth=undefined;this.defaultLocations=null;this.opacity=undefined;this.originX=undefined;this.originY=undefined;this.rotateWithView=undefined;this.rotation=undefined;this.scale=undefined;this.width=undefined};kh.inherits(tu,Yf);tu.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;var e=this.getTextures(true);var r=t.getGL();return function(){if(!r.isContextLost()){var n,h;for(n=0,h=e.length;n<h;++n){r.deleteTexture(e[n])}}t.deleteBuffer(i);t.deleteBuffer(s)}};tu.prototype.drawCoordinates=function(t,i,s,e){var r=this.anchorX;var n=this.anchorY;var h=this.height;var a=this.imageHeight;var o=this.imageWidth;var f=this.opacity;var u=this.originX;var v=this.originY;var l=this.rotateWithView?1:0;var c=-this.rotation;var d=this.scale;var m=this.width;var p=Math.cos(c);var M=Math.sin(c);var z=this.indices.length;var _=this.vertices.length;var g,w,y,b,x,k;for(g=i;g<s;g+=e){x=t[g]-this.origin[0];k=t[g+1]-this.origin[1];w=_/8;y=-d*r;b=-d*(h-n);this.vertices[_++]=x;this.vertices[_++]=k;this.vertices[_++]=y*p-b*M;this.vertices[_++]=y*M+b*p;this.vertices[_++]=u/o;this.vertices[_++]=(v+h)/a;this.vertices[_++]=f;this.vertices[_++]=l;y=d*(m-r);b=-d*(h-n);this.vertices[_++]=x;this.vertices[_++]=k;this.vertices[_++]=y*p-b*M;this.vertices[_++]=y*M+b*p;this.vertices[_++]=(u+m)/o;this.vertices[_++]=(v+h)/a;this.vertices[_++]=f;this.vertices[_++]=l;y=d*(m-r);b=d*n;this.vertices[_++]=x;this.vertices[_++]=k;this.vertices[_++]=y*p-b*M;this.vertices[_++]=y*M+b*p;this.vertices[_++]=(u+m)/o;this.vertices[_++]=v/a;this.vertices[_++]=f;this.vertices[_++]=l;y=-d*r;b=d*n;this.vertices[_++]=x;this.vertices[_++]=k;this.vertices[_++]=y*p-b*M;this.vertices[_++]=y*M+b*p;this.vertices[_++]=u/o;this.vertices[_++]=v/a;this.vertices[_++]=f;this.vertices[_++]=l;this.indices[z++]=w;this.indices[z++]=w+1;this.indices[z++]=w+2;this.indices[z++]=w;this.indices[z++]=w+2;this.indices[z++]=w+3}return _};tu.prototype.createTextures=function(t,i,s,e){var r,n,h,a;var o=i.length;for(a=0;a<o;++a){n=i[a];h=kh.getUid(n).toString();if(h in s){r=s[h]}else{r=Qf.createTexture(e,n,_a.CLAMP_TO_EDGE,_a.CLAMP_TO_EDGE);s[h]=r}t[a]=r}};tu.prototype.setUpProgram=function(t,i,s,e){var r=Zf.fragment;var n=Zf.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations){a=new Kf(t,h);this.defaultLocations=a}else{a=this.defaultLocations}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,_a.FLOAT,false,32,0);t.enableVertexAttribArray(a.a_offsets);t.vertexAttribPointer(a.a_offsets,2,_a.FLOAT,false,32,8);t.enableVertexAttribArray(a.a_texCoord);t.vertexAttribPointer(a.a_texCoord,2,_a.FLOAT,false,32,16);t.enableVertexAttribArray(a.a_opacity);t.vertexAttribPointer(a.a_opacity,1,_a.FLOAT,false,32,24);t.enableVertexAttribArray(a.a_rotateWithView);t.vertexAttribPointer(a.a_rotateWithView,1,_a.FLOAT,false,32,28);return a};tu.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_offsets);t.disableVertexAttribArray(i.a_texCoord);t.disableVertexAttribArray(i.a_opacity);t.disableVertexAttribArray(i.a_rotateWithView)};tu.prototype.drawReplay=function(t,i,s,e){var r=e?this.getHitDetectionTextures():this.getTextures();var n=e?this.hitDetectionGroupIndices:this.groupIndices;if(!Ch.isEmpty(s)){this.drawReplaySkipping(t,i,s,r,n)}else{var h,a,o;for(h=0,a=r.length,o=0;h<a;++h){t.bindTexture(_a.TEXTURE_2D,r[h]);var f=n[h];this.drawElements(t,i,o,f);o=f}}};tu.prototype.drawReplaySkipping=function(t,i,s,e,r){var n=0;var h,a;for(h=0,a=e.length;h<a;++h){t.bindTexture(_a.TEXTURE_2D,e[h]);var o=h>0?r[h-1]:0;var f=r[h];var u=o;var v=o;while(n<this.startIndices.length&&this.startIndices[n]<=f){var l=this.startIndicesFeature[n];var c=kh.getUid(l).toString();if(s[c]!==undefined){if(u!==v){this.drawElements(t,i,u,v)}u=n===this.startIndices.length-1?f:this.startIndices[n+1];v=u}else{v=n===this.startIndices.length-1?f:this.startIndices[n+1]}n++}if(u!==v){this.drawElements(t,i,u,v)}}};tu.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u;var v=this.startIndices.length-1;var l=this.getHitDetectionTextures();for(n=l.length-1;n>=0;--n){t.bindTexture(_a.TEXTURE_2D,l[n]);h=n>0?this.hitDetectionGroupIndices[n-1]:0;o=this.hitDetectionGroupIndices[n];while(v>=0&&this.startIndices[v]>=h){a=this.startIndices[v];f=this.startIndicesFeature[v];u=kh.getUid(f).toString();if(s[u]===undefined&&f.getGeometry()&&(r===undefined||qh.intersects(r,f.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,a,o);var c=e(f);if(c){return c}}o=a;v--}}return undefined};tu.prototype.finish=function(t){this.anchorX=undefined;this.anchorY=undefined;this.height=undefined;this.imageHeight=undefined;this.imageWidth=undefined;this.indices=null;this.opacity=undefined;this.originX=undefined;this.originY=undefined;this.rotateWithView=undefined;this.rotation=undefined;this.scale=undefined;this.vertices=null;this.width=undefined};tu.prototype.getTextures=function(t){};tu.prototype.getHitDetectionTextures=function(){};var iu=function(t,i){tu.call(this,t,i);this.images_=[];this.hitDetectionImages_=[];this.textures_=[];this.hitDetectionTextures_=[]};kh.inherits(iu,tu);iu.prototype.drawMultiPoint=function(t,i){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var s=t.getFlatCoordinates();var e=t.getStride();this.drawCoordinates(s,0,s.length,e)};iu.prototype.drawPoint=function(t,i){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var s=t.getFlatCoordinates();var e=t.getStride();this.drawCoordinates(s,0,s.length,e)};iu.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices.push(this.indices.length);this.verticesBuffer=new Hf(this.vertices);var s=this.indices;this.indicesBuffer=new Hf(s);var e={};this.createTextures(this.textures_,this.images_,e,i);this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,e,i);this.images_=null;this.hitDetectionImages_=null;tu.prototype.finish.call(this,t)};iu.prototype.setImageStyle=function(t){var i=t.getAnchor();var s=t.getImage(1);var e=t.getImageSize();var r=t.getHitDetectionImage(1);var n=t.getOpacity();var h=t.getOrigin();var a=t.getRotateWithView();var o=t.getRotation();var f=t.getSize();var u=t.getScale();var v;if(this.images_.length===0){this.images_.push(s)}else{v=this.images_[this.images_.length-1];if(kh.getUid(v)!=kh.getUid(s)){this.groupIndices.push(this.indices.length);this.images_.push(s)}}if(this.hitDetectionImages_.length===0){this.hitDetectionImages_.push(r)}else{v=this.hitDetectionImages_[this.hitDetectionImages_.length-1];if(kh.getUid(v)!=kh.getUid(r)){this.hitDetectionGroupIndices.push(this.indices.length);this.hitDetectionImages_.push(r)}}this.anchorX=i[0];this.anchorY=i[1];this.height=f[1];this.imageHeight=e[1];this.imageWidth=e[0];this.opacity=n;this.originX=h[0];this.originY=h[1];this.rotation=o;this.rotateWithView=a;this.scale=u;this.width=f[0]};iu.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_};iu.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_};var su={};su.lineStringIsClosed=function(t,i,s,e){var r=s-e;if(t[i]===t[r]&&t[i+1]===t[r+1]&&(s-i)/e>3){return!!na.linearRing(t,i,s,e)}return false};var eu={};eu.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying float a;varying vec2 aVertex;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((aVertex.x+1.0)/2.0*o.x*p,(aVertex.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");eu.vertex=new Vf(kh.DEBUG_WEBGL?"varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n":"varying float a;varying vec2 aVertex;varying float c;attribute vec2 d;attribute vec2 e;attribute vec2 f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;bool nearlyEquals(in float value,in float ref){float epsilon=0.000000000001;return value>=ref-epsilon&&value<=ref+epsilon;}void alongNormal(out vec2 offset,in vec2 nextP,in float turnDir,in float direction){vec2 dirVect=nextP-e;vec2 normal=normalize(vec2(-turnDir*dirVect.y,turnDir*dirVect.x));offset=k/2.0*normal*direction;}void miterUp(out vec2 offset,out float round,in bool isRound,in float direction){float halfWidth=k/2.0;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=f-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;round=0.0;if(isRound){round=1.0;}else if(miterLength>l+k){offset=halfWidth*tmpNormal*direction;}} bool miterDown(out vec2 offset,in vec4 projPos,in mat4 offsetMatrix,in float direction){bool degenerate=false;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=d-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));vec2 longOffset,shortOffset,longVertex;vec4 shortProjVertex;float halfWidth=k/2.0;if(length(f-e)>length(d-e)){longOffset=tmpNormal*direction*halfWidth;shortOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=f;shortProjVertex=h*vec4(d,0.0,1.0);}else{shortOffset=tmpNormal*direction*halfWidth;longOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=d;shortProjVertex=h*vec4(f,0.0,1.0);}vec4 p1=h*vec4(longVertex,0.0,1.0)+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p2=projPos+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p3=shortProjVertex+offsetMatrix*vec4(-shortOffset,0.0,0.0);vec4 p4=shortProjVertex+offsetMatrix*vec4(shortOffset,0.0,0.0);float denom=(p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y);float firstU=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/denom;float secondU=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/denom;float epsilon=0.000000000001;if(firstU>epsilon&&firstU<1.0-epsilon&&secondU>epsilon&&secondU<1.0-epsilon){shortProjVertex.x=p1.x+firstU*(p2.x-p1.x);shortProjVertex.y=p1.y+firstU*(p2.y-p1.y);offset=shortProjVertex.xy;degenerate=true;}else{float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;}return degenerate;}void squareCap(out vec2 offset,out float round,in bool isRound,in vec2 nextP,in float turnDir,in float direction){round=0.0;vec2 dirVect=e-nextP;vec2 firstNormal=normalize(dirVect);vec2 secondNormal=vec2(turnDir*firstNormal.y*direction,-turnDir*firstNormal.x*direction);vec2 hypotenuse=normalize(firstNormal-secondNormal);vec2 normal=vec2(turnDir*hypotenuse.y*direction,-turnDir*hypotenuse.x*direction);float length=sqrt(c*c*2.0);offset=normal*length;if(isRound){round=1.0;}} void main(void){bool degenerate=false;float direction=float(sign(g));mat4 offsetMatrix=i*j;vec2 offset;vec4 projPos=h*vec4(e,0.0,1.0);bool round=nearlyEquals(mod(g,2.0),0.0);a=0.0;c=k/2.0;aVertex=projPos.xy;if(nearlyEquals(mod(g,3.0),0.0)||nearlyEquals(mod(g,17.0),0.0)){alongNormal(offset,f,1.0,direction);}else if(nearlyEquals(mod(g,5.0),0.0)||nearlyEquals(mod(g,13.0),0.0)){alongNormal(offset,d,-1.0,direction);}else if(nearlyEquals(mod(g,23.0),0.0)){miterUp(offset,a,round,direction);}else if(nearlyEquals(mod(g,19.0),0.0)){degenerate=miterDown(offset,projPos,offsetMatrix,direction);}else if(nearlyEquals(mod(g,7.0),0.0)){squareCap(offset,a,round,f,1.0,direction);}else if(nearlyEquals(mod(g,11.0),0.0)){squareCap(offset,a,round,d,-1.0,direction);}if(!degenerate){vec4 offsets=offsetMatrix*vec4(offset,0.0,0.0);gl_Position=projPos+offsets;}else{gl_Position=vec4(offset,0.0,1.0);}}");var ru=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_lineWidth=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_lineWidth":"k");this.u_miterLimit=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_miterLimit":"l");this.u_opacity=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_opacity":"m");this.u_color=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_color":"n");this.u_size=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_size":"o");this.u_pixelRatio=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_pixelRatio":"p");this.a_lastPos=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_lastPos":"d");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"e");this.a_nextPos=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_nextPos":"f");this.a_direction=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_direction":"g")};var nu=function(t,i){Yf.call(this,t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:undefined,miterLimit:undefined,changed:false}};kh.inherits(nu,Yf);nu.prototype.drawCoordinates_=function(t,i,s,e){var r,n;var h=this.vertices.length;var a=this.indices.length;var o=this.state_.lineJoin==="bevel"?0:this.state_.lineJoin==="miter"?1:2;var f=this.state_.lineCap==="butt"?0:this.state_.lineCap==="square"?1:2;var u=su.lineStringIsClosed(t,i,s,e);var v,l,c;var d=a;var m=1;var p,M,z;for(r=i,n=s;r<n;r+=e){c=h/7;p=M;M=z||[t[r],t[r+1]];if(r===i){z=[t[r+e],t[r+e+1]];if(s-i===e*2&&jh.equals(M,z)){break}if(u){p=[t[s-e*2],t[s-e*2+1]];v=z}else{if(f){h=this.addVertices_([0,0],M,z,m*nu.Instruction_.BEGIN_LINE_CAP*f,h);h=this.addVertices_([0,0],M,z,-m*nu.Instruction_.BEGIN_LINE_CAP*f,h);this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=c+1;this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c+2}h=this.addVertices_([0,0],M,z,m*nu.Instruction_.BEGIN_LINE*(f||1),h);h=this.addVertices_([0,0],M,z,-m*nu.Instruction_.BEGIN_LINE*(f||1),h);d=h/7-1;continue}}else if(r===s-e){if(u){z=v;break}else{p=p||[0,0];h=this.addVertices_(p,M,[0,0],m*nu.Instruction_.END_LINE*(f||1),h);h=this.addVertices_(p,M,[0,0],-m*nu.Instruction_.END_LINE*(f||1),h);this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=d;this.indices[a++]=c+1;this.indices[a++]=c;if(f){h=this.addVertices_(p,M,[0,0],m*nu.Instruction_.END_LINE_CAP*f,h);h=this.addVertices_(p,M,[0,0],-m*nu.Instruction_.END_LINE_CAP*f,h);this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=c+1;this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c+2}break}}else{z=[t[r+e],t[r+e+1]]}l=Bf.triangleIsCounterClockwise(p[0],p[1],M[0],M[1],z[0],z[1])?-1:1;h=this.addVertices_(p,M,z,l*nu.Instruction_.BEVEL_FIRST*(o||1),h);h=this.addVertices_(p,M,z,l*nu.Instruction_.BEVEL_SECOND*(o||1),h);h=this.addVertices_(p,M,z,-l*nu.Instruction_.MITER_BOTTOM*(o||1),h);if(r>i){this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=m*l>0?d:d-1}this.indices[a++]=c;this.indices[a++]=c+2;this.indices[a++]=c+1;d=c+2;m=l;if(o){h=this.addVertices_(p,M,z,l*nu.Instruction_.MITER_TOP*o,h);this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c}}if(u){c=c||h/7;l=Ma.linearRingIsClockwise([p[0],p[1],M[0],M[1],z[0],z[1]],0,6,2)?1:-1;h=this.addVertices_(p,M,z,l*nu.Instruction_.BEVEL_FIRST*(o||1),h);h=this.addVertices_(p,M,z,-l*nu.Instruction_.MITER_BOTTOM*(o||1),h);this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=c+1;this.indices[a++]=c;this.indices[a++]=m*l>0?d:d-1}};nu.prototype.addVertices_=function(t,i,s,e,r){this.vertices[r++]=t[0];this.vertices[r++]=t[1];this.vertices[r++]=i[0];this.vertices[r++]=i[1];this.vertices[r++]=s[0];this.vertices[r++]=s[1];this.vertices[r++]=e;return r};nu.prototype.isValid_=function(t,i,s,e){var r=s-i;if(r<e*2){return false}else if(r===e*2){var n=[t[i],t[i+1]];var h=[t[i+e],t[i+e+1]];return!jh.equals(n,h)}return true};nu.prototype.drawLineString=function(t,i){var s=t.getFlatCoordinates();var e=t.getStride();if(this.isValid_(s,0,s.length,e)){s=Bh.translate(s,0,s.length,e,-this.origin[0],-this.origin[1]);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);this.drawCoordinates_(s,0,s.length,e)}};nu.prototype.drawMultiLineString=function(t,i){var s=this.indices.length;var e=t.getEnds();e.unshift(0);var r=t.getFlatCoordinates();var n=t.getStride();var h,a;if(e.length>1){for(h=1,a=e.length;h<a;++h){if(this.isValid_(r,e[h-1],e[h],n)){var o=Bh.translate(r,e[h-1],e[h],n,-this.origin[0],-this.origin[1]);this.drawCoordinates_(o,0,o.length,n)}}}if(this.indices.length>s){this.startIndices.push(s);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(s);this.state_.changed=false}}};nu.prototype.drawPolygonCoordinates=function(t,i,s){if(!su.lineStringIsClosed(t,0,t.length,s)){t.push(t[0]);t.push(t[1])}this.drawCoordinates_(t,0,t.length,s);if(i.length){var e,r;for(e=0,r=i.length;e<r;++e){if(!su.lineStringIsClosed(i[e],0,i[e].length,s)){i[e].push(i[e][0]);i[e].push(i[e][1])}this.drawCoordinates_(i[e],0,i[e].length,s)}}};nu.prototype.setPolygonStyle=function(t,i){var s=i===undefined?this.indices.length:i;this.startIndices.push(s);this.startIndicesFeature.push(t);if(this.state_.changed){this.styleIndices_.push(s);this.state_.changed=false}};nu.prototype.getCurrentIndex=function(){return this.indices.length};nu.prototype.finish=function(t){this.verticesBuffer=new Hf(this.vertices);this.indicesBuffer=new Hf(this.indices);this.startIndices.push(this.indices.length);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};nu.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;return function(){t.deleteBuffer(i);t.deleteBuffer(s)}};nu.prototype.setUpProgram=function(t,i,s,e){var r,n;r=eu.fragment;n=eu.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new ru(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_lastPos);t.vertexAttribPointer(a.a_lastPos,2,_a.FLOAT,false,28,0);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,_a.FLOAT,false,28,8);t.enableVertexAttribArray(a.a_nextPos);t.vertexAttribPointer(a.a_nextPos,2,_a.FLOAT,false,28,16);t.enableVertexAttribArray(a.a_direction);t.vertexAttribPointer(a.a_direction,1,_a.FLOAT,false,28,24);t.uniform2fv(a.u_size,s);t.uniform1f(a.u_pixelRatio,e);return a};nu.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_lastPos);t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_nextPos);t.disableVertexAttribArray(i.a_direction)};nu.prototype.drawReplay=function(t,i,s,e){var r=t.getParameter(t.DEPTH_FUNC);var n=t.getParameter(t.DEPTH_WRITEMASK);if(!e){t.enable(t.DEPTH_TEST);t.depthMask(true);t.depthFunc(t.NOTEQUAL)}if(!Ch.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var h,a,o,f;o=this.startIndices[this.startIndices.length-1];for(h=this.styleIndices_.length-1;h>=0;--h){a=this.styleIndices_[h];f=this.styles_[h];this.setStrokeStyle_(t,f[0],f[1],f[2]);this.drawElements(t,i,a,o);t.clear(t.DEPTH_BUFFER_BIT);o=a}}if(!e){t.disable(t.DEPTH_TEST);t.clear(t.DEPTH_BUFFER_BIT);t.depthMask(n);t.depthFunc(r)}};nu.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,v;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setStrokeStyle_(t,h[0],h[1],h[2]);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){v=this.startIndices[u];o=this.startIndicesFeature[u];f=kh.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}n=v}u--;r=v}if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}r=n=a}};nu.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,v,l;l=this.startIndices.length-2;a=this.startIndices[l+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setStrokeStyle_(t,o[0],o[1],o[2]);f=this.styleIndices_[n];while(l>=0&&this.startIndices[l]>=f){h=this.startIndices[l];u=this.startIndicesFeature[l];v=kh.getUid(u).toString();if(s[v]===undefined&&u.getGeometry()&&(r===undefined||qh.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}l--;a=h}}return undefined};nu.prototype.setStrokeStyle_=function(t,i,s,e){t.uniform4fv(this.defaultLocations_.u_color,i);t.uniform1f(this.defaultLocations_.u_lineWidth,s);t.uniform1f(this.defaultLocations_.u_miterLimit,e)};nu.prototype.setFillStrokeStyle=function(t,i){var s=i.getLineCap();this.state_.lineCap=s!==undefined?s:Bf.defaultLineCap;var e=i.getLineDash();this.state_.lineDash=e?e:Bf.defaultLineDash;var r=i.getLineDashOffset();this.state_.lineDashOffset=r?r:Bf.defaultLineDashOffset;var n=i.getLineJoin();this.state_.lineJoin=n!==undefined?n:Bf.defaultLineJoin;var h=i.getColor();if(!(h instanceof CanvasGradient)&&!(h instanceof CanvasPattern)){h=Uo.asArray(h).map((function(t,i){return i!=3?t/255:t}))||Bf.defaultStrokeStyle}else{h=Bf.defaultStrokeStyle}var a=i.getWidth();a=a!==undefined?a:Bf.defaultLineWidth;var o=i.getMiterLimit();o=o!==undefined?o:Bf.defaultMiterLimit;if(!this.state_.strokeColor||!jh.equals(this.state_.strokeColor,h)||this.state_.lineWidth!==a||this.state_.miterLimit!==o){this.state_.changed=true;this.state_.strokeColor=h;this.state_.lineWidth=a;this.state_.miterLimit=o;this.styles_.push([h,a,o])}};nu.Instruction_={ROUND:2,BEGIN_LINE:3,END_LINE:5,BEGIN_LINE_CAP:7,END_LINE_CAP:11,BEVEL_FIRST:13,BEVEL_SECOND:17,MITER_BOTTOM:19,MITER_TOP:23};var hu={};hu.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;uniform vec4 e;uniform float f;void main(void){gl_FragColor=e;float alpha=e.a*f;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");hu.vertex=new Vf(kh.DEBUG_WEBGL?"\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n":"attribute vec2 a;uniform mat4 b;uniform mat4 c;uniform mat4 d;void main(void){gl_Position=b*vec4(a,0.0,1.0);}");var au=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_projectionMatrix":"b");this.u_offsetScaleMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetScaleMatrix":"c");this.u_offsetRotateMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetRotateMatrix":"d");this.u_color=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_color":"e");this.u_opacity=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_opacity":"f");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"a")};var ou=function(t){var i=t||{};this.color_=i.color!==undefined?i.color:null;this.lineCap_=i.lineCap;this.lineDash_=i.lineDash!==undefined?i.lineDash:null;this.lineDashOffset_=i.lineDashOffset;this.lineJoin_=i.lineJoin;this.miterLimit_=i.miterLimit;this.width_=i.width;this.checksum_=undefined};ou.prototype.clone=function(){var t=this.getColor();return new ou({color:t&&t.slice?t.slice():t||undefined,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():undefined,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})};ou.prototype.getColor=function(){return this.color_};ou.prototype.getLineCap=function(){return this.lineCap_};ou.prototype.getLineDash=function(){return this.lineDash_};ou.prototype.getLineDashOffset=function(){return this.lineDashOffset_};ou.prototype.getLineJoin=function(){return this.lineJoin_};ou.prototype.getMiterLimit=function(){return this.miterLimit_};ou.prototype.getWidth=function(){return this.width_};ou.prototype.setColor=function(t){this.color_=t;this.checksum_=undefined};ou.prototype.setLineCap=function(t){this.lineCap_=t;this.checksum_=undefined};ou.prototype.setLineDash=function(t){this.lineDash_=t;this.checksum_=undefined};ou.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t;this.checksum_=undefined};ou.prototype.setLineJoin=function(t){this.lineJoin_=t;this.checksum_=undefined};ou.prototype.setMiterLimit=function(t){this.miterLimit_=t;this.checksum_=undefined};ou.prototype.setWidth=function(t){this.width_=t;this.checksum_=undefined};ou.prototype.getChecksum=function(){if(this.checksum_===undefined){this.checksum_="s";if(this.color_){if(typeof this.color_==="string"){this.checksum_+=this.color_}else{this.checksum_+=kh.getUid(this.color_).toString()}}else{this.checksum_+="-"}this.checksum_+=","+(this.lineCap_!==undefined?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(this.lineDashOffset_!==undefined?this.lineDashOffset_:"-")+","+(this.lineJoin_!==undefined?this.lineJoin_:"-")+","+(this.miterLimit_!==undefined?this.miterLimit_.toString():"-")+","+(this.width_!==undefined?this.width_.toString():"-")}return this.checksum_};var fu=function(t){this.first_=undefined;this.last_=undefined;this.head_=undefined;this.circular_=t===undefined?true:t;this.length_=0};fu.prototype.insertItem=function(t){var i={prev:undefined,next:undefined,data:t};var s=this.head_;if(!s){this.first_=i;this.last_=i;if(this.circular_){i.next=i;i.prev=i}}else{var e=s.next;i.prev=s;i.next=e;s.next=i;if(e){e.prev=i}if(s===this.last_){this.last_=i}}this.head_=i;this.length_++};fu.prototype.removeItem=function(){var t=this.head_;if(t){var i=t.next;var s=t.prev;if(i){i.prev=s}if(s){s.next=i}this.head_=i||s;if(this.first_===this.last_){this.head_=undefined;this.first_=undefined;this.last_=undefined}else if(this.first_===t){this.first_=this.head_}else if(this.last_===t){this.last_=s?this.head_.prev:this.head_}this.length_--}};fu.prototype.firstItem=function(){this.head_=this.first_;if(this.head_){return this.head_.data}return undefined};fu.prototype.lastItem=function(){this.head_=this.last_;if(this.head_){return this.head_.data}return undefined};fu.prototype.nextItem=function(){if(this.head_&&this.head_.next){this.head_=this.head_.next;return this.head_.data}return undefined};fu.prototype.getNextItem=function(){if(this.head_&&this.head_.next){return this.head_.next.data}return undefined};fu.prototype.prevItem=function(){if(this.head_&&this.head_.prev){this.head_=this.head_.prev;return this.head_.data}return undefined};fu.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev){return this.head_.prev.data}return undefined};fu.prototype.getCurrItem=function(){if(this.head_){return this.head_.data}return undefined};fu.prototype.setFirstItem=function(){if(this.circular_&&this.head_){this.first_=this.head_;this.last_=this.head_.prev}};fu.prototype.concat=function(t){if(t.head_){if(this.head_){var i=this.head_.next;this.head_.next=t.first_;t.first_.prev=this.head_;i.prev=t.last_;t.last_.next=i;this.length_+=t.length_}else{this.head_=t.head_;this.first_=t.first_;this.last_=t.last_;this.length_=t.length_}t.head_=undefined;t.first_=undefined;t.last_=undefined;t.length_=0}};fu.prototype.getLength=function(){return this.length_};var uu=function(t){this.rbush_=nf(t);this.items_={}};uu.prototype.insert=function(t,i){var s={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};this.rbush_.insert(s);this.items_[kh.getUid(i)]=s};uu.prototype.load=function(t,i){var s=new Array(i.length);for(var e=0,r=i.length;e<r;e++){var n=t[e];var h=i[e];var a={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],value:h};s[e]=a;this.items_[kh.getUid(h)]=a}this.rbush_.load(s)};uu.prototype.remove=function(t){var i=kh.getUid(t);var s=this.items_[i];delete this.items_[i];return this.rbush_.remove(s)!==null};uu.prototype.update=function(t,i){var s=this.items_[kh.getUid(i)];var e=[s.minX,s.minY,s.maxX,s.maxY];if(!qh.equals(e,t)){this.remove(i);this.insert(t,i)}};uu.prototype.getAll=function(){var t=this.rbush_.all();return t.map((function(t){return t.value}))};uu.prototype.getInExtent=function(t){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};var s=this.rbush_.search(i);return s.map((function(t){return t.value}))};uu.prototype.forEach=function(t,i){return this.forEach_(this.getAll(),t,i)};uu.prototype.forEachInExtent=function(t,i,s){return this.forEach_(this.getInExtent(t),i,s)};uu.prototype.forEach_=function(t,i,s){var e;for(var r=0,n=t.length;r<n;r++){e=i.call(s,t[r]);if(e){return e}}return e};uu.prototype.isEmpty=function(){return Ch.isEmpty(this.items_)};uu.prototype.clear=function(){this.rbush_.clear();this.items_={}};uu.prototype.getExtent=function(t){var i=this.rbush_.data;return qh.createOrUpdate(i.minX,i.minY,i.maxX,i.maxY,t)};uu.prototype.concat=function(t){this.rbush_.load(t.rbush_.all());for(var i in t.items_){this.items_[i|0]=t.items_[i|0]}};var vu=function(t,i){Yf.call(this,t,i);this.lineStringReplay=new nu(t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.state_={fillColor:null,changed:false}};kh.inherits(vu,Yf);vu.prototype.drawCoordinates_=function(t,i,s){var e=new fu;var r=new uu;this.processFlatCoordinates_(t,s,e,r,true);var n=this.getMaxCoords_(e);if(i.length){var h,a;var o=[];for(h=0,a=i.length;h<a;++h){var f={list:new fu,maxCoords:undefined,rtree:new uu};o.push(f);this.processFlatCoordinates_(i[h],s,f.list,f.rtree,false);this.classifyPoints_(f.list,f.rtree,true);f.maxCoords=this.getMaxCoords_(f.list)}o.sort((function(t,i){return i.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-i.maxCoords[1]:i.maxCoords[0]-t.maxCoords[0]}));for(h=0;h<o.length;++h){var u=o[h].list;var v=u.firstItem();var l=v;var c;do{if(this.getIntersections_(l,r).length){c=true;break}l=u.nextItem()}while(v!==l);if(!c){if(this.bridgeHole_(u,o[h].maxCoords[0],e,n[0],r)){r.concat(o[h].rtree);this.classifyPoints_(e,r,false)}}}}else{this.classifyPoints_(e,r,false)}this.triangulate_(e,r)};vu.prototype.processFlatCoordinates_=function(t,i,s,e,r){var n=Ma.linearRingIsClockwise(t,0,t.length,i);var h,a;var o=this.vertices.length/2;var f;var u;var v;var l=[];var c=[];if(r===n){f=this.createPoint_(t[0],t[1],o++);u=f;for(h=i,a=t.length;h<a;h+=i){v=this.createPoint_(t[h],t[h+1],o++);c.push(this.insertItem_(u,v,s));l.push([Math.min(u.x,v.x),Math.min(u.y,v.y),Math.max(u.x,v.x),Math.max(u.y,v.y)]);u=v}c.push(this.insertItem_(v,f,s));l.push([Math.min(u.x,v.x),Math.min(u.y,v.y),Math.max(u.x,v.x),Math.max(u.y,v.y)])}else{var d=t.length-i;f=this.createPoint_(t[d],t[d+1],o++);u=f;for(h=d-i,a=0;h>=a;h-=i){v=this.createPoint_(t[h],t[h+1],o++);c.push(this.insertItem_(u,v,s));l.push([Math.min(u.x,v.x),Math.min(u.y,v.y),Math.max(u.x,v.x),Math.max(u.y,v.y)]);u=v}c.push(this.insertItem_(v,f,s));l.push([Math.min(u.x,v.x),Math.min(u.y,v.y),Math.max(u.x,v.x),Math.max(u.y,v.y)])}e.load(l,c)};vu.prototype.getMaxCoords_=function(t){var i=t.firstItem();var s=i;var e=[s.p0.x,s.p0.y];do{s=t.nextItem();if(s.p0.x>e[0]){e=[s.p0.x,s.p0.y]}}while(s!==i);return e};vu.prototype.classifyPoints_=function(t,i,s){var e=t.firstItem();var r=e;var n=t.nextItem();var h=false;do{var a=s?Bf.triangleIsCounterClockwise(n.p1.x,n.p1.y,r.p1.x,r.p1.y,r.p0.x,r.p0.y):Bf.triangleIsCounterClockwise(r.p0.x,r.p0.y,r.p1.x,r.p1.y,n.p1.x,n.p1.y);if(a===undefined){this.removeItem_(r,n,t,i);h=true;if(n===e){e=t.getNextItem()}n=r;t.prevItem()}else if(r.p1.reflex!==a){r.p1.reflex=a;h=true}r=n;n=t.nextItem()}while(r!==e);return h};vu.prototype.bridgeHole_=function(t,i,s,e,r){var n=t.firstItem();while(n.p1.x!==i){n=t.nextItem()}var h=n.p1;var a={x:e,y:h.y,i:-1};var o=Infinity;var f,u,v;var l;var c=this.getIntersections_({p0:h,p1:a},r,true);for(f=0,u=c.length;f<u;++f){var d=c[f];var m=this.calculateIntersection_(h,a,d.p0,d.p1,true);var p=Math.abs(h.x-m[0]);if(p<o&&Bf.triangleIsCounterClockwise(h.x,h.y,d.p0.x,d.p0.y,d.p1.x,d.p1.y)!==undefined){o=p;l={x:m[0],y:m[1],i:-1};n=d}}if(o===Infinity){return false}v=n.p1;if(o>0){var M=this.getPointsInTriangle_(h,l,n.p1,r);if(M.length){var z=Infinity;for(f=0,u=M.length;f<u;++f){var _=M[f];var g=Math.atan2(h.y-_.y,a.x-_.x);if(g<z||g===z&&_.x<v.x){z=g;v=_}}}}n=s.firstItem();while(n.p1.x!==v.x||n.p1.y!==v.y){n=s.nextItem()}var w={x:h.x,y:h.y,i:h.i,reflex:undefined};var y={x:n.p1.x,y:n.p1.y,i:n.p1.i,reflex:undefined};t.getNextItem().p0=w;this.insertItem_(h,n.p1,t,r);this.insertItem_(y,w,t,r);n.p1=y;t.setFirstItem();s.concat(t);return true};vu.prototype.triangulate_=function(t,i){var s=false;var e=this.isSimple_(t,i);while(t.getLength()>3){if(e){if(!this.clipEars_(t,i,e,s)){if(!this.classifyPoints_(t,i,s)){if(!this.resolveSelfIntersections_(t,i,true)){break}}}}else{if(!this.clipEars_(t,i,e,s)){if(!this.classifyPoints_(t,i,s)){if(!this.resolveSelfIntersections_(t,i)){e=this.isSimple_(t,i);if(!e){this.splitPolygon_(t,i);break}else{s=!this.isClockwise_(t);this.classifyPoints_(t,i,s)}}}}}}if(t.getLength()===3){var r=this.indices.length;this.indices[r++]=t.getPrevItem().p0.i;this.indices[r++]=t.getCurrItem().p0.i;this.indices[r++]=t.getNextItem().p0.i}};vu.prototype.clipEars_=function(t,i,s,e){var r=this.indices.length;var n=t.firstItem();var h=t.getPrevItem();var a=n;var o=t.nextItem();var f=t.getNextItem();var u,v,l;var c=false;do{u=a.p0;v=a.p1;l=o.p1;if(v.reflex===false){var d;if(s){d=this.getPointsInTriangle_(u,v,l,i,true).length===0}else{d=e?this.diagonalIsInside_(f.p1,l,v,u,h.p0):this.diagonalIsInside_(h.p0,u,v,l,f.p1)}if((s||this.getIntersections_({p0:u,p1:l},i).length===0)&&d){if(s||u.reflex===false||l.reflex===false||Ma.linearRingIsClockwise([h.p0.x,h.p0.y,u.x,u.y,v.x,v.y,l.x,l.y,f.p1.x,f.p1.y],0,10,2)===!e){this.indices[r++]=u.i;this.indices[r++]=v.i;this.indices[r++]=l.i;this.removeItem_(a,o,t,i);if(o===n){n=f}c=true}}}h=t.getPrevItem();a=t.getCurrItem();o=t.nextItem();f=t.getNextItem()}while(a!==n&&t.getLength()>3);return c};vu.prototype.resolveSelfIntersections_=function(t,i,s){var e=t.firstItem();t.nextItem();var r=e;var n=t.nextItem();var h=false;do{var a=this.calculateIntersection_(r.p0,r.p1,n.p0,n.p1,s);if(a){var o=false;var f=this.vertices.length;var u=this.indices.length;var v=f/2;var l=t.prevItem();t.removeItem();i.remove(l);o=l===e;var c;if(s){if(a[0]===r.p0.x&&a[1]===r.p0.y){t.prevItem();c=r.p0;n.p0=c;i.remove(r);o=o||r===e}else{c=n.p1;r.p1=c;i.remove(n);o=o||n===e}t.removeItem()}else{c=this.createPoint_(a[0],a[1],v);r.p1=c;n.p0=c;i.update([Math.min(r.p0.x,r.p1.x),Math.min(r.p0.y,r.p1.y),Math.max(r.p0.x,r.p1.x),Math.max(r.p0.y,r.p1.y)],r);i.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n)}this.indices[u++]=l.p0.i;this.indices[u++]=l.p1.i;this.indices[u++]=c.i;h=true;if(o){break}}r=t.getPrevItem();n=t.nextItem()}while(r!==e);return h};vu.prototype.isSimple_=function(t,i){var s=t.firstItem();var e=s;do{if(this.getIntersections_(e,i).length){return false}e=t.nextItem()}while(e!==s);return true};vu.prototype.isClockwise_=function(t){var i=t.getLength()*2;var s=new Array(i);var e=t.firstItem();var r=e;var n=0;do{s[n++]=r.p0.x;s[n++]=r.p0.y;r=t.nextItem()}while(r!==e);return Ma.linearRingIsClockwise(s,0,i,2)};vu.prototype.splitPolygon_=function(t,i){var s=t.firstItem();var e=s;do{var r=this.getIntersections_(e,i);if(r.length){var n=r[0];var h=this.vertices.length/2;var a=this.calculateIntersection_(e.p0,e.p1,n.p0,n.p1);var o=this.createPoint_(a[0],a[1],h);var f=new fu;var u=new uu;this.insertItem_(o,e.p1,f,u);e.p1=o;i.update([Math.min(e.p0.x,o.x),Math.min(e.p0.y,o.y),Math.max(e.p0.x,o.x),Math.max(e.p0.y,o.y)],e);var v=t.nextItem();while(v!==n){this.insertItem_(v.p0,v.p1,f,u);i.remove(v);t.removeItem();v=t.getCurrItem()}this.insertItem_(n.p0,o,f,u);n.p0=o;i.update([Math.min(n.p1.x,o.x),Math.min(n.p1.y,o.y),Math.max(n.p1.x,o.x),Math.max(n.p1.y,o.y)],n);this.classifyPoints_(t,i,false);this.triangulate_(t,i);this.classifyPoints_(f,u,false);this.triangulate_(f,u);break}e=t.nextItem()}while(e!==s)};vu.prototype.createPoint_=function(t,i,s){var e=this.vertices.length;this.vertices[e++]=t;this.vertices[e++]=i;var r={x:t,y:i,i:s,reflex:undefined};return r};vu.prototype.insertItem_=function(t,i,s,e){var r={p0:t,p1:i};s.insertItem(r);if(e){e.insert([Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x,i.x),Math.max(t.y,i.y)],r)}return r};vu.prototype.removeItem_=function(t,i,s,e){if(s.getCurrItem()===i){s.removeItem();t.p1=i.p1;e.remove(i);e.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t)}};vu.prototype.getPointsInTriangle_=function(t,i,s,e,r){var n,h,a,o;var f=[];var u=e.getInExtent([Math.min(t.x,i.x,s.x),Math.min(t.y,i.y,s.y),Math.max(t.x,i.x,s.x),Math.max(t.y,i.y,s.y)]);for(n=0,h=u.length;n<h;++n){for(a in u[n]){o=u[n][a];if(typeof o==="object"&&(!r||o.reflex)){if((o.x!==t.x||o.y!==t.y)&&(o.x!==i.x||o.y!==i.y)&&(o.x!==s.x||o.y!==s.y)&&f.indexOf(o)===-1&&la.linearRingContainsXY([t.x,t.y,i.x,i.y,s.x,s.y],0,6,2,o.x,o.y)){f.push(o)}}}}return f};vu.prototype.getIntersections_=function(t,i,s){var e=t.p0;var r=t.p1;var n=i.getInExtent([Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x,r.x),Math.max(e.y,r.y)]);var h=[];var a,o;for(a=0,o=n.length;a<o;++a){var f=n[a];if(t!==f&&(s||f.p0!==r||f.p1!==e)&&this.calculateIntersection_(e,r,f.p0,f.p1,s)){h.push(f)}}return h};vu.prototype.calculateIntersection_=function(t,i,s,e,r){var n=(e.y-s.y)*(i.x-t.x)-(e.x-s.x)*(i.y-t.y);if(n!==0){var h=((e.x-s.x)*(t.y-s.y)-(e.y-s.y)*(t.x-s.x))/n;var a=((i.x-t.x)*(t.y-s.y)-(i.y-t.y)*(t.x-s.x))/n;if(!r&&h>Bf.EPSILON&&h<1-Bf.EPSILON&&a>Bf.EPSILON&&a<1-Bf.EPSILON||r&&h>=0&&h<=1&&a>=0&&a<=1){return[t.x+h*(i.x-t.x),t.y+h*(i.y-t.y)]}}return undefined};vu.prototype.diagonalIsInside_=function(t,i,s,e,r){if(i.reflex===undefined||e.reflex===undefined){return false}var n=(s.x-e.x)*(i.y-e.y)>(s.y-e.y)*(i.x-e.x);var h=(r.x-e.x)*(i.y-e.y)<(r.y-e.y)*(i.x-e.x);var a=(t.x-i.x)*(e.y-i.y)>(t.y-i.y)*(e.x-i.x);var o=(s.x-i.x)*(e.y-i.y)<(s.y-i.y)*(e.x-i.x);var f=e.reflex?h||n:h&&n;var u=i.reflex?o||a:o&&a;return f&&u};vu.prototype.drawMultiPolygon=function(t,i){var s=t.getEndss();var e=t.getStride();var r=this.indices.length;var n=this.lineStringReplay.getCurrentIndex();var h=t.getFlatCoordinates();var a,o,f,u;var v=0;for(a=0,o=s.length;a<o;++a){var l=s[a];if(l.length>0){var c=Bh.translate(h,v,l[0],e,-this.origin[0],-this.origin[1]);if(c.length){var d=[];var m;for(f=1,u=l.length;f<u;++f){if(l[f]!==l[f-1]){m=Bh.translate(h,l[f-1],l[f],e,-this.origin[0],-this.origin[1]);d.push(m)}}this.lineStringReplay.drawPolygonCoordinates(c,d,e);this.drawCoordinates_(c,d,e)}}v=l[l.length-1]}if(this.indices.length>r){this.startIndices.push(r);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(r);this.state_.changed=false}}if(this.lineStringReplay.getCurrentIndex()>n){this.lineStringReplay.setPolygonStyle(i,n)}};vu.prototype.drawPolygon=function(t,i){var s=t.getEnds();var e=t.getStride();if(s.length>0){var r=t.getFlatCoordinates().map(Number);var n=Bh.translate(r,0,s[0],e,-this.origin[0],-this.origin[1]);if(n.length){var h=[];var a,o,f;for(a=1,o=s.length;a<o;++a){if(s[a]!==s[a-1]){f=Bh.translate(r,s[a-1],s[a],e,-this.origin[0],-this.origin[1]);h.push(f)}}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.lineStringReplay.setPolygonStyle(i);this.lineStringReplay.drawPolygonCoordinates(n,h,e);this.drawCoordinates_(n,h,e)}}};vu.prototype.finish=function(t){this.verticesBuffer=new Hf(this.vertices);this.indicesBuffer=new Hf(this.indices);this.startIndices.push(this.indices.length);this.lineStringReplay.finish(t);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};vu.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;var e=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(i);t.deleteBuffer(s);e()}};vu.prototype.setUpProgram=function(t,i,s,e){var r,n;r=hu.fragment;n=hu.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new au(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,_a.FLOAT,false,8,0);return a};vu.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position)};vu.prototype.drawReplay=function(t,i,s,e){var r=t.getParameter(t.DEPTH_FUNC);var n=t.getParameter(t.DEPTH_WRITEMASK);if(!e){t.enable(t.DEPTH_TEST);t.depthMask(true);t.depthFunc(t.NOTEQUAL)}if(!Ch.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var h,a,o,f;o=this.startIndices[this.startIndices.length-1];for(h=this.styleIndices_.length-1;h>=0;--h){a=this.styleIndices_[h];f=this.styles_[h];this.setFillStyle_(t,f);this.drawElements(t,i,a,o);o=a}}if(!e){t.disable(t.DEPTH_TEST);t.clear(t.DEPTH_BUFFER_BIT);t.depthMask(n);t.depthFunc(r)}};vu.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,v,l;l=this.startIndices.length-2;a=this.startIndices[l+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setFillStyle_(t,o);f=this.styleIndices_[n];while(l>=0&&this.startIndices[l]>=f){h=this.startIndices[l];u=this.startIndicesFeature[l];v=kh.getUid(u).toString();if(s[v]===undefined&&u.getGeometry()&&(r===undefined||qh.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}l--;a=h}}return undefined};vu.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,v;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setFillStyle_(t,h);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){v=this.startIndices[u];o=this.startIndicesFeature[u];f=kh.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}n=v}u--;r=v}if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}r=n=a}};vu.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_color,i)};vu.prototype.setFillStrokeStyle=function(t,i){var s=t?t.getColor():[0,0,0,0];if(!(s instanceof CanvasGradient)&&!(s instanceof CanvasPattern)){s=Uo.asArray(s).map((function(t,i){return i!=3?t/255:t}))||Bf.defaultFillStyle}else{s=Bf.defaultFillStyle}if(!this.state_.fillColor||!jh.equals(s,this.state_.fillColor)){this.state_.fillColor=s;this.state_.changed=true;this.styles_.push(s)}if(i){this.lineStringReplay.setFillStrokeStyle(null,i)}else{var e=new ou({color:[0,0,0,0],lineWidth:0});this.lineStringReplay.setFillStrokeStyle(null,e)}};var lu=function(t,i){this.space_=i;this.emptyBlocks_=[{x:0,y:0,width:t,height:t}];this.entries_={};this.context_=$a.createCanvasContext2D(t,t);this.canvas_=this.context_.canvas};lu.prototype.get=function(t){return this.entries_[t]||null};lu.prototype.add=function(t,i,s,e,r){var n,h,a;for(h=0,a=this.emptyBlocks_.length;h<a;++h){n=this.emptyBlocks_[h];if(n.width>=i+this.space_&&n.height>=s+this.space_){var o={offsetX:n.x+this.space_,offsetY:n.y+this.space_,image:this.canvas_};this.entries_[t]=o;e.call(r,this.context_,n.x+this.space_,n.y+this.space_);this.split_(h,n,i+this.space_,s+this.space_);return o}}return null};lu.prototype.split_=function(t,i,s,e){var r=i.width-s;var n=i.height-e;var h;var a;if(r>n){h={x:i.x+s,y:i.y,width:i.width-s,height:i.height};a={x:i.x,y:i.y+e,width:s,height:i.height-e};this.updateBlocks_(t,h,a)}else{h={x:i.x+s,y:i.y,width:i.width-s,height:e};a={x:i.x,y:i.y+e,width:i.width,height:i.height-e};this.updateBlocks_(t,h,a)}};lu.prototype.updateBlocks_=function(t,i,s){var e=[t,1];if(i.width>0&&i.height>0){e.push(i)}if(s.width>0&&s.height>0){e.push(s)}this.emptyBlocks_.splice.apply(this.emptyBlocks_,e)};var cu=function(t){var i=t||{};this.currentSize_=i.initialSize!==undefined?i.initialSize:kh.INITIAL_ATLAS_SIZE;this.maxSize_=i.maxSize!==undefined?i.maxSize:kh.MAX_ATLAS_SIZE!=-1?kh.MAX_ATLAS_SIZE:kh.WEBGL_MAX_TEXTURE_SIZE!==undefined?kh.WEBGL_MAX_TEXTURE_SIZE:2048;this.space_=i.space!==undefined?i.space:1;this.atlases_=[new lu(this.currentSize_,this.space_)];this.currentHitSize_=this.currentSize_;this.hitAtlases_=[new lu(this.currentHitSize_,this.space_)]};cu.prototype.getInfo=function(t){var i=this.getInfo_(this.atlases_,t);if(!i){return null}var s=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(i,s)};cu.prototype.getInfo_=function(t,i){var s,e,r,n;for(r=0,n=t.length;r<n;++r){s=t[r];e=s.get(i);if(e){return e}}return null};cu.prototype.mergeInfos_=function(t,i){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:i.image}};cu.prototype.add=function(t,i,s,e,r,n){if(i+this.space_>this.maxSize_||s+this.space_>this.maxSize_){return null}var h=this.add_(false,t,i,s,e,n);if(!h){return null}var a=r!==undefined?r:kh.nullFunction;var o=this.add_(true,t,i,s,a,n);return this.mergeInfos_(h,o)};cu.prototype.add_=function(t,i,s,e,r,n){var h=t?this.hitAtlases_:this.atlases_;var a,o,f,u;for(f=0,u=h.length;f<u;++f){a=h[f];o=a.add(i,s,e,r,n);if(o){return o}else if(!o&&f===u-1){var v;if(t){v=Math.min(this.currentHitSize_*2,this.maxSize_);this.currentHitSize_=v}else{v=Math.min(this.currentSize_*2,this.maxSize_);this.currentSize_=v}a=new lu(v,this.space_);h.push(a);++u}}return null};var du=function(t,i){tu.call(this,t,i);this.images_=[];this.textures_=[];this.measureCanvas_=$a.createCanvasContext2D(0,0).canvas;this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:0,miterLimit:undefined,fillColor:null,font:undefined,scale:undefined};this.text_="";this.textAlign_=undefined;this.textBaseline_=undefined;this.offsetX_=undefined;this.offsetY_=undefined;this.atlases_={};this.currAtlas_=undefined;this.scale=1;this.opacity=1};kh.inherits(du,tu);du.prototype.drawText=function(t,i){if(this.text_){var s=null;var e=0;var r=2;var n=2;switch(t.getType()){case Gh.POINT:case Gh.MULTI_POINT:s=t.getFlatCoordinates();r=s.length;n=t.getStride();break;case Gh.CIRCLE:s=t.getCenter();break;case Gh.LINE_STRING:s=t.getFlatMidpoint();break;case Gh.MULTI_LINE_STRING:s=t.getFlatMidpoints();r=s.length;break;case Gh.POLYGON:s=t.getFlatInteriorPoint();break;case Gh.MULTI_POLYGON:s=t.getFlatInteriorPoints();r=s.length;break}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var h=this.currAtlas_;var a=this.text_.split("\n");var o=this.getTextSize_(a);var f,u,v,l,c,d,m,p;var M=Math.round(o[0]*this.textAlign_-this.offsetX_);var z=Math.round(o[1]*this.textBaseline_-this.offsetY_);var _=this.state_.lineWidth/2*this.state_.scale;for(f=0,u=a.length;f<u;++f){c=0;d=h.height*f;m=a[f].split("");for(v=0,l=m.length;v<l;++v){p=h.atlas.getInfo(m[v]);if(p){var g=p.image;this.anchorX=M-c;this.anchorY=z-d;this.originX=v===0?p.offsetX-_:p.offsetX;this.originY=p.offsetY;this.height=h.height;this.width=v===0||v===m.length-1?h.width[m[v]]+_:h.width[m[v]];this.imageHeight=g.height;this.imageWidth=g.width;var w;if(this.images_.length===0){this.images_.push(g)}else{w=this.images_[this.images_.length-1];if(kh.getUid(w)!=kh.getUid(g)){this.groupIndices.push(this.indices.length);this.images_.push(g)}}this.drawText_(s,e,r,n)}c+=this.width}}}};du.prototype.getTextSize_=function(t){var i=this;var s=this.currAtlas_;var e=t.length*s.height;var r=t.map((function(t){var e=0;var r,n;for(r=0,n=t.length;r<n;++r){var h=t[r];if(!s.width[h]){i.addCharToAtlas_(h)}e+=s.width[h]?s.width[h]:0}return e})).reduce((function(t,i){return Math.max(t,i)}));return[r,e]};du.prototype.drawText_=function(t,i,s,e){var r,n;for(r=i,n=s;r<n;r+=e){this.drawCoordinates(t,i,s,e)}};du.prototype.addCharToAtlas_=function(t){if(t.length===1){var i=this.currAtlas_;var s=this.state_;var e=this.measureCanvas_.getContext("2d");e.font=s.font;var r=Math.ceil(e.measureText(t).width*s.scale);var n=i.atlas.add(t,r,i.height,(function(i,e,r){i.font=s.font;i.fillStyle=s.fillColor;i.strokeStyle=s.strokeColor;i.lineWidth=s.lineWidth;i.lineCap=s.lineCap;i.lineJoin=s.lineJoin;i.miterLimit=s.miterLimit;i.textAlign="left";i.textBaseline="top";if(ga.CANVAS_LINE_DASH&&s.lineDash){i.setLineDash(s.lineDash);i.lineDashOffset=s.lineDashOffset}if(s.scale!==1){i.setTransform(s.scale,0,0,s.scale,0,0)}if(s.strokeColor){i.strokeText(t,e,r)}if(s.fillColor){i.fillText(t,e,r)}}));if(n){i.width[t]=r}}};du.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices=this.groupIndices;this.verticesBuffer=new Hf(this.vertices);this.indicesBuffer=new Hf(this.indices);var s={};this.createTextures(this.textures_,this.images_,s,i);this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:0,miterLimit:undefined,fillColor:null,font:undefined,scale:undefined};this.text_="";this.textAlign_=undefined;this.textBaseline_=undefined;this.offsetX_=undefined;this.offsetY_=undefined;this.images_=null;this.atlases_={};this.currAtlas_=undefined;tu.prototype.finish.call(this,t)};du.prototype.setTextStyle=function(t){var i=this.state_;var s=t.getFill();var e=t.getStroke();if(!t||!t.getText()||!s&&!e){this.text_=""}else{if(!s){i.fillColor=null}else{var r=s.getColor();i.fillColor=qo.asColorLike(r?r:Bf.defaultFillStyle)}if(!e){i.strokeColor=null;i.lineWidth=0}else{var n=e.getColor();i.strokeColor=qo.asColorLike(n?n:Bf.defaultStrokeStyle);i.lineWidth=e.getWidth()||Bf.defaultLineWidth;i.lineCap=e.getLineCap()||Bf.defaultLineCap;i.lineDashOffset=e.getLineDashOffset()||Bf.defaultLineDashOffset;i.lineJoin=e.getLineJoin()||Bf.defaultLineJoin;i.miterLimit=e.getMiterLimit()||Bf.defaultMiterLimit;var h=e.getLineDash();i.lineDash=h?h.slice():Bf.defaultLineDash}i.font=t.getFont()||Bf.defaultFont;i.scale=t.getScale()||1;this.text_=t.getText();var a=Nf.TEXT_ALIGN[t.getTextAlign()];var o=Nf.TEXT_ALIGN[t.getTextBaseline()];this.textAlign_=a===undefined?Bf.defaultTextAlign:a;this.textBaseline_=o===undefined?Bf.defaultTextBaseline:o;this.offsetX_=t.getOffsetX()||0;this.offsetY_=t.getOffsetY()||0;this.rotateWithView=!!t.getRotateWithView();this.rotation=t.getRotation()||0;this.currAtlas_=this.getAtlas_(i)}};du.prototype.getAtlas_=function(t){var i=[];var s;for(s in t){if(t[s]||t[s]===0){if(Array.isArray(t[s])){i=i.concat(t[s])}else{i.push(t[s])}}}var e=this.calculateHash_(i);if(!this.atlases_[e]){var r=this.measureCanvas_.getContext("2d");r.font=t.font;var n=Math.ceil((r.measureText("M").width*1.5+t.lineWidth/2)*t.scale);this.atlases_[e]={atlas:new cu({space:t.lineWidth+1}),width:{},height:n}}return this.atlases_[e]};du.prototype.calculateHash_=function(t){var i,s;var e="";for(i=0,s=t.length;i<s;++i){e+=t[i]}return e};du.prototype.getTextures=function(t){return this.textures_};du.prototype.getHitDetectionTextures=function(){return this.textures_};var mu=function(t,i,s){yf.call(this);this.maxExtent_=i;this.tolerance_=t;this.renderBuffer_=s;this.replaysByZIndex_={}};kh.inherits(mu,yf);mu.prototype.addDeclutter=function(t,i){};mu.prototype.getDeleteResourcesFunction=function(t){var i=[];var s;for(s in this.replaysByZIndex_){var e=this.replaysByZIndex_[s];var r;for(r in e){i.push(e[r].getDeleteResourcesFunction(t))}}return function(){var t=i.length;var s;for(var e=0;e<t;e++){s=i[e].apply(this,arguments)}return s}};mu.prototype.finish=function(t){var i;for(i in this.replaysByZIndex_){var s=this.replaysByZIndex_[i];var e;for(e in s){s[e].finish(t)}}};mu.prototype.getReplay=function(t,i){var s=t!==undefined?t.toString():"0";var e=this.replaysByZIndex_[s];if(e===undefined){e={};this.replaysByZIndex_[s]=e}var r=e[i];if(r===undefined){var n=mu.BATCH_CONSTRUCTORS_[i];r=new n(this.tolerance_,this.maxExtent_);e[i]=r}return r};mu.prototype.isEmpty=function(){return Ch.isEmpty(this.replaysByZIndex_)};mu.prototype.replay=function(t,i,s,e,r,n,h,a){var o=Object.keys(this.replaysByZIndex_).map(Number);o.sort(jh.numberSafeCompareFunction);var f,u,v,l,c,d;for(f=0,u=o.length;f<u;++f){c=this.replaysByZIndex_[o[f].toString()];for(v=0,l=Nf.ORDER.length;v<l;++v){d=c[Nf.ORDER[v]];if(d!==undefined){d.replay(t,i,s,e,r,n,h,a,undefined,false)}}}};mu.prototype.replayHitDetection_=function(t,i,s,e,r,n,h,a,o,f,u){var v=Object.keys(this.replaysByZIndex_).map(Number);v.sort((function(t,i){return i-t}));var l,c,d,m,p,M;for(l=0,c=v.length;l<c;++l){m=this.replaysByZIndex_[v[l].toString()];for(d=Nf.ORDER.length-1;d>=0;--d){p=m[Nf.ORDER[d]];if(p!==undefined){M=p.replay(t,i,s,e,r,n,h,a,o,f,u);if(M){return M}}}}return undefined};mu.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h,a,o,f){var u=i.getGL();u.bindFramebuffer(u.FRAMEBUFFER,i.getHitDetectionFramebuffer());var v;if(this.renderBuffer_!==undefined){v=qh.buffer(qh.createOrUpdateFromCoordinate(t),e*this.renderBuffer_)}return this.replayHitDetection_(i,t,e,r,mu.HIT_DETECTION_SIZE_,h,a,o,(function(t){var i=new Uint8Array(4);u.readPixels(0,0,1,1,u.RGBA,u.UNSIGNED_BYTE,i);if(i[3]>0){var s=f(t);if(s){return s}}}),true,v)};mu.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r,n,h,a,o){var f=i.getGL();f.bindFramebuffer(f.FRAMEBUFFER,i.getHitDetectionFramebuffer());var u=this.replayHitDetection_(i,t,e,r,mu.HIT_DETECTION_SIZE_,h,a,o,(function(t){var i=new Uint8Array(4);f.readPixels(0,0,1,1,f.RGBA,f.UNSIGNED_BYTE,i);return i[3]>0}),false);return u!==undefined};mu.HIT_DETECTION_SIZE_=[1,1];mu.BATCH_CONSTRUCTORS_={Circle:Jf,Image:iu,LineString:nu,Polygon:vu,Text:du};var pu=function(t,i,s,e,r,n,h){Xo.call(this);this.context_=t;this.center_=i;this.extent_=n;this.pixelRatio_=h;this.size_=r;this.rotation_=e;this.resolution_=s;this.imageStyle_=null;this.fillStyle_=null;this.strokeStyle_=null;this.textStyle_=null};kh.inherits(pu,Xo);pu.prototype.drawText_=function(t,i){var s=this.context_;var e=t.getReplay(0,bf.TEXT);e.setTextStyle(this.textStyle_);e.drawText(i,null);e.finish(s);var r=1;var n={};var h;var a=false;e.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,r,n,h,a);e.getDeleteResourcesFunction(s)()};pu.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke());this.setImageStyle(t.getImage());this.setTextStyle(t.getText())};pu.prototype.drawGeometry=function(t){var i=t.getType();switch(i){case Gh.POINT:this.drawPoint(t,null);break;case Gh.LINE_STRING:this.drawLineString(t,null);break;case Gh.POLYGON:this.drawPolygon(t,null);break;case Gh.MULTI_POINT:this.drawMultiPoint(t,null);break;case Gh.MULTI_LINE_STRING:this.drawMultiLineString(t,null);break;case Gh.MULTI_POLYGON:this.drawMultiPolygon(t,null);break;case Gh.GEOMETRY_COLLECTION:this.drawGeometryCollection(t,null);break;case Gh.CIRCLE:this.drawCircle(t,null);break}};pu.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);if(!s||!qh.intersects(this.extent_,s.getExtent())){return}this.setStyle(i);this.drawGeometry(s)};pu.prototype.drawGeometryCollection=function(t,i){var s=t.getGeometriesArray();var e,r;for(e=0,r=s.length;e<r;++e){this.drawGeometry(s[e])}};pu.prototype.drawPoint=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.IMAGE);r.setImageStyle(this.imageStyle_);r.drawPoint(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawMultiPoint=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.IMAGE);r.setImageStyle(this.imageStyle_);r.drawMultiPoint(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawLineString=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.LINE_STRING);r.setFillStrokeStyle(null,this.strokeStyle_);r.drawLineString(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawMultiLineString=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.LINE_STRING);r.setFillStrokeStyle(null,this.strokeStyle_);r.drawMultiLineString(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawPolygon=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.POLYGON);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawPolygon(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawMultiPolygon=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.POLYGON);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawMultiPolygon(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawCircle=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.CIRCLE);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawCircle(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.setImageStyle=function(t){this.imageStyle_=t};pu.prototype.setFillStrokeStyle=function(t,i){this.fillStyle_=t;this.strokeStyle_=i};pu.prototype.setTextStyle=function(t){this.textStyle_=t};var Mu={};Mu.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n":"precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}");Mu.vertex=new Vf(kh.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}");var zu=function(t,i){this.u_texCoordMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_texCoordMatrix":"d");this.u_projectionMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_projectionMatrix":"e");this.u_opacity=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_opacity":"f");this.u_texture=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_texture":"g");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"b");this.a_texCoord=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_texCoord":"c")};var _u=function(t,i){Bo.call(this,i);this.mapRenderer=t;this.arrayBuffer_=new Hf([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]);this.texture=null;this.framebuffer=null;this.framebufferDimension=undefined;this.texCoordMatrix=sa.create();this.projectionMatrix=sa.create();this.tmpMat4_=Xf.create();this.defaultLocations_=null};kh.inherits(_u,Bo);_u.prototype.bindFramebuffer=function(t,i){var s=this.mapRenderer.getGL();if(this.framebufferDimension===undefined||this.framebufferDimension!=i){var e=function(t,i,s){if(!t.isContextLost()){t.deleteFramebuffer(i);t.deleteTexture(s)}}.bind(null,s,this.framebuffer,this.texture);t.postRenderFunctions.push(e);var r=Qf.createEmptyTexture(s,i,i);var n=s.createFramebuffer();s.bindFramebuffer(_a.FRAMEBUFFER,n);s.framebufferTexture2D(_a.FRAMEBUFFER,_a.COLOR_ATTACHMENT0,_a.TEXTURE_2D,r,0);this.texture=r;this.framebuffer=n;this.framebufferDimension=i}else{s.bindFramebuffer(_a.FRAMEBUFFER,this.framebuffer)}};_u.prototype.composeFrame=function(t,i,s){this.dispatchComposeEvent_(uo.PRECOMPOSE,s,t);s.bindBuffer(_a.ARRAY_BUFFER,this.arrayBuffer_);var e=s.getGL();var r=Mu.fragment;var n=Mu.vertex;var h=s.getProgram(r,n);var a;if(!this.defaultLocations_){a=new zu(e,h);this.defaultLocations_=a}else{a=this.defaultLocations_}if(s.useProgram(h)){e.enableVertexAttribArray(a.a_position);e.vertexAttribPointer(a.a_position,2,_a.FLOAT,false,16,0);e.enableVertexAttribArray(a.a_texCoord);e.vertexAttribPointer(a.a_texCoord,2,_a.FLOAT,false,16,8);e.uniform1i(a.u_texture,0)}e.uniformMatrix4fv(a.u_texCoordMatrix,false,Xf.fromTransform(this.tmpMat4_,this.getTexCoordMatrix()));e.uniformMatrix4fv(a.u_projectionMatrix,false,Xf.fromTransform(this.tmpMat4_,this.getProjectionMatrix()));e.uniform1f(a.u_opacity,i.opacity);e.bindTexture(_a.TEXTURE_2D,this.getTexture());e.drawArrays(_a.TRIANGLE_STRIP,0,4);this.dispatchComposeEvent_(uo.POSTCOMPOSE,s,t)};_u.prototype.dispatchComposeEvent_=function(t,i,s){var e=this.getLayer();if(e.hasListener(t)){var r=s.viewState;var n=r.resolution;var h=s.pixelRatio;var a=s.extent;var o=r.center;var f=r.rotation;var u=s.size;var v=new pu(i,o,n,f,u,a,h);var l=new Wo(t,v,s,null,i);e.dispatchEvent(l)}};_u.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix};_u.prototype.getTexture=function(){return this.texture};_u.prototype.getProjectionMatrix=function(){return this.projectionMatrix};_u.prototype.handleWebGLContextLost=function(){this.texture=null;this.framebuffer=null;this.framebufferDimension=undefined};_u.prototype.prepareFrame=function(t,i,s){};_u.prototype.forEachLayerAtPixel=function(t,i,s,e){};var gu=function(t,i){_u.call(this,t,i);this.image_=null;this.hitCanvasContext_=null;this.hitTransformationMatrix_=null};kh.inherits(gu,_u);gu["handles"]=function(t,i){return t===no.WEBGL&&i.getType()===Fo.IMAGE};gu["create"]=function(t,i){return new gu(t,i)};gu.prototype.createTexture_=function(t){var i=t.getImage();var s=this.mapRenderer.getGL();return Qf.createTexture(s,i,_a.CLAMP_TO_EDGE,_a.CLAMP_TO_EDGE)};gu.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=this.getLayer();var h=n.getSource();var a=i.viewState.resolution;var o=i.viewState.rotation;var f=i.skippedFeatureUids;return h.forEachFeatureAtCoordinate(t,a,o,s,f,(function(t){return e.call(r,t,n)}))};gu.prototype.prepareFrame=function(t,i,s){var e=this.mapRenderer.getGL();var r=t.pixelRatio;var n=t.viewState;var h=n.center;var a=n.resolution;var o=n.rotation;var f=this.image_;var u=this.texture;var v=this.getLayer();var l=v.getSource();var c=t.viewHints;var d=t.extent;if(i.extent!==undefined){d=qh.getIntersection(d,i.extent)}if(!c[Ya.ANIMATING]&&!c[Ya.INTERACTING]&&!qh.isEmpty(d)){var m=n.projection;if(!kh.ENABLE_RASTER_REPROJECTION){var p=l.getProjection();if(p){m=p}}var M=l.getImage(d,a,r,m);if(M){var z=this.loadImage(M);if(z){f=M;u=this.createTexture_(M);if(this.texture){var _=function(t,i){if(!t.isContextLost()){t.deleteTexture(i)}}.bind(null,e,this.texture);t.postRenderFunctions.push(_)}}}}if(f){var g=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(g.width,g.height,r,h,a,o,f.getExtent());this.hitTransformationMatrix_=null;var w=this.texCoordMatrix;sa.reset(w);sa.scale(w,1,-1);sa.translate(w,0,-1);this.image_=f;this.texture=u;this.updateLogos(t,l)}return!!f};gu.prototype.updateProjectionMatrix_=function(t,i,s,e,r,n,h){var a=t*r;var o=i*r;var f=this.projectionMatrix;sa.reset(f);sa.scale(f,s*2/a,s*2/o);sa.rotate(f,-n);sa.translate(f,h[0]-e[0],h[1]-e[1]);sa.scale(f,(h[2]-h[0])/2,(h[3]-h[1])/2);sa.translate(f,1,1)};gu.prototype.hasFeatureAtCoordinate=function(t,i){var s=this.forEachFeatureAtCoordinate(t,i,0,Yh.TRUE,this);return s!==undefined};gu.prototype.forEachLayerAtPixel=function(t,i,s,e){if(!this.image_||!this.image_.getImage()){return undefined}if(this.getLayer().getSource().forEachFeatureAtCoordinate!==kh.nullFunction){var r=sa.apply(i.pixelToCoordinateTransform,t.slice());var n=this.forEachFeatureAtCoordinate(r,i,0,Yh.TRUE,this);if(n){return s.call(e,this.getLayer(),null)}else{return undefined}}else{var h=[this.image_.getImage().width,this.image_.getImage().height];if(!this.hitTransformationMatrix_){this.hitTransformationMatrix_=this.getHitTransformationMatrix_(i.size,h)}var a=sa.apply(this.hitTransformationMatrix_,t.slice());if(a[0]<0||a[0]>h[0]||a[1]<0||a[1]>h[1]){return undefined}if(!this.hitCanvasContext_){this.hitCanvasContext_=$a.createCanvasContext2D(1,1)}this.hitCanvasContext_.clearRect(0,0,1,1);this.hitCanvasContext_.drawImage(this.image_.getImage(),a[0],a[1],1,1,0,0,1,1);var o=this.hitCanvasContext_.getImageData(0,0,1,1).data;if(o[3]>0){return s.call(e,this.getLayer(),o)}else{return undefined}}};gu.prototype.getHitTransformationMatrix_=function(t,i){var s=sa.create();sa.translate(s,-1,-1);sa.scale(s,2/t[0],2/t[1]);sa.translate(s,0,t[1]);sa.scale(s,1,-1);var e=sa.invert(this.projectionMatrix.slice());var r=sa.create();sa.translate(r,0,i[1]);sa.scale(r,1,-1);sa.scale(r,i[0]/2,i[1]/2);sa.translate(r,1,1);sa.multiply(r,e);sa.multiply(r,s);return r};var wu=function(t,i){Qo.call(this,t,i);this.canvas_=document.createElement("CANVAS");this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=fo.CLASS_UNSELECTABLE;t.insertBefore(this.canvas_,t.childNodes[0]||null);this.clipTileCanvasWidth_=0;this.clipTileCanvasHeight_=0;this.clipTileContext_=$a.createCanvasContext2D();this.renderedVisible_=true;this.gl_=_a.getContext(this.canvas_,{antialias:true,depth:true,failIfMajorPerformanceCaveat:true,preserveDrawingBuffer:false,stencil:true});this.context_=new Qf(this.canvas_,this.gl_);Ih.listen(this.canvas_,$f.LOST,this.handleWebGLContextLost,this);Ih.listen(this.canvas_,$f.RESTORED,this.handleWebGLContextRestored,this);this.textureCache_=new jo;this.focus_=null;this.tileTextureQueue_=new ja(function(t){var i=t[1];var s=t[2];var e=i[0]-this.focus_[0];var r=i[1]-this.focus_[1];return 65536*Math.log(s)+Math.sqrt(e*e+r*r)/s}.bind(this),(function(t){return t[0].getKey()}));this.loadNextTileTexture_=function(t,i){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var s=this.tileTextureQueue_.dequeue();var e=s[0];var r=s[3];var n=s[4];this.bindTileTexture(e,r,n,_a.LINEAR,_a.LINEAR)}return false}.bind(this);this.textureCacheFrameMarkerCount_=0;this.initializeGL_()};kh.inherits(wu,Qo);wu["handles"]=function(t){return ga.WEBGL&&t===no.WEBGL};wu["create"]=function(t,i){return new wu(t,i)};wu.prototype.bindTileTexture=function(t,i,s,e,r){var n=this.getGL();var h=t.getKey();if(this.textureCache_.containsKey(h)){var a=this.textureCache_.get(h);n.bindTexture(_a.TEXTURE_2D,a.texture);if(a.magFilter!=e){n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_MAG_FILTER,e);a.magFilter=e}if(a.minFilter!=r){n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_MIN_FILTER,r);a.minFilter=r}}else{var o=n.createTexture();n.bindTexture(_a.TEXTURE_2D,o);if(s>0){var f=this.clipTileContext_.canvas;var u=this.clipTileContext_;if(this.clipTileCanvasWidth_!==i[0]||this.clipTileCanvasHeight_!==i[1]){f.width=i[0];f.height=i[1];this.clipTileCanvasWidth_=i[0];this.clipTileCanvasHeight_=i[1]}else{u.clearRect(0,0,i[0],i[1])}u.drawImage(t.getImage(),s,s,i[0],i[1],0,0,i[0],i[1]);n.texImage2D(_a.TEXTURE_2D,0,_a.RGBA,_a.RGBA,_a.UNSIGNED_BYTE,f)}else{n.texImage2D(_a.TEXTURE_2D,0,_a.RGBA,_a.RGBA,_a.UNSIGNED_BYTE,t.getImage())}n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_MAG_FILTER,e);n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_MIN_FILTER,r);n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_WRAP_S,_a.CLAMP_TO_EDGE);n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_WRAP_T,_a.CLAMP_TO_EDGE);this.textureCache_.set(h,{texture:o,magFilter:e,minFilter:r})}};wu.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();if(s.hasListener(t)){var e=this.context_;var r=i.extent;var n=i.size;var h=i.viewState;var a=i.pixelRatio;var o=h.resolution;var f=h.center;var u=h.rotation;var v=new pu(e,f,o,u,n,r,a);var l=new Wo(t,v,i,null,e);s.dispatchEvent(l)}};wu.prototype.disposeInternal=function(){var t=this.getGL();if(!t.isContextLost()){this.textureCache_.forEach((function(i){if(i){t.deleteTexture(i.texture)}}))}this.context_.dispose();Qo.prototype.disposeInternal.call(this)};wu.prototype.expireCache_=function(t,i){var s=this.getGL();var e;while(this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>kh.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK){e=this.textureCache_.peekLast();if(!e){if(+this.textureCache_.peekLastKey()==i.index){break}else{--this.textureCacheFrameMarkerCount_}}else{s.deleteTexture(e.texture)}this.textureCache_.pop()}};wu.prototype.getContext=function(){return this.context_};wu.prototype.getGL=function(){return this.gl_};wu.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_};wu.prototype.getType=function(){return no.WEBGL};wu.prototype.handleWebGLContextLost=function(t){t.preventDefault();this.textureCache_.clear();this.textureCacheFrameMarkerCount_=0;var i=this.getLayerRenderers();for(var s in i){var e=i[s];e.handleWebGLContextLost()}};wu.prototype.handleWebGLContextRestored=function(){this.initializeGL_();this.getMap().render()};wu.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(_a.TEXTURE0);t.blendFuncSeparate(_a.SRC_ALPHA,_a.ONE_MINUS_SRC_ALPHA,_a.ONE,_a.ONE_MINUS_SRC_ALPHA);t.disable(_a.CULL_FACE);t.disable(_a.DEPTH_TEST);t.disable(_a.SCISSOR_TEST);t.disable(_a.STENCIL_TEST)};wu.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())};wu.prototype.renderFrame=function(t){var i=this.getContext();var s=this.getGL();if(s.isContextLost()){return false}if(!t){if(this.renderedVisible_){this.canvas_.style.display="none";this.renderedVisible_=false}return false}this.focus_=t.focus;this.textureCache_.set((-t.index).toString(),null);++this.textureCacheFrameMarkerCount_;this.dispatchComposeEvent_(uo.PRECOMPOSE,t);var e=[];var r=t.layerStatesArray;jh.stableSort(r,Qo.sortByZIndex);var n=t.viewState.resolution;var h,a,o,f;for(h=0,a=r.length;h<a;++h){f=r[h];if(vo.visibleAtResolution(f,n)&&f.sourceState==io.READY){o=this.getLayerRenderer(f.layer);if(o.prepareFrame(t,f,i)){e.push(f)}}}var u=t.size[0]*t.pixelRatio;var v=t.size[1]*t.pixelRatio;if(this.canvas_.width!=u||this.canvas_.height!=v){this.canvas_.width=u;this.canvas_.height=v}s.bindFramebuffer(_a.FRAMEBUFFER,null);s.clearColor(0,0,0,0);s.clear(_a.COLOR_BUFFER_BIT);s.enable(_a.BLEND);s.viewport(0,0,this.canvas_.width,this.canvas_.height);for(h=0,a=e.length;h<a;++h){f=e[h];o=this.getLayerRenderer(f.layer);o.composeFrame(t,f,i)}if(!this.renderedVisible_){this.canvas_.style.display="";this.renderedVisible_=true}this.calculateMatrices2D(t);if(this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>kh.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK){t.postRenderFunctions.push(this.expireCache_.bind(this))}if(!this.tileTextureQueue_.isEmpty()){t.postRenderFunctions.push(this.loadNextTileTexture_);t.animate=true}this.dispatchComposeEvent_(uo.POSTCOMPOSE,t);this.scheduleRemoveUnusedLayerRenderers(t);this.scheduleExpireIconCache(t)};wu.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){var a;if(this.getGL().isContextLost()){return false}var o=i.viewState;var f=i.layerStatesArray;var u=f.length;var v;for(v=u-1;v>=0;--v){var l=f[v];var c=l.layer;if(vo.visibleAtResolution(l,o.resolution)&&n.call(h,c)){var d=this.getLayerRenderer(c);a=d.forEachFeatureAtCoordinate(t,i,s,e,r);if(a){return a}}}return undefined};wu.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r){var n=false;if(this.getGL().isContextLost()){return false}var h=i.viewState;var a=i.layerStatesArray;var o=a.length;var f;for(f=o-1;f>=0;--f){var u=a[f];var v=u.layer;if(vo.visibleAtResolution(u,h.resolution)&&e.call(r,v)){var l=this.getLayerRenderer(v);n=l.hasFeatureAtCoordinate(t,i);if(n){return true}}}return n};wu.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){if(this.getGL().isContextLost()){return false}var h=i.viewState;var a;var o=i.layerStatesArray;var f=o.length;var u;for(u=f-1;u>=0;--u){var v=o[u];var l=v.layer;if(vo.visibleAtResolution(v,h.resolution)&&r.call(e,l)){var c=this.getLayerRenderer(l);a=c.forEachLayerAtPixel(t,i,s,e);if(a){return a}}}return undefined};var yu={};yu.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n":"precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}");yu.vertex=new Vf(kh.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}");var bu=function(t,i){this.u_tileOffset=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_tileOffset":"d");this.u_texture=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_texture":"e");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"b");this.a_texCoord=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_texCoord":"c")};var xu=function(t,i){_u.call(this,t,i);this.fragmentShader_=yu.fragment;this.vertexShader_=yu.vertex;this.locations_=null;this.renderArrayBuffer_=new Hf([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]);this.renderedTileRange_=null;this.renderedFramebufferExtent_=null;this.renderedRevision_=-1;this.tmpSize_=[0,0]};kh.inherits(xu,_u);xu["handles"]=function(t,i){return t===no.WEBGL&&i.getType()===Fo.TILE};xu["create"]=function(t,i){return new xu(t,i)};xu.prototype.disposeInternal=function(){var t=this.mapRenderer.getContext();t.deleteBuffer(this.renderArrayBuffer_);_u.prototype.disposeInternal.call(this)};xu.prototype.createLoadedTileFinder=function(t,i,s){var e=this.mapRenderer;return function(r,n){function h(t){var i=e.isTileTextureLoaded(t);if(i){if(!s[r]){s[r]={}}s[r][t.tileCoord.toString()]=t}return i}return t.forEachLoadedTile(i,r,n,h)}};xu.prototype.handleWebGLContextLost=function(){_u.prototype.handleWebGLContextLost.call(this);this.locations_=null};xu.prototype.prepareFrame=function(t,i,s){var e=this.mapRenderer;var r=s.getGL();var n=t.viewState;var h=n.projection;var a=this.getLayer();var o=a.getSource();var f=o.getTileGridForProjection(h);var u=f.getZForResolution(n.resolution);var v=f.getResolution(u);var l=o.getTilePixelSize(u,t.pixelRatio,h);var c=l[0]/ho.toSize(f.getTileSize(u),this.tmpSize_)[0];var d=v/c;var m=o.getTilePixelRatio(c)*o.getGutter(h);var p=n.center;var M=t.extent;var z=f.getTileRangeForExtentAndZ(M,u);var _;if(this.renderedTileRange_&&this.renderedTileRange_.equals(z)&&this.renderedRevision_==o.getRevision()){_=this.renderedFramebufferExtent_}else{var g=z.getSize();var w=Math.max(g[0]*l[0],g[1]*l[1]);var y=Fh.roundUpToPowerOfTwo(w);var b=d*y;var x=f.getOrigin(u);var k=x[0]+z.minX*l[0]*d;var E=x[1]+z.minY*l[1]*d;_=[k,E,k+b,E+b];this.bindFramebuffer(t,y);r.viewport(0,0,y,y);r.clearColor(0,0,0,0);r.clear(_a.COLOR_BUFFER_BIT);r.disable(_a.BLEND);var N=s.getProgram(this.fragmentShader_,this.vertexShader_);s.useProgram(N);if(!this.locations_){this.locations_=new bu(r,N)}s.bindBuffer(_a.ARRAY_BUFFER,this.renderArrayBuffer_);r.enableVertexAttribArray(this.locations_.a_position);r.vertexAttribPointer(this.locations_.a_position,2,_a.FLOAT,false,16,0);r.enableVertexAttribArray(this.locations_.a_texCoord);r.vertexAttribPointer(this.locations_.a_texCoord,2,_a.FLOAT,false,16,8);r.uniform1i(this.locations_.u_texture,0);var C={};C[u]={};var I=this.createLoadedTileFinder(o,h,C);var S=a.getUseInterimTilesOnError();var O=true;var T=qh.createEmpty();var A=new sf(0,0,0,0);var R,P,L,D,F;var G,W,j;for(G=z.minX;G<=z.maxX;++G){for(W=z.minY;W<=z.maxY;++W){D=o.getTile(u,G,W,c,h);if(i.extent!==undefined){j=f.getTileCoordExtent(D.tileCoord,T);if(!qh.intersects(j,i.extent)){continue}}F=D.getState();P=F==Wa.LOADED||F==Wa.EMPTY||F==Wa.ERROR&&!S;if(!P){D=D.getInterimTile()}F=D.getState();if(F==Wa.LOADED){if(e.isTileTextureLoaded(D)){C[u][D.tileCoord.toString()]=D;continue}}else if(F==Wa.EMPTY||F==Wa.ERROR&&!S){continue}O=false;L=f.forEachTileCoordParentTileRange(D.tileCoord,I,null,A,T);if(!L){R=f.getTileCoordChildTileRange(D.tileCoord,A,T);if(R){I(u+1,R)}}}}var V=Object.keys(C).map(Number);V.sort(jh.numberSafeCompareFunction);var U=new Float32Array(4);var q,X,Y,B;for(q=0,X=V.length;q<X;++q){B=C[V[q]];for(Y in B){D=B[Y];j=f.getTileCoordExtent(D.tileCoord,T);U[0]=2*(j[2]-j[0])/b;U[1]=2*(j[3]-j[1])/b;U[2]=2*(j[0]-_[0])/b-1;U[3]=2*(j[1]-_[1])/b-1;r.uniform4fv(this.locations_.u_tileOffset,U);e.bindTileTexture(D,l,m*c,_a.LINEAR,_a.LINEAR);r.drawArrays(_a.TRIANGLE_STRIP,0,4)}}if(O){this.renderedTileRange_=z;this.renderedFramebufferExtent_=_;this.renderedRevision_=o.getRevision()}else{this.renderedTileRange_=null;this.renderedFramebufferExtent_=null;this.renderedRevision_=-1;t.animate=true}}this.updateUsedTiles(t.usedTiles,o,u,z);var H=e.getTileTextureQueue();this.manageTilePyramid(t,o,f,c,h,M,u,a.getPreload(),(function(t){if(t.getState()==Wa.LOADED&&!e.isTileTextureLoaded(t)&&!H.isKeyQueued(t.getKey())){H.enqueue([t,f.getTileCoordCenter(t.tileCoord),f.getResolution(t.tileCoord[0]),l,m*c])}}),this);this.scheduleExpireCache(t,o);this.updateLogos(t,o);var J=this.texCoordMatrix;sa.reset(J);sa.translate(J,(Math.round(p[0]/v)*v-_[0])/(_[2]-_[0]),(Math.round(p[1]/v)*v-_[1])/(_[3]-_[1]));if(n.rotation!==0){sa.rotate(J,n.rotation)}sa.scale(J,t.size[0]*n.resolution/(_[2]-_[0]),t.size[1]*n.resolution/(_[3]-_[1]));sa.translate(J,-.5,-.5);return true};xu.prototype.forEachLayerAtPixel=function(t,i,s,e){if(!this.framebuffer){return undefined}var r=[t[0]/i.size[0],(i.size[1]-t[1])/i.size[1]];var n=sa.apply(this.texCoordMatrix,r.slice());var h=[n[0]*this.framebufferDimension,n[1]*this.framebufferDimension];var a=this.mapRenderer.getContext().getGL();a.bindFramebuffer(a.FRAMEBUFFER,this.framebuffer);var o=new Uint8Array(4);a.readPixels(h[0],h[1],1,1,a.RGBA,a.UNSIGNED_BYTE,o);if(o[3]>0){return s.call(e,this.getLayer(),o)}else{return undefined}};var ku=function(t,i){_u.call(this,t,i);this.dirty_=false;this.renderedRevision_=-1;this.renderedResolution_=NaN;this.renderedExtent_=qh.createEmpty();this.renderedRenderOrder_=null;this.replayGroup_=null;this.layerState_=null};kh.inherits(ku,_u);ku["handles"]=function(t,i){return t===no.WEBGL&&i.getType()===Fo.VECTOR};ku["create"]=function(t,i){return new ku(t,i)};ku.prototype.composeFrame=function(t,i,s){this.layerState_=i;var e=t.viewState;var r=this.replayGroup_;var n=t.size;var h=t.pixelRatio;var a=this.mapRenderer.getGL();if(r&&!r.isEmpty()){a.enable(a.SCISSOR_TEST);a.scissor(0,0,n[0]*h,n[1]*h);r.replay(s,e.center,e.resolution,e.rotation,n,h,i.opacity,i.managed?t.skippedFeatureUids:{});a.disable(a.SCISSOR_TEST)}};ku.prototype.disposeInternal=function(){var t=this.replayGroup_;if(t){var i=this.mapRenderer.getContext();t.getDeleteResourcesFunction(i)();this.replayGroup_=null}_u.prototype.disposeInternal.call(this)};ku.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(!this.replayGroup_||!this.layerState_){return undefined}else{var n=this.mapRenderer.getContext();var h=i.viewState;var a=this.getLayer();var o=this.layerState_;var f={};return this.replayGroup_.forEachFeatureAtCoordinate(t,n,h.center,h.resolution,h.rotation,i.size,i.pixelRatio,o.opacity,{},(function(t){var i=kh.getUid(t).toString();if(!(i in f)){f[i]=true;return e.call(r,t,a)}}))}};ku.prototype.hasFeatureAtCoordinate=function(t,i){if(!this.replayGroup_||!this.layerState_){return false}else{var s=this.mapRenderer.getContext();var e=i.viewState;var r=this.layerState_;return this.replayGroup_.hasFeatureAtCoordinate(t,s,e.center,e.resolution,e.rotation,i.size,i.pixelRatio,r.opacity,i.skippedFeatureUids)}};ku.prototype.forEachLayerAtPixel=function(t,i,s,e){var r=sa.apply(i.pixelToCoordinateTransform,t.slice());var n=this.hasFeatureAtCoordinate(r,i);if(n){return s.call(e,this.getLayer(),null)}else{return undefined}};ku.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};ku.prototype.prepareFrame=function(t,i,s){var e=this.getLayer();var r=e.getSource();this.updateLogos(t,r);var n=t.viewHints[Ya.ANIMATING];var h=t.viewHints[Ya.INTERACTING];var a=e.getUpdateWhileAnimating();var o=e.getUpdateWhileInteracting();if(!this.dirty_&&(!a&&n)||!o&&h){return true}var f=t.extent;var u=t.viewState;var v=u.projection;var l=u.resolution;var c=t.pixelRatio;var d=e.getRevision();var m=e.getRenderBuffer();var p=e.getRenderOrder();if(p===undefined){p=Lf.defaultOrder}var M=qh.buffer(f,m*l);if(!this.dirty_&&this.renderedResolution_==l&&this.renderedRevision_==d&&this.renderedRenderOrder_==p&&qh.containsExtent(this.renderedExtent_,M)){return true}if(this.replayGroup_){t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(s))}this.dirty_=false;var z=new mu(Lf.getTolerance(l,c),M,e.getRenderBuffer());r.loadFeatures(M,l,v);var _=function(t){var i;var s=t.getStyleFunction();if(s){i=s.call(t,l)}else{s=e.getStyleFunction();if(s){i=s(t,l)}}if(i){var r=this.renderFeature(t,l,c,i,z);this.dirty_=this.dirty_||r}};if(p){var g=[];r.forEachFeatureInExtent(M,(function(t){g.push(t)}),this);g.sort(p);g.forEach(_,this)}else{r.forEachFeatureInExtent(M,_,this)}z.finish(s);this.renderedResolution_=l;this.renderedRevision_=d;this.renderedRenderOrder_=p;this.renderedExtent_=M;this.replayGroup_=z;return true};ku.prototype.renderFeature=function(t,i,s,e,r){if(!e){return false}var n=false;if(Array.isArray(e)){for(var h=e.length-1,a=0;h>=a;--h){n=Lf.renderFeature(r,t,e[h],Lf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}}else{n=Lf.renderFeature(r,t,e,Lf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}return n};if(kh.ENABLE_CANVAS){ro.register(eo.MAP_RENDERER,tf);ro.registerMultiple(eo.LAYER_RENDERER,[Zo,ef,Df,Gf])}if(kh.ENABLE_WEBGL){ro.register(eo.MAP_RENDERER,wu);ro.registerMultiple(eo.LAYER_RENDERER,[gu,xu,ku])}var Eu=function(t){t=Ch.assign({},t);if(!t.controls){t.controls=po.defaults()}if(!t.interactions){t.interactions=Ro.defaults()}ao.call(this,t)};kh.inherits(Eu,ao);var Nu={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"};var Cu=function(t){Ph.call(this);this.options=t;this.id=t.id;this.insertFirst=t.insertFirst!==undefined?t.insertFirst:true;this.stopEvent=t.stopEvent!==undefined?t.stopEvent:true;this.element=document.createElement("DIV");this.element.className=t.className!==undefined?t.className:"ol-overlay-container "+fo.CLASS_SELECTABLE;this.element.style.position="absolute";this.autoPan=t.autoPan!==undefined?t.autoPan:false;this.autoPanAnimation=t.autoPanAnimation||{};this.autoPanMargin=t.autoPanMargin!==undefined?t.autoPanMargin:20;this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:true};this.mapPostrenderListenerKey=null;Ih.listen(this,Ph.getChangeEventType(Cu.Property.ELEMENT),this.handleElementChanged,this);Ih.listen(this,Ph.getChangeEventType(Cu.Property.MAP),this.handleMapChanged,this);Ih.listen(this,Ph.getChangeEventType(Cu.Property.OFFSET),this.handleOffsetChanged,this);Ih.listen(this,Ph.getChangeEventType(Cu.Property.POSITION),this.handlePositionChanged,this);Ih.listen(this,Ph.getChangeEventType(Cu.Property.POSITIONING),this.handlePositioningChanged,this);if(t.element!==undefined){this.setElement(t.element)}this.setOffset(t.offset!==undefined?t.offset:[0,0]);this.setPositioning(t.positioning!==undefined?t.positioning:Nu.TOP_LEFT);if(t.position!==undefined){this.setPosition(t.position)}};kh.inherits(Cu,Ph);Cu.prototype.getElement=function(){return this.get(Cu.Property.ELEMENT)};Cu.prototype.getId=function(){return this.id};Cu.prototype.getMap=function(){return this.get(Cu.Property.MAP)};Cu.prototype.getOffset=function(){return this.get(Cu.Property.OFFSET)};Cu.prototype.getPosition=function(){return this.get(Cu.Property.POSITION)};Cu.prototype.getPositioning=function(){return this.get(Cu.Property.POSITIONING)};Cu.prototype.handleElementChanged=function(){$a.removeChildren(this.element);var t=this.getElement();if(t){this.element.appendChild(t)}};Cu.prototype.handleMapChanged=function(){if(this.mapPostrenderListenerKey){$a.removeNode(this.element);Ih.unlistenByKey(this.mapPostrenderListenerKey);this.mapPostrenderListenerKey=null}var t=this.getMap();if(t){this.mapPostrenderListenerKey=Ih.listen(t,Fa.POSTRENDER,this.render,this);this.updatePixelPosition();var i=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();if(this.insertFirst){i.insertBefore(this.element,i.childNodes[0]||null)}else{i.appendChild(this.element)}}};Cu.prototype.render=function(){this.updatePixelPosition()};Cu.prototype.handleOffsetChanged=function(){this.updatePixelPosition()};Cu.prototype.handlePositionChanged=function(){this.updatePixelPosition();if(this.get(Cu.Property.POSITION)&&this.autoPan){this.panIntoView()}};Cu.prototype.handlePositioningChanged=function(){this.updatePixelPosition()};Cu.prototype.setElement=function(t){this.set(Cu.Property.ELEMENT,t)};Cu.prototype.setMap=function(t){this.set(Cu.Property.MAP,t)};Cu.prototype.setOffset=function(t){this.set(Cu.Property.OFFSET,t)};Cu.prototype.setPosition=function(t){this.set(Cu.Property.POSITION,t)};Cu.prototype.panIntoView=function(){var t=this.getMap();if(!t||!t.getTargetElement()){return}var i=this.getRect(t.getTargetElement(),t.getSize());var s=this.getElement();var e=this.getRect(s,[$a.outerWidth(s),$a.outerHeight(s)]);var r=this.autoPanMargin;if(!qh.containsExtent(i,e)){var n=e[0]-i[0];var h=i[2]-e[2];var a=e[1]-i[1];var o=i[3]-e[3];var f=[0,0];if(n<0){f[0]=n-r}else if(h<0){f[0]=Math.abs(h)+r}if(a<0){f[1]=a-r}else if(o<0){f[1]=Math.abs(o)+r}if(f[0]!==0||f[1]!==0){var u=t.getView().getCenter();var v=t.getPixelFromCoordinate(u);var l=[v[0]+f[0],v[1]+f[1]];t.getView().animate({center:t.getCoordinateFromPixel(l),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}};Cu.prototype.getRect=function(t,i){var s=t.getBoundingClientRect();var e=s.left+window.pageXOffset;var r=s.top+window.pageYOffset;return[e,r,e+i[0],r+i[1]]};Cu.prototype.setPositioning=function(t){this.set(Cu.Property.POSITIONING,t)};Cu.prototype.setVisible=function(t){if(this.rendered.visible!==t){this.element.style.display=t?"":"none";this.rendered.visible=t}};Cu.prototype.updatePixelPosition=function(){var t=this.getMap();var i=this.getPosition();if(!t||!t.isRendered()||!i){this.setVisible(false);return}var s=t.getPixelFromCoordinate(i);var e=t.getSize();this.updateRenderedPosition(s,e)};Cu.prototype.updateRenderedPosition=function(t,i){var s=this.element.style;var e=this.getOffset();var r=this.getPositioning();this.setVisible(true);var n=e[0];var h=e[1];if(r==Nu.BOTTOM_RIGHT||r==Nu.CENTER_RIGHT||r==Nu.TOP_RIGHT){if(this.rendered.left_!==""){this.rendered.left_=s.left=""}var a=Math.round(i[0]-t[0]-n)+"px";if(this.rendered.right_!=a){this.rendered.right_=s.right=a}}else{if(this.rendered.right_!==""){this.rendered.right_=s.right=""}if(r==Nu.BOTTOM_CENTER||r==Nu.CENTER_CENTER||r==Nu.TOP_CENTER){n-=this.element.offsetWidth/2}var o=Math.round(t[0]+n)+"px";if(this.rendered.left_!=o){this.rendered.left_=s.left=o}}if(r==Nu.BOTTOM_LEFT||r==Nu.BOTTOM_CENTER||r==Nu.BOTTOM_RIGHT){if(this.rendered.top_!==""){this.rendered.top_=s.top=""}var f=Math.round(i[1]-t[1]-h)+"px";if(this.rendered.bottom_!=f){this.rendered.bottom_=s.bottom=f}}else{if(this.rendered.bottom_!==""){this.rendered.bottom_=s.bottom=""}if(r==Nu.CENTER_LEFT||r==Nu.CENTER_CENTER||r==Nu.CENTER_RIGHT){h-=this.element.offsetHeight/2}var u=Math.round(t[1]+h)+"px";if(this.rendered.top_!=u){this.rendered.top_=s.top=u}}};Cu.prototype.getOptions=function(){return this.options};Cu.Property={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};var Iu=function(t){this.opacity_=t.opacity;this.rotateWithView_=t.rotateWithView;this.rotation_=t.rotation;this.scale_=t.scale;this.snapToPixel_=t.snapToPixel};Iu.prototype.getOpacity=function(){return this.opacity_};Iu.prototype.getRotateWithView=function(){return this.rotateWithView_};Iu.prototype.getRotation=function(){return this.rotation_};Iu.prototype.getScale=function(){return this.scale_};Iu.prototype.getSnapToPixel=function(){return this.snapToPixel_};Iu.prototype.getAnchor=function(){};Iu.prototype.getImage=function(t){};Iu.prototype.getHitDetectionImage=function(t){};Iu.prototype.getImageState=function(){};Iu.prototype.getImageSize=function(){};Iu.prototype.getHitDetectionImageSize=function(){};Iu.prototype.getOrigin=function(){};Iu.prototype.getSize=function(){};Iu.prototype.setOpacity=function(t){this.opacity_=t};Iu.prototype.setRotateWithView=function(t){this.rotateWithView_=t};Iu.prototype.setRotation=function(t){this.rotation_=t};Iu.prototype.setScale=function(t){this.scale_=t};Iu.prototype.setSnapToPixel=function(t){this.snapToPixel_=t};Iu.prototype.listenImageChange=function(t,i){};Iu.prototype.load=function(){};Iu.prototype.unlistenImageChange=function(t,i){};var Su=function(t){this.checksums_=null;this.canvas_=null;this.hitDetectionCanvas_=null;this.fill_=t.fill!==undefined?t.fill:null;this.origin_=[0,0];this.points_=t.points;this.radius_=t.radius!==undefined?t.radius:t.radius1;this.radius2_=t.radius2;this.angle_=t.angle!==undefined?t.angle:0;this.stroke_=t.stroke!==undefined?t.stroke:null;this.anchor_=null;this.size_=null;this.imageSize_=null;this.hitDetectionImageSize_=null;this.atlasManager_=t.atlasManager;this.render_(this.atlasManager_);var i=t.snapToPixel!==undefined?t.snapToPixel:true;var s=t.rotateWithView!==undefined?t.rotateWithView:false;Iu.call(this,{opacity:1,rotateWithView:s,rotation:t.rotation!==undefined?t.rotation:0,scale:1,snapToPixel:i})};kh.inherits(Su,Iu);Su.prototype.clone=function(){var t=new Su({fill:this.getFill()?this.getFill().clone():undefined,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():undefined,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});t.setOpacity(this.getOpacity());t.setScale(this.getScale());return t};Su.prototype.getAnchor=function(){return this.anchor_};Su.prototype.getAngle=function(){return this.angle_};Su.prototype.getFill=function(){return this.fill_};Su.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_};Su.prototype.getImage=function(t){return this.canvas_};Su.prototype.getImageSize=function(){return this.imageSize_};Su.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_};Su.prototype.getImageState=function(){return Lo.LOADED};Su.prototype.getOrigin=function(){return this.origin_};Su.prototype.getPoints=function(){return this.points_};Su.prototype.getRadius=function(){return this.radius_};Su.prototype.getRadius2=function(){return this.radius2_};Su.prototype.getSize=function(){return this.size_};Su.prototype.getStroke=function(){return this.stroke_};Su.prototype.listenImageChange=function(t,i){};Su.prototype.load=function(){};Su.prototype.unlistenImageChange=function(t,i){};Su.prototype.render_=function(t){var i;var s="";var e="";var r=0;var n=null;var h=0;var a;var o=0;if(this.stroke_){a=this.stroke_.getColor();if(a===null){a=Vo.defaultStrokeStyle}a=qo.asColorLike(a);o=this.stroke_.getWidth();if(o===undefined){o=Vo.defaultLineWidth}n=this.stroke_.getLineDash();h=this.stroke_.getLineDashOffset();if(!ga.CANVAS_LINE_DASH){n=null;h=0}e=this.stroke_.getLineJoin();if(e===undefined){e=Vo.defaultLineJoin}s=this.stroke_.getLineCap();if(s===undefined){s=Vo.defaultLineCap}r=this.stroke_.getMiterLimit();if(r===undefined){r=Vo.defaultMiterLimit}}var f=2*(this.radius_+o)+1;var u={strokeStyle:a,strokeWidth:o,size:f,lineCap:s,lineDash:n,lineDashOffset:h,lineJoin:e,miterLimit:r};if(t===undefined){var v=$a.createCanvasContext2D(f,f);this.canvas_=v.canvas;f=this.canvas_.width;i=f;this.draw_(u,v,0,0);this.createHitDetectionCanvas_(u)}else{f=Math.round(f);var l=!this.fill_;var c;if(l){c=this.drawHitDetectionCanvas_.bind(this,u)}var d=this.getChecksum();var m=t.add(d,f,f,this.draw_.bind(this,u),c);this.canvas_=m.image;this.origin_=[m.offsetX,m.offsetY];i=m.image.width;if(l){this.hitDetectionCanvas_=m.hitImage;this.hitDetectionImageSize_=[m.hitImage.width,m.hitImage.height]}else{this.hitDetectionCanvas_=this.canvas_;this.hitDetectionImageSize_=[i,i]}}this.anchor_=[f/2,f/2];this.size_=[f,f];this.imageSize_=[i,i]};Su.prototype.draw_=function(t,i,s,e){var r,n,h;i.setTransform(1,0,0,1,0,0);i.translate(s,e);i.beginPath();var a=this.points_;if(a===Infinity){i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,true)}else{var o=this.radius2_!==undefined?this.radius2_:this.radius_;if(o!==this.radius_){a=2*a}for(r=0;r<=a;r++){n=r*2*Math.PI/a-Math.PI/2+this.angle_;h=r%2===0?this.radius_:o;i.lineTo(t.size/2+h*Math.cos(n),t.size/2+h*Math.sin(n))}}if(this.fill_){var f=this.fill_.getColor();if(f===null){f=Vo.defaultFillStyle}i.fillStyle=qo.asColorLike(f);i.fill()}if(this.stroke_){i.strokeStyle=t.strokeStyle;i.lineWidth=t.strokeWidth;if(t.lineDash){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.lineCap=t.lineCap;i.lineJoin=t.lineJoin;i.miterLimit=t.miterLimit;i.stroke()}i.closePath()};Su.prototype.createHitDetectionCanvas_=function(t){this.hitDetectionImageSize_=[t.size,t.size];if(this.fill_){this.hitDetectionCanvas_=this.canvas_;return}var i=$a.createCanvasContext2D(t.size,t.size);this.hitDetectionCanvas_=i.canvas;this.drawHitDetectionCanvas_(t,i,0,0)};Su.prototype.drawHitDetectionCanvas_=function(t,i,s,e){i.setTransform(1,0,0,1,0,0);i.translate(s,e);i.beginPath();var r=this.points_;if(r===Infinity){i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,true)}else{var n=this.radius2_!==undefined?this.radius2_:this.radius_;if(n!==this.radius_){r=2*r}var h,a,o;for(h=0;h<=r;h++){o=h*2*Math.PI/r-Math.PI/2+this.angle_;a=h%2===0?this.radius_:n;i.lineTo(t.size/2+a*Math.cos(o),t.size/2+a*Math.sin(o))}}i.fillStyle=Vo.defaultFillStyle;i.fill();if(this.stroke_){i.strokeStyle=t.strokeStyle;i.lineWidth=t.strokeWidth;if(t.lineDash){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.stroke()}i.closePath()};Su.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-";var i=this.fill_?this.fill_.getChecksum():"-";var s=!this.checksums_||(t!=this.checksums_[1]||i!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]);if(s){var e="r"+t+i+(this.radius_!==undefined?this.radius_.toString():"-")+(this.radius2_!==undefined?this.radius2_.toString():"-")+(this.angle_!==undefined?this.angle_.toString():"-")+(this.points_!==undefined?this.points_.toString():"-");this.checksums_=[e,t,i,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]};var Ou=function(t){var i=t||{};Su.call(this,{points:Infinity,fill:i.fill,radius:i.radius,snapToPixel:i.snapToPixel,stroke:i.stroke,atlasManager:i.atlasManager})};kh.inherits(Ou,Su);Ou.prototype.clone=function(){var t=new Ou({fill:this.getFill()?this.getFill().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});t.setOpacity(this.getOpacity());t.setScale(this.getScale());return t};Ou.prototype.setRadius=function(t){this.radius_=t;this.render_(this.atlasManager_)};var Tu=function(t){var i=t||{};this.color_=i.color!==undefined?i.color:null;this.checksum_=undefined};Tu.prototype.clone=function(){var t=this.getColor();return new Tu({color:t&&t.slice?t.slice():t||undefined})};Tu.prototype.getColor=function(){return this.color_};Tu.prototype.setColor=function(t){this.color_=t;this.checksum_=undefined};Tu.prototype.getChecksum=function(){if(this.checksum_===undefined){if(this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient){this.checksum_=kh.getUid(this.color_).toString()}else{this.checksum_="f"+(this.color_?Uo.asString(this.color_):"-")}}return this.checksum_};var Au=function(t){var i=t||{};this.geometry_=null;this.geometryFunction_=Au.defaultGeometryFunction;if(i.geometry!==undefined){this.setGeometry(i.geometry)}this.fill_=i.fill!==undefined?i.fill:null;this.image_=i.image!==undefined?i.image:null;this.renderer_=i.renderer!==undefined?i.renderer:null;this.stroke_=i.stroke!==undefined?i.stroke:null;this.text_=i.text!==undefined?i.text:null;this.zIndex_=i.zIndex};Au.prototype.clone=function(){var t=this.getGeometry();if(t&&t.clone){t=t.clone()}return new Au({geometry:t,fill:this.getFill()?this.getFill().clone():undefined,image:this.getImage()?this.getImage().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,text:this.getText()?this.getText().clone():undefined,zIndex:this.getZIndex()})};Au.prototype.getRenderer=function(){return this.renderer_};Au.prototype.setRenderer=function(t){this.renderer_=t};Au.prototype.getGeometry=function(){return this.geometry_};Au.prototype.getGeometryFunction=function(){return this.geometryFunction_};Au.prototype.getFill=function(){return this.fill_};Au.prototype.setFill=function(t){this.fill_=t};Au.prototype.getImage=function(){return this.image_};Au.prototype.setImage=function(t){this.image_=t};Au.prototype.getStroke=function(){return this.stroke_};Au.prototype.setStroke=function(t){this.stroke_=t};Au.prototype.getText=function(){return this.text_};Au.prototype.setText=function(t){this.text_=t};Au.prototype.getZIndex=function(){return this.zIndex_};Au.prototype.setGeometry=function(t){if(typeof t==="function"){this.geometryFunction_=t}else if(typeof t==="string"){this.geometryFunction_=function(i){return i.get(t)}}else if(!t){this.geometryFunction_=Au.defaultGeometryFunction}else if(t!==undefined){this.geometryFunction_=function(){return t}}this.geometry_=t};Au.prototype.setZIndex=function(t){this.zIndex_=t};Au.createFunction=function(t){var i;if(typeof t==="function"){i=t}else{var s;if(Array.isArray(t)){s=t}else{Dh.assert(t instanceof Au,41);s=[t]}i=function(){return s}}return i};Au.default_=null;Au.defaultFunction=function(t,i){if(!Au.default_){var s=new Tu({color:"rgba(255,255,255,0.4)"});var e=new ou({color:"#3399CC",width:1.25});Au.default_=[new Au({image:new Ou({fill:s,stroke:e,radius:5}),fill:s,stroke:e})]}return Au.default_};Au.createDefaultEditing=function(){var t={};var i=[255,255,255,1];var s=[0,153,255,1];var e=3;t[Gh.POLYGON]=[new Au({fill:new Tu({color:[255,255,255,.5]})})];t[Gh.MULTI_POLYGON]=t[Gh.POLYGON];t[Gh.LINE_STRING]=[new Au({stroke:new ou({color:i,width:e+2})}),new Au({stroke:new ou({color:s,width:e})})];t[Gh.MULTI_LINE_STRING]=t[Gh.LINE_STRING];t[Gh.CIRCLE]=t[Gh.POLYGON].concat(t[Gh.LINE_STRING]);t[Gh.POINT]=[new Au({image:new Ou({radius:e*2,fill:new Tu({color:s}),stroke:new ou({color:i,width:e/2})}),zIndex:Infinity})];t[Gh.MULTI_POINT]=t[Gh.POINT];t[Gh.GEOMETRY_COLLECTION]=t[Gh.POLYGON].concat(t[Gh.LINE_STRING],t[Gh.POINT]);return t};Au.defaultGeometryFunction=function(t){return t.getGeometry()};var Ru=function(t){Ph.call(this);this.id_=undefined;this.geometryName_="geometry";this.style_=null;this.styleFunction_=undefined;this.geometryChangeKey_=null;Ih.listen(this,Ph.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);if(t!==undefined){if(t instanceof ea||!t){var i=t;this.setGeometry(i)}else{var s=t;this.setProperties(s)}}};kh.inherits(Ru,Ph);Ru.prototype.clone=function(){var t=new Ru(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();if(i){t.setGeometry(i.clone())}var s=this.getStyle();if(s){t.setStyle(s)}return t};Ru.prototype.getGeometry=function(){return this.get(this.geometryName_)};Ru.prototype.getId=function(){return this.id_};Ru.prototype.getGeometryName=function(){return this.geometryName_};Ru.prototype.getStyle=function(){return this.style_};Ru.prototype.getStyleFunction=function(){return this.styleFunction_};Ru.prototype.handleGeometryChange_=function(){this.changed()};Ru.prototype.handleGeometryChanged_=function(){if(this.geometryChangeKey_){Ih.unlistenByKey(this.geometryChangeKey_);this.geometryChangeKey_=null}var t=this.getGeometry();if(t){this.geometryChangeKey_=Ih.listen(t,Ah.CHANGE,this.handleGeometryChange_,this)}this.changed()};Ru.prototype.setGeometry=function(t){this.set(this.geometryName_,t)};Ru.prototype.setStyle=function(t){this.style_=t;this.styleFunction_=!t?undefined:Ru.createStyleFunction(t);this.changed()};Ru.prototype.setId=function(t){this.id_=t;this.changed()};Ru.prototype.setGeometryName=function(t){Ih.unlisten(this,Ph.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);this.geometryName_=t;Ih.listen(this,Ph.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);this.handleGeometryChanged_()};Ru.createStyleFunction=function(t){var i;if(typeof t==="function"){if(t.length==2){i=function(i){return t(this,i)}}else{i=t}}else{var s;if(Array.isArray(t)){s=t}else{Dh.assert(t instanceof Au,41);s=[t]}i=function(){return s}}return i};var Pu={};Pu.createOrUpdate=function(t,i,s,e){if(e!==undefined){e[0]=t;e[1]=i;e[2]=s;return e}else{return[t,i,s]}};Pu.getKeyZXY=function(t,i,s){return t+"/"+i+"/"+s};Pu.getKey=function(t){return Pu.getKeyZXY(t[0],t[1],t[2])};Pu.fromKey=function(t){return t.split("/").map(Number)};Pu.hash=function(t){return(t[1]<<t[0])+t[2]};Pu.quadKey=function(t){var i=t[0];var s=new Array(i);var e=1<<i-1;var r,n;for(r=0;r<i;++r){n=48;if(t[1]&e){n+=1}if(t[2]&e){n+=2}s[r]=String.fromCharCode(n);e>>=1}return s.join("")};Pu.withinExtentAndZ=function(t,i){var s=t[0];var e=t[1];var r=t[2];if(i.getMinZoom()>s||s>i.getMaxZoom()){return false}var n=i.getExtent();var h;if(!n){h=i.getFullTileRange(s)}else{h=i.getTileRangeForExtentAndZ(n,s)}if(!h){return true}else{return h.containsXY(e,r)}};var Lu={};Lu.createFromTemplate=function(t,i){var s=/\{z\}/g;var e=/\{x\}/g;var r=/\{y\}/g;var n=/\{-y\}/g;return function(h,a,o){if(!h){return undefined}else{return t.replace(s,h[0].toString()).replace(e,h[1].toString()).replace(r,(function(){var t=-h[2]-1;return t.toString()})).replace(n,(function(){var t=h[0];var s=i.getFullTileRange(t);Dh.assert(s,55);var e=s.getHeight()+h[2];return e.toString()}))}}};Lu.createFromTemplates=function(t,i){var s=t.length;var e=new Array(s);for(var r=0;r<s;++r){e[r]=Lu.createFromTemplate(t[r],i)}return Lu.createFromTileUrlFunctions(e)};Lu.createFromTileUrlFunctions=function(t){if(t.length===1){return t[0]}return function(i,s,e){if(!i){return undefined}else{var r=Pu.hash(i);var n=Fh.modulo(r,t.length);return t[n](i,s,e)}}};Lu.nullTileUrlFunction=function(t,i,s){return undefined};Lu.expandUrl=function(t){var i=[];var s=/\{([a-z])-([a-z])\}/.exec(t);if(s){var e=s[1].charCodeAt(0);var r=s[2].charCodeAt(0);var n;for(n=e;n<=r;++n){i.push(t.replace(s[0],String.fromCharCode(n)))}return i}s=s=/\{(\d+)-(\d+)\}/.exec(t);if(s){var h=parseInt(s[2],10);for(var a=parseInt(s[1],10);a<=h;a++){i.push(t.replace(s[0],a.toString()))}return i}i.push(t);return i};var Du=function(t,i,s){Th.call(this);var e=s?s:{};this.tileCoord=t;this.state=i;this.interimTile=null;this.key="";this.transition_=e.transition===undefined?250:e.transition;this.transitionStarts_={}};kh.inherits(Du,Th);Du.prototype.changed=function(){this.dispatchEvent(Ah.CHANGE)};Du.prototype.getKey=function(){return this.key+"/"+this.tileCoord};Du.prototype.getInterimTile=function(){if(!this.interimTile){return this}var t=this.interimTile;do{if(t.getState()==Wa.LOADED){return t}t=t.interimTile}while(t);return this};Du.prototype.refreshInterimChain=function(){if(!this.interimTile){return}var t=this.interimTile;var i=this;do{if(t.getState()==Wa.LOADED){t.interimTile=null;break}else if(t.getState()==Wa.LOADING){i=t}else if(t.getState()==Wa.IDLE){i.interimTile=t.interimTile}else{i=t}t=i.interimTile}while(t)};Du.prototype.getTileCoord=function(){return this.tileCoord};Du.prototype.getState=function(){return this.state};Du.prototype.setState=function(t){this.state=t;this.changed()};Du.prototype.load=function(){};Du.prototype.getAlpha=function(t,i){if(!this.transition_){return 1}var s=this.transitionStarts_[t];if(!s){s=i;this.transitionStarts_[t]=s}else if(s===-1){return 1}var e=i-s+1e3/60;if(e>=this.transition_){return 1}return Za.easeIn(e/this.transition_)};Du.prototype.inTransition=function(t){if(!this.transition_){return false}return this.transitionStarts_[t]!==-1};Du.prototype.endTransition=function(t){if(this.transition_){this.transitionStarts_[t]=-1}};var Fu=function(t,i,s,e,r,n){Du.call(this,t,i,n);this.crossOrigin_=e;this.src_=s;this.image_=new Image;if(e!==null){this.image_.crossOrigin=e}this.imageListenerKeys_=null;this.tileLoadFunction_=r};kh.inherits(Fu,Du);Fu.prototype.disposeInternal=function(){if(this.state==Wa.LOADING){this.unlistenImage_();this.image_=Fu.getBlankImage()}if(this.interimTile){this.interimTile.dispose()}this.state=Wa.ABORT;this.changed();Du.prototype.disposeInternal.call(this)};Fu.prototype.getImage=function(){return this.image_};Fu.prototype.getKey=function(){return this.src_};Fu.prototype.handleImageError_=function(){this.state=Wa.ERROR;this.unlistenImage_();this.image_=Fu.getBlankImage();this.changed()};Fu.prototype.handleImageLoad_=function(){if(this.image_.naturalWidth&&this.image_.naturalHeight){this.state=Wa.LOADED}else{this.state=Wa.EMPTY}this.unlistenImage_();this.changed()};Fu.prototype.load=function(){if(this.state==Wa.ERROR){this.state=Wa.IDLE;this.image_=new Image;if(this.crossOrigin_!==null){this.image_.crossOrigin=this.crossOrigin_}}if(this.state==Wa.IDLE){this.state=Wa.LOADING;this.changed();this.imageListenerKeys_=[Ih.listenOnce(this.image_,Ah.ERROR,this.handleImageError_,this),Ih.listenOnce(this.image_,Ah.LOAD,this.handleImageLoad_,this)];this.tileLoadFunction_(this,this.src_)}};Fu.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ih.unlistenByKey);this.imageListenerKeys_=null};Fu.getBlankImage=function(){var t=$a.createCanvasContext2D(1,1);t.fillStyle="rgba(0,0,0,0)";t.fillRect(0,0,1,1);return t.canvas};var Gu=function(t){jo.call(this,t)};kh.inherits(Gu,jo);Gu.prototype.expireCache=function(t){var i,s;while(this.canExpireCache()){i=this.peekLast();s=i.tileCoord[0].toString();if(s in t&&t[s].contains(i.tileCoord)){break}else{this.pop().dispose()}}};Gu.prototype.pruneExceptNewestZ=function(){if(this.getCount()===0){return}var t=this.peekFirstKey();var i=Pu.fromKey(t);var s=i[0];this.forEach((function(t){if(t.tileCoord[0]!==s){this.remove(Pu.getKey(t.tileCoord));t.dispose()}}),this)};var Wu={};Wu.calculateSourceResolution=function(t,i,s,e){var r=ia.transform(s,i,t);var n=ia.getPointResolution(i,e,s);var h=i.getMetersPerUnit();if(h!==undefined){n*=h}var a=t.getMetersPerUnit();if(a!==undefined){n/=a}var o=t.getExtent();if(!o||qh.containsCoordinate(o,r)){var f=ia.getPointResolution(t,n,r)/n;if(isFinite(f)&&f>0){n/=f}}return n};Wu.enlargeClipPoint_=function(t,i,s,e){var r=s-t,n=e-i;var h=Math.sqrt(r*r+n*n);return[Math.round(s+r/h),Math.round(e+n/h)]};Wu.render=function(t,i,s,e,r,n,h,a,o,f,u){var v=$a.createCanvasContext2D(Math.round(s*t),Math.round(s*i));if(o.length===0){return v.canvas}v.scale(s,s);var l=qh.createEmpty();o.forEach((function(t,i,s){qh.extend(l,t.extent)}));var c=qh.getWidth(l);var d=qh.getHeight(l);var m=$a.createCanvasContext2D(Math.round(s*c/e),Math.round(s*d/e));var p=s/e;o.forEach((function(t,i,s){var e=t.extent[0]-l[0];var r=-(t.extent[3]-l[3]);var n=qh.getWidth(t.extent);var h=qh.getHeight(t.extent);m.drawImage(t.image,f,f,t.image.width-2*f,t.image.height-2*f,e*p,r*p,n*p,h*p)}));var M=qh.getTopLeft(h);a.getTriangles().forEach((function(t,i,r){var h=t.source,a=t.target;var o=h[0][0],f=h[0][1],u=h[1][0],c=h[1][1],d=h[2][0],p=h[2][1];var z=(a[0][0]-M[0])/n,_=-(a[0][1]-M[1])/n;var g=(a[1][0]-M[0])/n,w=-(a[1][1]-M[1])/n;var y=(a[2][0]-M[0])/n,b=-(a[2][1]-M[1])/n;var x=o,k=f;o=0;f=0;u-=x;c-=k;d-=x;p-=k;var E=[[u,c,0,0,g-z],[d,p,0,0,y-z],[0,0,u,c,w-_],[0,0,d,p,b-_]];var N=Fh.solveLinearSystem(E);if(!N){return}v.save();v.beginPath();var C=(z+g+y)/3,I=(_+w+b)/3;var S=Wu.enlargeClipPoint_(C,I,z,_);var O=Wu.enlargeClipPoint_(C,I,g,w);var T=Wu.enlargeClipPoint_(C,I,y,b);v.moveTo(O[0],O[1]);v.lineTo(S[0],S[1]);v.lineTo(T[0],T[1]);v.clip();v.transform(N[0],N[2],N[1],N[3],z,_);v.translate(l[0]-x,l[3]-k);v.scale(e/s,-e/s);v.drawImage(m.canvas,0,0);v.restore()}));if(u){v.save();v.strokeStyle="black";v.lineWidth=1;a.getTriangles().forEach((function(t,i,s){var e=t.target;var r=(e[0][0]-M[0])/n,h=-(e[0][1]-M[1])/n;var a=(e[1][0]-M[0])/n,o=-(e[1][1]-M[1])/n;var f=(e[2][0]-M[0])/n,u=-(e[2][1]-M[1])/n;v.beginPath();v.moveTo(a,o);v.lineTo(r,h);v.lineTo(f,u);v.closePath();v.stroke()}));v.restore()}return v.canvas};var ju=function(t,i,s,e,r){this.sourceProj_=t;this.targetProj_=i;var n={};var h=ia.getTransform(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];if(!n[i]){n[i]=h(t)}return n[i]};this.maxSourceExtent_=e;this.errorThresholdSquared_=r*r;this.triangles_=[];this.wrapsXInSource_=false;this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!e&&!!this.sourceProj_.getExtent()&&qh.getWidth(e)==qh.getWidth(this.sourceProj_.getExtent());this.sourceWorldWidth_=this.sourceProj_.getExtent()?qh.getWidth(this.sourceProj_.getExtent()):null;this.targetWorldWidth_=this.targetProj_.getExtent()?qh.getWidth(this.targetProj_.getExtent()):null;var a=qh.getTopLeft(s);var o=qh.getTopRight(s);var f=qh.getBottomRight(s);var u=qh.getBottomLeft(s);var v=this.transformInv_(a);var l=this.transformInv_(o);var c=this.transformInv_(f);var d=this.transformInv_(u);this.addQuad_(a,o,f,u,v,l,c,d,kh.RASTER_REPROJECTION_MAX_SUBDIVISION);if(this.wrapsXInSource_){var m=Infinity;this.triangles_.forEach((function(t,i,s){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])}));this.triangles_.forEach((function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];if(i[0][0]-m>this.sourceWorldWidth_/2){i[0][0]-=this.sourceWorldWidth_}if(i[1][0]-m>this.sourceWorldWidth_/2){i[1][0]-=this.sourceWorldWidth_}if(i[2][0]-m>this.sourceWorldWidth_/2){i[2][0]-=this.sourceWorldWidth_}var s=Math.min(i[0][0],i[1][0],i[2][0]);var e=Math.max(i[0][0],i[1][0],i[2][0]);if(e-s<this.sourceWorldWidth_/2){t.source=i}}}),this)}n={}};ju.prototype.addTriangle_=function(t,i,s,e,r,n){this.triangles_.push({source:[e,r,n],target:[t,i,s]})};ju.prototype.addQuad_=function(t,i,s,e,r,n,h,a,o){var f=qh.boundingExtent([r,n,h,a]);var u=this.sourceWorldWidth_?qh.getWidth(f)/this.sourceWorldWidth_:null;var v=this.sourceWorldWidth_;var l=this.sourceProj_.canWrapX()&&u>.5&&u<1;var c=false;if(o>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var d=qh.boundingExtent([t,i,s,e]);var m=qh.getWidth(d)/this.targetWorldWidth_;c|=m>kh.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}if(!l&&this.sourceProj_.isGlobal()&&u){c|=u>kh.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}}if(!c&&this.maxSourceExtent_){if(!qh.intersects(f,this.maxSourceExtent_)){return}}if(!c){if(!isFinite(r[0])||!isFinite(r[1])||!isFinite(n[0])||!isFinite(n[1])||!isFinite(h[0])||!isFinite(h[1])||!isFinite(a[0])||!isFinite(a[1])){if(o>0){c=true}else{return}}}if(o>0){if(!c){var p=[(t[0]+s[0])/2,(t[1]+s[1])/2];var M=this.transformInv_(p);var z;if(l){var _=(Fh.modulo(r[0],v)+Fh.modulo(h[0],v))/2;z=_-Fh.modulo(M[0],v)}else{z=(r[0]+h[0])/2-M[0]}var g=(r[1]+h[1])/2-M[1];var w=z*z+g*g;c=w>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-s[0])<=Math.abs(t[1]-s[1])){var y=[(i[0]+s[0])/2,(i[1]+s[1])/2];var b=this.transformInv_(y);var x=[(e[0]+t[0])/2,(e[1]+t[1])/2];var k=this.transformInv_(x);this.addQuad_(t,i,y,x,r,n,b,k,o-1);this.addQuad_(x,y,s,e,k,b,h,a,o-1)}else{var E=[(t[0]+i[0])/2,(t[1]+i[1])/2];var N=this.transformInv_(E);var C=[(s[0]+e[0])/2,(s[1]+e[1])/2];var I=this.transformInv_(C);this.addQuad_(t,E,C,e,r,N,I,a,o-1);this.addQuad_(E,i,s,C,N,n,h,I,o-1)}return}}if(l){if(!this.canWrapXInSource_){return}this.wrapsXInSource_=true}this.addTriangle_(t,s,e,r,h,a);this.addTriangle_(t,i,s,r,n,h)};ju.prototype.calculateSourceExtent=function(){var t=qh.createEmpty();this.triangles_.forEach((function(i,s,e){var r=i.source;qh.extendCoordinate(t,r[0]);qh.extendCoordinate(t,r[1]);qh.extendCoordinate(t,r[2])}));return t};ju.prototype.getTriangles=function(){return this.triangles_};var Vu=function(t,i,s,e,r,n,h,a,o,f,u){Du.call(this,r,Wa.IDLE);this.renderEdges_=u!==undefined?u:false;this.pixelRatio_=h;this.gutter_=a;this.canvas_=null;this.sourceTileGrid_=i;this.targetTileGrid_=e;this.wrappedTileCoord_=n?n:r;this.sourceTiles_=[];this.sourcesListenerKeys_=null;this.sourceZ_=0;var v=e.getTileCoordExtent(this.wrappedTileCoord_);var l=this.targetTileGrid_.getExtent();var c=this.sourceTileGrid_.getExtent();var d=l?qh.getIntersection(v,l):v;if(qh.getArea(d)===0){this.state=Wa.EMPTY;return}var m=t.getExtent();if(m){if(!c){c=m}else{c=qh.getIntersection(c,m)}}var p=e.getResolution(this.wrappedTileCoord_[0]);var M=qh.getCenter(d);var z=Wu.calculateSourceResolution(t,s,M,p);if(!isFinite(z)||z<=0){this.state=Wa.EMPTY;return}var _=f!==undefined?f:kh.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD;this.triangulation_=new ju(t,s,d,c,z*_);if(this.triangulation_.getTriangles().length===0){this.state=Wa.EMPTY;return}this.sourceZ_=i.getZForResolution(z);var g=this.triangulation_.calculateSourceExtent();if(c){if(t.canWrapX()){g[1]=Fh.clamp(g[1],c[1],c[3]);g[3]=Fh.clamp(g[3],c[1],c[3])}else{g=qh.getIntersection(g,c)}}if(!qh.getArea(g)){this.state=Wa.EMPTY}else{var w=i.getTileRangeForExtentAndZ(g,this.sourceZ_);for(var y=w.minX;y<=w.maxX;y++){for(var b=w.minY;b<=w.maxY;b++){var x=o(this.sourceZ_,y,b,h);if(x){this.sourceTiles_.push(x)}}}if(this.sourceTiles_.length===0){this.state=Wa.EMPTY}}};kh.inherits(Vu,Du);Vu.prototype.disposeInternal=function(){if(this.state==Wa.LOADING){this.unlistenSources_()}Du.prototype.disposeInternal.call(this)};Vu.prototype.getImage=function(){return this.canvas_};Vu.prototype.reproject_=function(){var t=[];this.sourceTiles_.forEach((function(i,s,e){if(i&&i.getState()==Wa.LOADED){t.push({extent:this.sourceTileGrid_.getTileCoordExtent(i.tileCoord),image:i.getImage()})}}),this);this.sourceTiles_.length=0;if(t.length===0){this.state=Wa.ERROR}else{var i=this.wrappedTileCoord_[0];var s=this.targetTileGrid_.getTileSize(i);var e=typeof s==="number"?s:s[0];var r=typeof s==="number"?s:s[1];var n=this.targetTileGrid_.getResolution(i);var h=this.sourceTileGrid_.getResolution(this.sourceZ_);var a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Wu.render(e,r,this.pixelRatio_,h,this.sourceTileGrid_.getExtent(),n,a,this.triangulation_,t,this.gutter_,this.renderEdges_);this.state=Wa.LOADED}this.changed()};Vu.prototype.load=function(){if(this.state==Wa.IDLE){this.state=Wa.LOADING;this.changed();var t=0;this.sourcesListenerKeys_=[];this.sourceTiles_.forEach((function(i,s,e){var r=i.getState();if(r==Wa.IDLE||r==Wa.LOADING){t++;var n;n=Ih.listen(i,Ah.CHANGE,(function(s){var e=i.getState();if(e==Wa.LOADED||e==Wa.ERROR||e==Wa.EMPTY){Ih.unlistenByKey(n);t--;if(t===0){this.unlistenSources_();this.reproject_()}}}),this);this.sourcesListenerKeys_.push(n)}}),this);this.sourceTiles_.forEach((function(t,i,s){var e=t.getState();if(e==Wa.IDLE){t.load()}}));if(t===0){setTimeout(this.reproject_.bind(this),0)}}};Vu.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ih.unlistenByKey);this.sourcesListenerKeys_=null};var Uu=function(t){this.minZoom=t.minZoom!==undefined?t.minZoom:0;this.resolutions_=t.resolutions;Dh.assert(jh.isSorted(this.resolutions_,(function(t,i){return i-t}),true),17);var i;if(!t.origins){for(var s=0,e=this.resolutions_.length-1;s<e;++s){if(!i){i=this.resolutions_[s]/this.resolutions_[s+1]}else{if(this.resolutions_[s]/this.resolutions_[s+1]!==i){i=undefined;break}}}}this.zoomFactor_=i;this.maxZoom=this.resolutions_.length-1;this.origin_=t.origin!==undefined?t.origin:null;this.origins_=null;if(t.origins!==undefined){this.origins_=t.origins;Dh.assert(this.origins_.length==this.resolutions_.length,20)}var r=t.extent;if(r!==undefined&&!this.origin_&&!this.origins_){this.origin_=qh.getTopLeft(r)}Dh.assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18);this.tileSizes_=null;if(t.tileSizes!==undefined){this.tileSizes_=t.tileSizes;Dh.assert(this.tileSizes_.length==this.resolutions_.length,19)}this.tileSize_=t.tileSize!==undefined?t.tileSize:!this.tileSizes_?kh.DEFAULT_TILE_SIZE:null;Dh.assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22);this.extent_=r!==undefined?r:null;this.fullTileRanges_=null;this.tmpSize_=[0,0];if(t.sizes!==undefined){this.fullTileRanges_=t.sizes.map((function(t,i){var s=new sf(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));return s}),this)}else if(r){this.calculateTileRanges_(r)}};Uu.tmpTileCoord_=[0,0,0];Uu.prototype.forEachTileCoord=function(t,i,s){var e=this.getTileRangeForExtentAndZ(t,i);for(var r=e.minX,n=e.maxX;r<=n;++r){for(var h=e.minY,a=e.maxY;h<=a;++h){s([i,r,h])}}};Uu.prototype.forEachTileCoordParentTileRange=function(t,i,s,e,r){var n,h,a;var o=null;var f=t[0]-1;if(this.zoomFactor_===2){h=t[1];a=t[2]}else{o=this.getTileCoordExtent(t,r)}while(f>=this.minZoom){if(this.zoomFactor_===2){h=Math.floor(h/2);a=Math.floor(a/2);n=sf.createOrUpdate(h,h,a,a,e)}else{n=this.getTileRangeForExtentAndZ(o,f,e)}if(i.call(s,f,n)){return true}--f}return false};Uu.prototype.getExtent=function(){return this.extent_};Uu.prototype.getMaxZoom=function(){return this.maxZoom};Uu.prototype.getMinZoom=function(){return this.minZoom};Uu.prototype.getOrigin=function(t){if(this.origin_){return this.origin_}else{return this.origins_[t]}};Uu.prototype.getResolution=function(t){return this.resolutions_[t]};Uu.prototype.getResolutions=function(){return this.resolutions_};Uu.prototype.getTileCoordChildTileRange=function(t,i,s){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){var e=t[1]*2;var r=t[2]*2;return sf.createOrUpdate(e,e+1,r,r+1,i)}var n=this.getTileCoordExtent(t,s);return this.getTileRangeForExtentAndZ(n,t[0]+1,i)}return null};Uu.prototype.getTileRangeExtent=function(t,i,s){var e=this.getOrigin(t);var r=this.getResolution(t);var n=ho.toSize(this.getTileSize(t),this.tmpSize_);var h=e[0]+i.minX*n[0]*r;var a=e[0]+(i.maxX+1)*n[0]*r;var o=e[1]+i.minY*n[1]*r;var f=e[1]+(i.maxY+1)*n[1]*r;return qh.createOrUpdate(h,o,a,f,s)};Uu.prototype.getTileRangeForExtentAndZ=function(t,i,s){var e=Uu.tmpTileCoord_;this.getTileCoordForXYAndZ_(t[0],t[1],i,false,e);var r=e[1];var n=e[2];this.getTileCoordForXYAndZ_(t[2],t[3],i,true,e);return sf.createOrUpdate(r,e[1],n,e[2],s)};Uu.prototype.getTileCoordCenter=function(t){var i=this.getOrigin(t[0]);var s=this.getResolution(t[0]);var e=ho.toSize(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*e[0]*s,i[1]+(t[2]+.5)*e[1]*s]};Uu.prototype.getTileCoordExtent=function(t,i){var s=this.getOrigin(t[0]);var e=this.getResolution(t[0]);var r=ho.toSize(this.getTileSize(t[0]),this.tmpSize_);var n=s[0]+t[1]*r[0]*e;var h=s[1]+t[2]*r[1]*e;var a=n+r[0]*e;var o=h+r[1]*e;return qh.createOrUpdate(n,h,a,o,i)};Uu.prototype.getTileCoordForCoordAndResolution=function(t,i,s){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,false,s)};Uu.prototype.getTileCoordForXYAndResolution_=function(t,i,s,e,r){var n=this.getZForResolution(s);var h=s/this.getResolution(n);var a=this.getOrigin(n);var o=ho.toSize(this.getTileSize(n),this.tmpSize_);var f=e?.5:0;var u=e?0:.5;var v=Math.floor((t-a[0])/s+f);var l=Math.floor((i-a[1])/s+u);var c=h*v/o[0];var d=h*l/o[1];if(e){c=Math.ceil(c)-1;d=Math.ceil(d)-1}else{c=Math.floor(c);d=Math.floor(d)}return Pu.createOrUpdate(n,c,d,r)};Uu.prototype.getTileCoordForXYAndZ_=function(t,i,s,e,r){var n=this.getOrigin(s);var h=this.getResolution(s);var a=ho.toSize(this.getTileSize(s),this.tmpSize_);var o=e?.5:0;var f=e?0:.5;var u=Math.floor((t-n[0])/h+o);var v=Math.floor((i-n[1])/h+f);var l=u/a[0];var c=v/a[1];if(e){l=Math.ceil(l)-1;c=Math.ceil(c)-1}else{l=Math.floor(l);c=Math.floor(c)}return Pu.createOrUpdate(s,l,c,r)};Uu.prototype.getTileCoordForCoordAndZ=function(t,i,s){return this.getTileCoordForXYAndZ_(t[0],t[1],i,false,s)};Uu.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]};Uu.prototype.getTileSize=function(t){if(this.tileSize_){return this.tileSize_}else{return this.tileSizes_[t]}};Uu.prototype.getFullTileRange=function(t){if(!this.fullTileRanges_){return null}else{return this.fullTileRanges_[t]}};Uu.prototype.getZForResolution=function(t,i){var s=jh.linearFindNearest(this.resolutions_,t,i||0);return Fh.clamp(s,this.minZoom,this.maxZoom)};Uu.prototype.calculateTileRanges_=function(t){var i=this.resolutions_.length;var s=new Array(i);for(var e=this.minZoom;e<i;++e){s[e]=this.getTileRangeForExtentAndZ(t,e)}this.fullTileRanges_=s};var qu={};qu.getForProjection=function(t){var i=t.getDefaultTileGrid();if(!i){i=qu.createForProjection(t);t.setDefaultTileGrid(i)}return i};qu.wrapX=function(t,i,s){var e=i[0];var r=t.getTileCoordCenter(i);var n=qu.extentFromProjection(s);if(!qh.containsCoordinate(n,r)){var h=qh.getWidth(n);var a=Math.ceil((n[0]-r[0])/h);r[0]+=h*a;return t.getTileCoordForCoordAndZ(r,e)}else{return i}};qu.createForExtent=function(t,i,s,e){var r=e!==undefined?e:Vh.TOP_LEFT;var n=qu.resolutionsFromExtent(t,i,s);return new Uu({extent:t,origin:qh.getCorner(t,r),resolutions:n,tileSize:s})};qu.createXYZ=function(t){var i={};Ch.assign(i,t!==undefined?t:{});if(i.extent===undefined){i.extent=ia.get("EPSG:3857").getExtent()}i.resolutions=qu.resolutionsFromExtent(i.extent,i.maxZoom,i.tileSize);delete i.maxZoom;return new Uu(i)};qu.resolutionsFromExtent=function(t,i,s){var e=i!==undefined?i:kh.DEFAULT_MAX_ZOOM;var r=qh.getHeight(t);var n=qh.getWidth(t);var h=ho.toSize(s!==undefined?s:kh.DEFAULT_TILE_SIZE);var a=Math.max(n/h[0],r/h[1]);var o=e+1;var f=new Array(o);for(var u=0;u<o;++u){f[u]=a/Math.pow(2,u)}return f};qu.createForProjection=function(t,i,s,e){var r=qu.extentFromProjection(t);return qu.createForExtent(r,i,s,e)};qu.extentFromProjection=function(t){t=ia.get(t);var i=t.getExtent();if(!i){var s=180*ia.METERS_PER_UNIT[Hh.DEGREES]/t.getMetersPerUnit();i=qh.createOrUpdate(-s,-s,s,s)}return i};var Xu=function(t){this.html_=t.html;this.tileRanges_=t.tileRanges?t.tileRanges:null};Xu.prototype.getHTML=function(){return this.html_};Xu.prototype.intersectsAnyTileRange=function(t,i,s){if(!this.tileRanges_){return true}var e,r,n,h;for(h in t){if(!(h in this.tileRanges_)){continue}n=t[h];var a;for(e=0,r=this.tileRanges_[h].length;e<r;++e){a=this.tileRanges_[h][e];if(a.intersects(n)){return true}var o=i.getTileRangeForExtentAndZ(qu.extentFromProjection(s),parseInt(h,10));var f=o.getWidth();if(n.minX<o.minX||n.maxX>o.maxX){if(a.intersects(new sf(Fh.modulo(n.minX,f),Fh.modulo(n.maxX,f),n.minY,n.maxY))){return true}if(n.getWidth()>f&&a.intersects(o)){return true}}}}return false};var Yu=function(t){Ph.call(this);this.projection_=ia.get(t.projection);this.attributions_=null;this.attributions2_=this.adaptAttributions_(t.attributions);this.logo_=t.logo;this.state_=t.state!==undefined?t.state:io.READY;this.wrapX_=t.wrapX!==undefined?t.wrapX:false};kh.inherits(Yu,Ph);Yu.prototype.adaptAttributions_=function(t){if(!t){return null}if(t instanceof Xu){this.attributions_=[t];return function(i){return[t.getHTML()]}}if(Array.isArray(t)){if(t[0]instanceof Xu){this.attributions_=t;var i=t.map((function(t){return t.getHTML()}));return function(t){return i}}this.attributions_=t.map((function(t){return new Xu({html:t})}));return function(i){return t}}if(typeof t==="function"){return t}this.attributions_=[new Xu({html:t})];return function(i){return[t]}};Yu.prototype.forEachFeatureAtCoordinate=kh.nullFunction;Yu.prototype.getAttributions=function(){return this.attributions_};Yu.prototype.getAttributions2=function(){return this.attributions2_};Yu.prototype.getLogo=function(){return this.logo_};Yu.prototype.getProjection=function(){return this.projection_};Yu.prototype.getResolutions=function(){};Yu.prototype.getState=function(){return this.state_};Yu.prototype.getWrapX=function(){return this.wrapX_};Yu.prototype.refresh=function(){this.changed()};Yu.prototype.setAttributions=function(t){this.attributions2_=this.adaptAttributions_(t);this.changed()};Yu.prototype.setLogo=function(t){this.logo_=t};Yu.prototype.setState=function(t){this.state_=t;this.changed()};var Bu=function(t){Yu.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state,wrapX:t.wrapX});this.opaque_=t.opaque!==undefined?t.opaque:false;this.tilePixelRatio_=t.tilePixelRatio!==undefined?t.tilePixelRatio:1;this.tileGrid=t.tileGrid!==undefined?t.tileGrid:null;this.tileCache=new Gu(t.cacheSize);this.tmpSize=[0,0];this.key_="";this.tileOptions={transition:t.transition}};kh.inherits(Bu,Yu);Bu.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()};Bu.prototype.expireCache=function(t,i){var s=this.getTileCacheForProjection(t);if(s){s.expireCache(i)}};Bu.prototype.forEachLoadedTile=function(t,i,s,e){var r=this.getTileCacheForProjection(t);if(!r){return false}var n=true;var h,a,o;for(var f=s.minX;f<=s.maxX;++f){for(var u=s.minY;u<=s.maxY;++u){a=Pu.getKeyZXY(i,f,u);o=false;if(r.containsKey(a)){h=r.get(a);o=h.getState()===Wa.LOADED;if(o){o=e(h)!==false}}if(!o){n=false}}}return n};Bu.prototype.getGutter=function(t){return 0};Bu.prototype.getKey=function(){return this.key_};Bu.prototype.setKey=function(t){if(this.key_!==t){this.key_=t;this.changed()}};Bu.prototype.getOpaque=function(t){return this.opaque_};Bu.prototype.getResolutions=function(){return this.tileGrid.getResolutions()};Bu.prototype.getTile=function(t,i,s,e,r){};Bu.prototype.getTileGrid=function(){return this.tileGrid};Bu.prototype.getTileGridForProjection=function(t){if(!this.tileGrid){return qu.getForProjection(t)}else{return this.tileGrid}};Bu.prototype.getTileCacheForProjection=function(t){var i=this.getProjection();if(i&&!ia.equivalent(i,t)){return null}else{return this.tileCache}};Bu.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_};Bu.prototype.getTilePixelSize=function(t,i,s){var e=this.getTileGridForProjection(s);var r=this.getTilePixelRatio(i);var n=ho.toSize(e.getTileSize(t),this.tmpSize);if(r==1){return n}else{return ho.scale(n,r,this.tmpSize)}};Bu.prototype.getTileCoordForTileUrlFunction=function(t,i){var s=i!==undefined?i:this.getProjection();var e=this.getTileGridForProjection(s);if(this.getWrapX()&&s.isGlobal()){t=qu.wrapX(e,t,s)}return Pu.withinExtentAndZ(t,e)?t:null};Bu.prototype.refresh=function(){this.tileCache.clear();this.changed()};Bu.prototype.useTile=kh.nullFunction;Bu.Event=function(t,i){Oh.call(this,t);this.tile=i};kh.inherits(Bu.Event,Oh);var Hu={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var Ju=function(t){Bu.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition});this.tileLoadFunction=t.tileLoadFunction;this.tileUrlFunction=this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Lu.nullTileUrlFunction;this.urls=null;if(t.urls){this.setUrls(t.urls)}else if(t.url){this.setUrl(t.url)}if(t.tileUrlFunction){this.setTileUrlFunction(t.tileUrlFunction)}this.tileLoadingKeys_={}};kh.inherits(Ju,Bu);Ju.prototype.getTileLoadFunction=function(){return this.tileLoadFunction};Ju.prototype.getTileUrlFunction=function(){return this.tileUrlFunction};Ju.prototype.getUrls=function(){return this.urls};Ju.prototype.handleTileChange=function(t){var i=t.target;var s=kh.getUid(i);var e=i.getState();var r;if(e==Wa.LOADING){this.tileLoadingKeys_[s]=true;r=Hu.TILELOADSTART}else if(s in this.tileLoadingKeys_){delete this.tileLoadingKeys_[s];r=e==Wa.ERROR?Hu.TILELOADERROR:e==Wa.LOADED||e==Wa.ABORT?Hu.TILELOADEND:undefined}if(r!=undefined){this.dispatchEvent(new Bu.Event(r,i))}};Ju.prototype.setTileLoadFunction=function(t){this.tileCache.clear();this.tileLoadFunction=t;this.changed()};Ju.prototype.setTileUrlFunction=function(t,i){this.tileUrlFunction=t;this.tileCache.pruneExceptNewestZ();if(typeof i!=="undefined"){this.setKey(i)}else{this.changed()}};Ju.prototype.setUrl=function(t){var i=this.urls=Lu.expandUrl(t);this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Lu.createFromTemplates(i,this.tileGrid),t)};Ju.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Lu.createFromTemplates(t,this.tileGrid),i)};Ju.prototype.useTile=function(t,i,s){var e=Pu.getKeyZXY(t,i,s);if(this.tileCache.containsKey(e)){this.tileCache.get(e)}};var Zu=function(t){Ju.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Zu.defaultTileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition});this.crossOrigin=t.crossOrigin!==undefined?t.crossOrigin:null;this.tileClass=t.tileClass!==undefined?t.tileClass:Fu;this.tileCacheForProjection={};this.tileGridForProjection={};this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold;this.renderReprojectionEdges_=false};kh.inherits(Zu,Ju);Zu.prototype.canExpireCache=function(){if(!kh.ENABLE_RASTER_REPROJECTION){return Ju.prototype.canExpireCache.call(this)}if(this.tileCache.canExpireCache()){return true}else{for(var t in this.tileCacheForProjection){if(this.tileCacheForProjection[t].canExpireCache()){return true}}}return false};Zu.prototype.expireCache=function(t,i){if(!kh.ENABLE_RASTER_REPROJECTION){Ju.prototype.expireCache.call(this,t,i);return}var s=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==s?i:{});for(var e in this.tileCacheForProjection){var r=this.tileCacheForProjection[e];r.expireCache(r==s?i:{})}};Zu.prototype.getGutter=function(t){if(kh.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!ia.equivalent(this.getProjection(),t)){return 0}else{return this.getGutterInternal()}};Zu.prototype.getGutterInternal=function(){return 0};Zu.prototype.getOpaque=function(t){if(kh.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!ia.equivalent(this.getProjection(),t)){return false}else{return Ju.prototype.getOpaque.call(this,t)}};Zu.prototype.getTileGridForProjection=function(t){if(!kh.ENABLE_RASTER_REPROJECTION){return Ju.prototype.getTileGridForProjection.call(this,t)}var i=this.getProjection();if(this.tileGrid&&(!i||ia.equivalent(i,t))){return this.tileGrid}else{var s=kh.getUid(t).toString();if(!(s in this.tileGridForProjection)){this.tileGridForProjection[s]=qu.getForProjection(t)}return this.tileGridForProjection[s]}};Zu.prototype.getTileCacheForProjection=function(t){if(!kh.ENABLE_RASTER_REPROJECTION){return Ju.prototype.getTileCacheForProjection.call(this,t)}var i=this.getProjection();if(!i||ia.equivalent(i,t)){return this.tileCache}else{var s=kh.getUid(t).toString();if(!(s in this.tileCacheForProjection)){this.tileCacheForProjection[s]=new Gu(this.tileCache.highWaterMark)}return this.tileCacheForProjection[s]}};Zu.prototype.createTile_=function(t,i,s,e,r,n){var h=[t,i,s];var a=this.getTileCoordForTileUrlFunction(h,r);var o=a?this.tileUrlFunction(a,e,r):undefined;var f=new this.tileClass(h,o!==undefined?Wa.IDLE:Wa.EMPTY,o!==undefined?o:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);f.key=n;Ih.listen(f,Ah.CHANGE,this.handleTileChange,this);return f};Zu.prototype.getTile=function(t,i,s,e,r){var n=this.getProjection();if(!kh.ENABLE_RASTER_REPROJECTION||!n||!r||ia.equivalent(n,r)){return this.getTileInternal(t,i,s,e,n||r)}else{var h=this.getTileCacheForProjection(r);var a=[t,i,s];var o;var f=Pu.getKey(a);if(h.containsKey(f)){o=h.get(f)}var u=this.getKey();if(o&&o.key==u){return o}else{var v=this.getTileGridForProjection(n);var l=this.getTileGridForProjection(r);var c=this.getTileCoordForTileUrlFunction(a,r);var d=new Vu(n,v,r,l,a,c,this.getTilePixelRatio(e),this.getGutterInternal(),function(t,i,s,e){return this.getTileInternal(t,i,s,e,n)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);d.key=u;if(o){d.interimTile=o;d.refreshInterimChain();h.replace(f,d)}else{h.set(f,d)}return d}}};Zu.prototype.getTileInternal=function(t,i,s,e,r){var n=null;var h=Pu.getKeyZXY(t,i,s);var a=this.getKey();if(!this.tileCache.containsKey(h)){n=this.createTile_(t,i,s,e,r,a);this.tileCache.set(h,n)}else{n=this.tileCache.get(h);if(n.key!=a){var o=n;n=this.createTile_(t,i,s,e,r,a);if(o.getState()==Wa.IDLE){n.interimTile=o.interimTile}else{n.interimTile=o}n.refreshInterimChain();this.tileCache.replace(h,n)}}return n};Zu.prototype.setRenderReprojectionEdges=function(t){if(!kh.ENABLE_RASTER_REPROJECTION||this.renderReprojectionEdges_==t){return}this.renderReprojectionEdges_=t;for(var i in this.tileCacheForProjection){this.tileCacheForProjection[i].clear()}this.changed()};Zu.prototype.setTileGridForProjection=function(t,i){if(kh.ENABLE_RASTER_REPROJECTION){var s=ia.get(t);if(s){var e=kh.getUid(s).toString();if(!(e in this.tileGridForProjection)){this.tileGridForProjection[e]=i}}}};Zu.defaultTileLoadFunction=function(t,i){t.getImage().src=i};var Ku={KVP:"KVP",REST:"REST"};var $u=function(t){this.matrixIds_=t.matrixIds;Uu.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})};kh.inherits($u,Uu);$u.prototype.getMatrixId=function(t){return this.matrixIds_[t]};$u.prototype.getMatrixIds=function(){return this.matrixIds_};$u.createFromCapabilitiesMatrixSet=function(t,i,s){var e=[];var r=[];var n=[];var h=[];var a=[];var o=s!==undefined?s:[];var f="SupportedCRS";var u="TileMatrix";var v="Identifier";var l="ScaleDenominator";var c="TopLeftCorner";var d="TileWidth";var m="TileHeight";var p=t[f];var M=ia.get(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ia.get(p);var z=M.getMetersPerUnit();var _=M.getAxisOrientation().substr(0,2)=="ne";t[u].sort((function(t,i){return i[l]-t[l]}));t[u].forEach((function(t,i,s){var f;if(o.length>0){f=jh.find(o,(function(i,s,e){return t[v]==i[u]}))}else{f=true}if(f){r.push(t[v]);var p=t[l]*28e-5/z;var M=t[d];var g=t[m];if(_){n.push([t[c][1],t[c][0]])}else{n.push(t[c])}e.push(p);h.push(M==g?M:[M,g]);a.push([t["MatrixWidth"],-t["MatrixHeight"]])}}));return new $u({extent:i,origins:n,resolutions:e,matrixIds:r,tileSizes:h,sizes:a})};var Qu={};Qu.appendParams=function(t,i){var s=[];Object.keys(i).forEach((function(t){if(i[t]!==null&&i[t]!==undefined){s.push(t+"="+encodeURIComponent(i[t]))}}));var e=s.join("&");t=t.replace(/[?&]$/,"");t=t.indexOf("?")===-1?t+"?":t+"&";return t+e};var tv=function(t){this.version_=t.version!==undefined?t.version:"1.0.0";this.format_=t.format!==undefined?t.format:"image/jpeg";this.dimensions_=t.dimensions!==undefined?t.dimensions:{};this.layer_=t.layer;this.matrixSet_=t.matrixSet;this.style_=t.style;var i=t.urls;if(i===undefined&&t.url!==undefined){i=Lu.expandUrl(t.url)}this.requestEncoding_=t.requestEncoding!==undefined?t.requestEncoding:Ku.KVP;var s=this.requestEncoding_;var e=t.tileGrid;var r={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};if(s==Ku.KVP){Ch.assign(r,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_})}var n=this.dimensions_;this.createFromWMTSTemplate_=function(t){t=s==Ku.KVP?Qu.appendParams(t,r):t.replace(/\{(\w+?)\}/g,(function(t,i){return i.toLowerCase()in r?r[i.toLowerCase()]:t}));return function(i,r,h){if(!i){return undefined}else{var a={TileMatrix:e.getMatrixId(i[0]),TileCol:i[1],TileRow:-i[2]-1};Ch.assign(a,n);var o=t;if(s==Ku.KVP){o=Qu.appendParams(o,a)}else{o=o.replace(/\{(\w+?)\}/g,(function(t,i){return a[i]}))}return o}}};var h=i&&i.length>0?Lu.createFromTileUrlFunctions(i.map(this.createFromWMTSTemplate_)):Lu.nullTileUrlFunction;Zu.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:e,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:h,urls:i,wrapX:t.wrapX!==undefined?t.wrapX:false,transition:t.transition});this.setKey(this.getKeyForDimensions_())};kh.inherits(tv,Zu);tv.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Lu.createFromTileUrlFunctions(t.map(this.createFromWMTSTemplate_.bind(this))),i)};tv.prototype.getDimensions=function(){return this.dimensions_};tv.prototype.getFormat=function(){return this.format_};tv.prototype.getLayer=function(){return this.layer_};tv.prototype.getMatrixSet=function(){return this.matrixSet_};tv.prototype.getRequestEncoding=function(){return this.requestEncoding_};tv.prototype.getStyle=function(){return this.style_};tv.prototype.getVersion=function(){return this.version_};tv.prototype.getKeyForDimensions_=function(){var t=0;var i=[];for(var s in this.dimensions_){i[t++]=s+"-"+this.dimensions_[s]}return i.join("/")};tv.prototype.updateDimensions=function(t){Ch.assign(this.dimensions_,t);this.setKey(this.getKeyForDimensions_())};tv.optionsFromCapabilities=function(t,i){var s=t["Contents"]["Layer"];var e=jh.find(s,(function(t,s,e){return t["Identifier"]==i["layer"]}));if(e===null){return null}var r=t["Contents"]["TileMatrixSet"];var n,h,a;if(e["TileMatrixSetLink"].length>1){if("projection"in i){n=jh.findIndex(e["TileMatrixSetLink"],(function(t,s,e){var n=jh.find(r,(function(i){return i["Identifier"]==t["TileMatrixSet"]}));var h=n["SupportedCRS"];var a=ia.get(h.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ia.get(h);var o=ia.get(i["projection"]);if(a&&o){return ia.equivalent(a,o)}else{return h==i["projection"]}}))}else{n=jh.findIndex(e["TileMatrixSetLink"],(function(t,s,e){return t["TileMatrixSet"]==i["matrixSet"]}))}}else{n=0}if(n<0){n=0}h=e["TileMatrixSetLink"][n]["TileMatrixSet"];a=e["TileMatrixSetLink"][n]["TileMatrixSetLimits"];var o=e["Format"][0];if("format"in i){o=i["format"]}n=jh.findIndex(e["Style"],(function(t,s,e){if("style"in i){return t["Title"]==i["style"]}else{return t["isDefault"]}}));if(n<0){n=0}var f=e["Style"][n]["Identifier"];var u={};if("Dimension"in e){e["Dimension"].forEach((function(t,i,s){var e=t["Identifier"];var r=t["Default"];if(r===undefined){r=t["Value"][0]}u[e]=r}))}var v=t["Contents"]["TileMatrixSet"];var l=jh.find(v,(function(t,i,s){return t["Identifier"]==h}));var c;var d=l["SupportedCRS"];if(d){c=ia.get(d.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ia.get(d)}if("projection"in i){var m=ia.get(i["projection"]);if(m){if(!c||ia.equivalent(m,c)){c=m}}}var p=e["WGS84BoundingBox"];var M,z;if(p!==undefined){var _=ia.get("EPSG:4326").getExtent();z=p[0]==_[0]&&p[2]==_[2];M=ia.transformExtent(p,"EPSG:4326",c);var g=c.getExtent();if(g){if(!qh.containsExtent(g,M)){M=undefined}}}var w=$u.createFromCapabilitiesMatrixSet(l,M,a);var y=[];var b=i["requestEncoding"];b=b!==undefined?b:"";if("OperationsMetadata"in t&&"GetTile"in t["OperationsMetadata"]){var x=t["OperationsMetadata"]["GetTile"]["DCP"]["HTTP"]["Get"];for(var k=0,E=x.length;k<E;++k){if(x[k]["Constraint"]){var N=jh.find(x[k]["Constraint"],(function(t){return t["name"]=="GetEncoding"}));var C=N["AllowedValues"]["Value"];if(b===""){b=C[0]}if(b===Ku.KVP){if(jh.includes(C,Ku.KVP)){y.push(x[k]["href"])}}else{break}}else if(x[k]["href"]){b=Ku.KVP;y.push(x[k]["href"])}}}if(y.length===0){b=Ku.REST;e["ResourceURL"].forEach((function(t){if(t["resourceType"]==="tile"){o=t["format"];y.push(t["template"])}}))}return{urls:y,layer:i["layer"],matrixSet:h,format:o,projection:c,requestEncoding:b,tileGrid:w,style:f,dimensions:u,wrapX:z,crossOrigin:i["crossOrigin"]}};var iv={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};var sv={};sv.DOCUMENT=document.implementation.createDocument("","",null);sv.createElementNS=function(t,i){return sv.DOCUMENT.createElementNS(t,i)};sv.getAllTextContent=function(t,i){return sv.getAllTextContent_(t,i,[]).join("")};sv.getAllTextContent_=function(t,i,s){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE){if(i){s.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,""))}else{s.push(t.nodeValue)}}else{var e;for(e=t.firstChild;e;e=e.nextSibling){sv.getAllTextContent_(e,i,s)}}return s};sv.isDocument=function(t){return t instanceof Document};sv.isNode=function(t){return t instanceof Node};sv.getAttributeNS=function(t,i,s){return t.getAttributeNS(i,s)||""};sv.setAttributeNS=function(t,i,s,e){t.setAttributeNS(i,s,e)};sv.parse=function(t){return(new DOMParser).parseFromString(t,"application/xml")};sv.makeArrayExtender=function(t,i){return function(s,e){var r=t.call(i,s,e);if(r!==undefined){var n=e[e.length-1];jh.extend(n,r)}}};sv.makeArrayPusher=function(t,i){return function(s,e){var r=t.call(i!==undefined?i:this,s,e);if(r!==undefined){var n=e[e.length-1];n.push(r)}}};sv.makeReplacer=function(t,i){return function(s,e){var r=t.call(i!==undefined?i:this,s,e);if(r!==undefined){e[e.length-1]=r}}};sv.makeObjectPropertyPusher=function(t,i,s){return function(e,r){var n=t.call(s!==undefined?s:this,e,r);if(n!==undefined){var h=r[r.length-1];var a=i!==undefined?i:e.localName;var o;if(a in h){o=h[a]}else{o=h[a]=[]}o.push(n)}}};sv.makeObjectPropertySetter=function(t,i,s){return function(e,r){var n=t.call(s!==undefined?s:this,e,r);if(n!==undefined){var h=r[r.length-1];var a=i!==undefined?i:e.localName;h[a]=n}}};sv.makeChildAppender=function(t,i){return function(s,e,r){t.call(i!==undefined?i:this,s,e,r);var n=r[r.length-1];var h=n.node;h.appendChild(s)}};sv.makeArraySerializer=function(t,i){var s,e;return function(i,r,n){if(s===undefined){s={};var h={};h[i.localName]=t;s[i.namespaceURI]=h;e=sv.makeSimpleNodeFactory(i.localName)}sv.serialize(s,e,r,n)}};sv.makeSimpleNodeFactory=function(t,i){var s=t;return function(t,e,r){var n=e[e.length-1];var h=n.node;var a=s;if(a===undefined){a=r}var o=i;if(i===undefined){o=h.namespaceURI}return sv.createElementNS(o,a)}};sv.OBJECT_PROPERTY_NODE_FACTORY=sv.makeSimpleNodeFactory();sv.makeSequence=function(t,i){var s=i.length;var e=new Array(s);for(var r=0;r<s;++r){e[r]=t[i[r]]}return e};sv.makeStructureNS=function(t,i,s){var e=s!==undefined?s:{};var r,n;for(r=0,n=t.length;r<n;++r){e[t[r]]=i}return e};sv.parseNode=function(t,i,s,e){var r;for(r=i.firstElementChild;r;r=r.nextElementSibling){var n=t[r.namespaceURI];if(n!==undefined){var h=n[r.localName];if(h!==undefined){h.call(e,r,s)}}}};sv.pushParseAndPop=function(t,i,s,e,r){e.push(t);sv.parseNode(i,s,e,r);return e.pop()};sv.serialize=function(t,i,s,e,r,n){var h=(r!==undefined?r:s).length;var a,o;for(var f=0;f<h;++f){a=s[f];if(a!==undefined){o=i.call(n,a,e,r!==undefined?r[f]:undefined);if(o!==undefined){t[o.namespaceURI][o.localName].call(n,o,a,e)}}}};sv.pushSerializeAndPop=function(t,i,s,e,r,n,h){r.push(t);sv.serialize(i,s,e,r,n,h);return r.pop()};var ev={};ev.loadFeaturesXhr=function(t,i,s,e){return function(r,n,h){var a=new XMLHttpRequest;a.open("GET",typeof t==="function"?t(r,n,h):t,true);if(i.getType()==iv.ARRAY_BUFFER){a.responseType="arraybuffer"}a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=i.getType();var n;if(r==iv.JSON||r==iv.TEXT){n=a.responseText}else if(r==iv.XML){n=a.responseXML;if(!n){n=sv.parse(a.responseText)}}else if(r==iv.ARRAY_BUFFER){n=a.response}if(n){s.call(this,i.readFeatures(n,{featureProjection:h}),i.readProjection(n),i.getLastExtent())}else{e.call(this)}}else{e.call(this)}}.bind(this);a.onerror=function(){e.call(this)}.bind(this);a.send()}};ev.xhr=function(t,i){return ev.loadFeaturesXhr(t,i,(function(t,i){this.addFeatures(t)}),kh.nullFunction)};var rv={};rv.all=function(t,i){return[[-Infinity,-Infinity,Infinity,Infinity]]};rv.bbox=function(t,i){return[t]};rv.tile=function(t){return function(i,s){var e=t.getZForResolution(s);var r=t.getTileRangeForExtentAndZ(i,e);var n=[];var h=[e,0,0];for(h[1]=r.minX;h[1]<=r.maxX;++h[1]){for(h[2]=r.minY;h[2]<=r.maxY;++h[2]){n.push(t.getTileCoordExtent(h))}}return n}};var nv={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"};var hv=function(t){var i=t||{};Yu.call(this,{attributions:i.attributions,logo:i.logo,projection:undefined,state:io.READY,wrapX:i.wrapX!==undefined?i.wrapX:true});this.loader_=kh.nullFunction;this.format_=i.format;this.overlaps_=i.overlaps==undefined?true:i.overlaps;this.url_=i.url;if(i.loader!==undefined){this.loader_=i.loader}else if(this.url_!==undefined){Dh.assert(this.format_,7);this.loader_=ev.xhr(this.url_,this.format_)}this.strategy_=i.strategy!==undefined?i.strategy:rv.all;var s=i.useSpatialIndex!==undefined?i.useSpatialIndex:true;this.featuresRtree_=s?new uu:null;this.loadedExtentsRtree_=new uu;this.nullGeometryFeatures_={};this.idIndex_={};this.undefIdIndex_={};this.featureChangeKeys_={};this.featuresCollection_=null;var e,r;if(i.features instanceof xa){e=i.features;r=e.getArray()}else if(Array.isArray(i.features)){r=i.features}if(!s&&e===undefined){e=new xa(r)}if(r!==undefined){this.addFeaturesInternal(r)}if(e!==undefined){this.bindFeaturesCollection_(e)}};kh.inherits(hv,Yu);hv.prototype.addFeature=function(t){this.addFeatureInternal(t);this.changed()};hv.prototype.addFeatureInternal=function(t){var i=kh.getUid(t).toString();if(!this.addToIndex_(i,t)){return}this.setupChangeEvents_(i,t);var s=t.getGeometry();if(s){var e=s.getExtent();if(this.featuresRtree_){this.featuresRtree_.insert(e,t)}}else{this.nullGeometryFeatures_[i]=t}this.dispatchEvent(new hv.Event(nv.ADDFEATURE,t))};hv.prototype.setupChangeEvents_=function(t,i){this.featureChangeKeys_[t]=[Ih.listen(i,Ah.CHANGE,this.handleFeatureChange_,this),Ih.listen(i,Nh.PROPERTYCHANGE,this.handleFeatureChange_,this)]};hv.prototype.addToIndex_=function(t,i){var s=true;var e=i.getId();if(e!==undefined){if(!(e.toString()in this.idIndex_)){this.idIndex_[e.toString()]=i}else{s=false}}else{Dh.assert(!(t in this.undefIdIndex_),30);this.undefIdIndex_[t]=i}return s};hv.prototype.addFeatures=function(t){this.addFeaturesInternal(t);this.changed()};hv.prototype.addFeaturesInternal=function(t){var i,s,e,r;var n=[];var h=[];var a=[];for(s=0,e=t.length;s<e;s++){r=t[s];i=kh.getUid(r).toString();if(this.addToIndex_(i,r)){h.push(r)}}for(s=0,e=h.length;s<e;s++){r=h[s];i=kh.getUid(r).toString();this.setupChangeEvents_(i,r);var o=r.getGeometry();if(o){var f=o.getExtent();n.push(f);a.push(r)}else{this.nullGeometryFeatures_[i]=r}}if(this.featuresRtree_){this.featuresRtree_.load(n,a)}for(s=0,e=h.length;s<e;s++){this.dispatchEvent(new hv.Event(nv.ADDFEATURE,h[s]))}};hv.prototype.bindFeaturesCollection_=function(t){var i=false;Ih.listen(this,nv.ADDFEATURE,(function(s){if(!i){i=true;t.push(s.feature);i=false}}));Ih.listen(this,nv.REMOVEFEATURE,(function(s){if(!i){i=true;t.remove(s.feature);i=false}}));Ih.listen(t,ba.ADD,(function(t){if(!i){i=true;this.addFeature(t.element);i=false}}),this);Ih.listen(t,ba.REMOVE,(function(t){if(!i){i=true;this.removeFeature(t.element);i=false}}),this);this.featuresCollection_=t};hv.prototype.clear=function(t){if(t){for(var i in this.featureChangeKeys_){var s=this.featureChangeKeys_[i];s.forEach(Ih.unlistenByKey)}if(!this.featuresCollection_){this.featureChangeKeys_={};this.idIndex_={};this.undefIdIndex_={}}}else{if(this.featuresRtree_){this.featuresRtree_.forEach(this.removeFeatureInternal,this);for(var e in this.nullGeometryFeatures_){this.removeFeatureInternal(this.nullGeometryFeatures_[e])}}}if(this.featuresCollection_){this.featuresCollection_.clear()}if(this.featuresRtree_){this.featuresRtree_.clear()}this.loadedExtentsRtree_.clear();this.nullGeometryFeatures_={};var r=new hv.Event(nv.CLEAR);this.dispatchEvent(r);this.changed()};hv.prototype.forEachFeature=function(t,i){if(this.featuresRtree_){return this.featuresRtree_.forEach(t,i)}else if(this.featuresCollection_){return this.featuresCollection_.forEach(t,i)}};hv.prototype.forEachFeatureAtCoordinateDirect=function(t,i,s){var e=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(e,(function(e){var r=e.getGeometry();if(r.intersectsCoordinate(t)){return i.call(s,e)}else{return undefined}}))};hv.prototype.forEachFeatureInExtent=function(t,i,s){if(this.featuresRtree_){return this.featuresRtree_.forEachInExtent(t,i,s)}else if(this.featuresCollection_){return this.featuresCollection_.forEach(i,s)}};hv.prototype.forEachFeatureIntersectingExtent=function(t,i,s){return this.forEachFeatureInExtent(t,(function(e){var r=e.getGeometry();if(r.intersectsExtent(t)){var n=i.call(s,e);if(n){return n}}}))};hv.prototype.getFeaturesCollection=function(){return this.featuresCollection_};hv.prototype.getFeatures=function(){var t;if(this.featuresCollection_){t=this.featuresCollection_.getArray()}else if(this.featuresRtree_){t=this.featuresRtree_.getAll();if(!Ch.isEmpty(this.nullGeometryFeatures_)){jh.extend(t,Ch.getValues(this.nullGeometryFeatures_))}}return t};hv.prototype.getFeaturesAtCoordinate=function(t){var i=[];this.forEachFeatureAtCoordinateDirect(t,(function(t){i.push(t)}));return i};hv.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_.getInExtent(t)};hv.prototype.getClosestFeatureToCoordinate=function(t,i){var s=t[0];var e=t[1];var r=null;var n=[NaN,NaN];var h=Infinity;var a=[-Infinity,-Infinity,Infinity,Infinity];var o=i?i:Yh.TRUE;this.featuresRtree_.forEachInExtent(a,(function(t){if(o(t)){var i=t.getGeometry();var f=h;h=i.closestPointXY(s,e,n,h);if(h<f){r=t;var u=Math.sqrt(h);a[0]=s-u;a[1]=e-u;a[2]=s+u;a[3]=e+u}}}));return r};hv.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)};hv.prototype.getFeatureById=function(t){var i=this.idIndex_[t.toString()];return i!==undefined?i:null};hv.prototype.getFormat=function(){return this.format_};hv.prototype.getOverlaps=function(){return this.overlaps_};hv.prototype.getResolutions=function(){};hv.prototype.getUrl=function(){return this.url_};hv.prototype.handleFeatureChange_=function(t){var i=t.target;var s=kh.getUid(i).toString();var e=i.getGeometry();if(!e){if(!(s in this.nullGeometryFeatures_)){if(this.featuresRtree_){this.featuresRtree_.remove(i)}this.nullGeometryFeatures_[s]=i}}else{var r=e.getExtent();if(s in this.nullGeometryFeatures_){delete this.nullGeometryFeatures_[s];if(this.featuresRtree_){this.featuresRtree_.insert(r,i)}}else{if(this.featuresRtree_){this.featuresRtree_.update(r,i)}}}var n=i.getId();if(n!==undefined){var h=n.toString();if(s in this.undefIdIndex_){delete this.undefIdIndex_[s];this.idIndex_[h]=i}else{if(this.idIndex_[h]!==i){this.removeFromIdIndex_(i);this.idIndex_[h]=i}}}else{if(!(s in this.undefIdIndex_)){this.removeFromIdIndex_(i);this.undefIdIndex_[s]=i}}this.changed();this.dispatchEvent(new hv.Event(nv.CHANGEFEATURE,i))};hv.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Ch.isEmpty(this.nullGeometryFeatures_)};hv.prototype.loadFeatures=function(t,i,s){var e=this.loadedExtentsRtree_;var r=this.strategy_(t,i);var n,h;for(n=0,h=r.length;n<h;++n){var a=r[n];var o=e.forEachInExtent(a,(function(t){return qh.containsExtent(t.extent,a)}));if(!o){this.loader_.call(this,a,i,s);e.insert(a,{extent:a.slice()})}}};hv.prototype.removeLoadedExtent=function(t){var i=this.loadedExtentsRtree_;var s;i.forEachInExtent(t,(function(i){if(qh.equals(i.extent,t)){s=i;return true}}));if(s){i.remove(s)}};hv.prototype.removeFeature=function(t){var i=kh.getUid(t).toString();if(i in this.nullGeometryFeatures_){delete this.nullGeometryFeatures_[i]}else{if(this.featuresRtree_){this.featuresRtree_.remove(t)}}this.removeFeatureInternal(t);this.changed()};hv.prototype.removeFeatureInternal=function(t){var i=kh.getUid(t).toString();this.featureChangeKeys_[i].forEach(Ih.unlistenByKey);delete this.featureChangeKeys_[i];var s=t.getId();if(s!==undefined){delete this.idIndex_[s.toString()]}else{delete this.undefIdIndex_[i]}this.dispatchEvent(new hv.Event(nv.REMOVEFEATURE,t))};hv.prototype.removeFromIdIndex_=function(t){var i=false;for(var s in this.idIndex_){if(this.idIndex_[s]===t){delete this.idIndex_[s];i=true;break}}return i};hv.prototype.setLoader=function(t){this.loader_=t};hv.Event=function(t,i){Oh.call(this,t);this.feature=i};kh.inherits(hv.Event,Oh);var av={};av.lineString=function(t,i,s,e,r,n){var h=NaN;var a=NaN;var o=(s-i)/e;if(o===1){h=t[i];a=t[i+1]}else if(o==2){h=(1-r)*t[i]+r*t[i+e];a=(1-r)*t[i+1]+r*t[i+e+1]}else if(o!==0){var f=t[i];var u=t[i+1];var v=0;var l=[0];var c;for(c=i+e;c<s;c+=e){var d=t[c];var m=t[c+1];v+=Math.sqrt((d-f)*(d-f)+(m-u)*(m-u));l.push(v);f=d;u=m}var p=r*v;var M=jh.binarySearch(l,p);if(M<0){var z=(p-l[-M-2])/(l[-M-1]-l[-M-2]);var _=i+(-M-2)*e;h=Fh.lerp(t[_],t[_+e],z);a=Fh.lerp(t[_+1],t[_+e+1],z)}else{h=t[i+M*e];a=t[i+M*e+1]}}if(n){n[0]=h;n[1]=a;return n}else{return[h,a]}};av.lineStringCoordinateAtM=function(t,i,s,e,r,n){if(s==i){return null}var h;if(r<t[i+e-1]){if(n){h=t.slice(i,i+e);h[e-1]=r;return h}else{return null}}else if(t[s-1]<r){if(n){h=t.slice(s-e,s);h[e-1]=r;return h}else{return null}}if(r==t[i+e-1]){return t.slice(i,i+e)}var a=i/e;var o=s/e;while(a<o){var f=a+o>>1;if(r<t[(f+1)*e-1]){o=f}else{a=f+1}}var u=t[a*e-1];if(r==u){return t.slice((a-1)*e,(a-1)*e+e)}var v=t[(a+1)*e-1];var l=(r-u)/(v-u);h=[];var c;for(c=0;c<e-1;++c){h.push(Fh.lerp(t[(a-1)*e+c],t[a*e+c],l))}h.push(r);return h};av.lineStringsCoordinateAtM=function(t,i,s,e,r,n,h){if(h){return av.lineStringCoordinateAtM(t,i,s[s.length-1],e,r,n)}var a;if(r<t[e-1]){if(n){a=t.slice(0,e);a[e-1]=r;return a}else{return null}}if(t[t.length-1]<r){if(n){a=t.slice(t.length-e);a[e-1]=r;return a}else{return null}}var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];if(i==u){continue}if(r<t[i+e-1]){return null}else if(r<=t[u-1]){return av.lineStringCoordinateAtM(t,i,u,e,r,false)}i=u}return null};var ov=function(t,i){ra.call(this);this.flatMidpoint_=null;this.flatMidpointRevision_=-1;this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.setCoordinates(t,i)};kh.inherits(ov,ra);ov.prototype.appendCoordinate=function(t){if(!this.flatCoordinates){this.flatCoordinates=t.slice()}else{jh.extend(this.flatCoordinates,t)}this.changed()};ov.prototype.clone=function(){var t=new ov(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};ov.prototype.closestPointXY=function(t,i,s,e){if(e<qh.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(ha.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return ha.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,false,t,i,s,e)};ov.prototype.forEachSegment=function(t,i){return da.forEach(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)};ov.prototype.getCoordinateAtM=function(t,i){if(this.layout!=Xh.XYM&&this.layout!=Xh.XYZM){return null}var s=i!==undefined?i:false;return av.lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,s)};ov.prototype.getCoordinates=function(){return oa.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};ov.prototype.getCoordinateAt=function(t,i){return av.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)};ov.prototype.getLength=function(){return xf.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};ov.prototype.getFlatMidpoint=function(){if(this.flatMidpointRevision_!=this.getRevision()){this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_);this.flatMidpointRevision_=this.getRevision()}return this.flatMidpoint_};ov.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=fa.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new ov(null);s.setFlatCoordinates(Xh.XY,i);return s};ov.prototype.getType=function(){return Gh.LINE_STRING};ov.prototype.intersectsExtent=function(t){return ma.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)};ov.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(Xh.XY,null)}else{this.setLayout(i,t,1);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=aa.coordinates(this.flatCoordinates,0,t,this.stride);this.changed()}};ov.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var fv={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var uv=function(t){var i=t?t:{};var s=Ch.assign({},i);delete s.preload;delete s.useInterimTilesOnError;vo.call(this,s);this.setPreload(i.preload!==undefined?i.preload:0);this.setUseInterimTilesOnError(i.useInterimTilesOnError!==undefined?i.useInterimTilesOnError:true);this.type=Fo.TILE};kh.inherits(uv,vo);uv.prototype.getPreload=function(){return this.get(fv.PRELOAD)};uv.prototype.setPreload=function(t){this.set(fv.PRELOAD,t)};uv.prototype.getUseInterimTilesOnError=function(){return this.get(fv.USE_INTERIM_TILES_ON_ERROR)};uv.prototype.setUseInterimTilesOnError=function(t){this.set(fv.USE_INTERIM_TILES_ON_ERROR,t)};var vv=function(t){var i=t?t:{};var s=Ch.assign({},i);delete s.style;delete s.renderBuffer;delete s.updateWhileAnimating;delete s.updateWhileInteracting;vo.call(this,s);this.declutter_=i.declutter!==undefined?i.declutter:false;this.renderBuffer_=i.renderBuffer!==undefined?i.renderBuffer:100;this.style_=null;this.styleFunction_=undefined;this.setStyle(i.style);this.updateWhileAnimating_=i.updateWhileAnimating!==undefined?i.updateWhileAnimating:false;this.updateWhileInteracting_=i.updateWhileInteracting!==undefined?i.updateWhileInteracting:false;this.renderMode_=i.renderMode||Go.VECTOR;this.type=Fo.VECTOR};kh.inherits(vv,vo);vv.prototype.getDeclutter=function(){return this.declutter_};vv.prototype.setDeclutter=function(t){this.declutter_=t};vv.prototype.getRenderBuffer=function(){return this.renderBuffer_};vv.prototype.getRenderOrder=function(){return this.get(vv.Property_.RENDER_ORDER)};vv.prototype.getStyle=function(){return this.style_};vv.prototype.getStyleFunction=function(){return this.styleFunction_};vv.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_};vv.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_};vv.prototype.setRenderOrder=function(t){this.set(vv.Property_.RENDER_ORDER,t)};vv.prototype.setStyle=function(t){this.style_=t!==undefined?t:Au.defaultFunction;this.styleFunction_=t===null?undefined:Au.createFunction(this.style_);this.changed()};vv.prototype.getRenderMode=function(){return this.renderMode_};vv.Property_={RENDER_ORDER:"renderOrder"};var lv={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"};var cv=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-scale-line";this.innerElement_=document.createElement("DIV");this.innerElement_.className=s+"-inner";this.element_=document.createElement("DIV");this.element_.className=s+" "+fo.CLASS_UNSELECTABLE;this.element_.appendChild(this.innerElement_);this.viewState_=null;this.minWidth_=i.minWidth!==undefined?i.minWidth:64;this.renderedVisible_=false;this.renderedWidth_=undefined;this.renderedHTML_="";var e=i.render?i.render:cv.render;oo.call(this,{element:this.element_,render:e,target:i.target});Ih.listen(this,Ph.getChangeEventType(cv.Property_.UNITS),this.handleUnitsChanged_,this);this.setUnits(i.units||lv.METRIC)};kh.inherits(cv,oo);cv.LEADING_DIGITS=[1,2,5];cv.prototype.getUnits=function(){return this.get(cv.Property_.UNITS)};cv.render=function(t){var i=t.frameState;if(!i){this.viewState_=null}else{this.viewState_=i.viewState}this.updateElement_()};cv.prototype.handleUnitsChanged_=function(){this.updateElement_()};cv.prototype.setUnits=function(t){this.set(cv.Property_.UNITS,t)};cv.prototype.updateElement_=function(){var t=this.viewState_;if(!t){if(this.renderedVisible_){this.element_.style.display="none";this.renderedVisible_=false}return}var i=t.center;var s=t.projection;var e=this.getUnits();var r=e==lv.DEGREES?Hh.DEGREES:Hh.METERS;var n=ia.getPointResolution(s,t.resolution,i,r);if(e!=lv.DEGREES){n*=s.getMetersPerUnit()}var h=this.minWidth_*n;var a="";if(e==lv.DEGREES){var o=ia.METERS_PER_UNIT[Hh.DEGREES];if(s.getUnits()==Hh.DEGREES){h*=o}else{n/=o}if(h<o/60){a="″";n*=3600}else if(h<o){a="′";n*=60}else{a="°"}}else if(e==lv.IMPERIAL){if(h<.9144){a="in";n/=.0254}else if(h<1609.344){a="ft";n/=.3048}else{a="mi";n/=1609.344}}else if(e==lv.NAUTICAL){n/=1852;a="nm"}else if(e==lv.METRIC){if(h<.001){a="μm";n*=1e6}else if(h<1){a="mm";n*=1e3}else if(h<1e3){a="m"}else{a="km";n/=1e3}}else if(e==lv.US){if(h<.9144){a="in";n*=39.37}else if(h<1609.344){a="ft";n/=.30480061}else{a="mi";n/=1609.3472}}else{Dh.assert(false,33)}var f=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));var u,v;while(true){u=cv.LEADING_DIGITS[(f%3+3)%3]*Math.pow(10,Math.floor(f/3));v=Math.round(u/n);if(isNaN(v)){this.element_.style.display="none";this.renderedVisible_=false;return}else if(v>=this.minWidth_){break}++f}var l=u+" "+a;if(this.renderedHTML_!=l){this.innerElement_.innerHTML=l;this.renderedHTML_=l}if(this.renderedWidth_!=v){this.innerElement_.style.width=v+"px";this.renderedWidth_=v}if(!this.renderedVisible_){this.element_.style.display="";this.renderedVisible_=true}};cv.Property_={UNITS:"units"};var dv={FRACTION:"fraction",PIXELS:"pixels"};var mv=function(t,i,s,e,r,n){Th.call(this);this.hitDetectionImage_=null;this.image_=!t?new Image:t;if(e!==null){this.image_.crossOrigin=e}this.canvas_=n?document.createElement("CANVAS"):null;this.color_=n;this.imageListenerKeys_=null;this.imageState_=r;this.size_=s;this.src_=i;this.tainting_=false;if(this.imageState_==Lo.LOADED){this.determineTainting_()}};kh.inherits(mv,Th);mv.get=function(t,i,s,e,r,n){var h=$o.iconImageCache;var a=h.get(i,e,n);if(!a){a=new mv(t,i,s,e,r,n);h.set(i,e,n,a)}return a};mv.prototype.determineTainting_=function(){var t=$a.createCanvasContext2D(1,1);try{t.drawImage(this.image_,0,0);t.getImageData(0,0,1,1)}catch(t){this.tainting_=true}};mv.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Ah.CHANGE)};mv.prototype.handleImageError_=function(){this.imageState_=Lo.ERROR;this.unlistenImage_();this.dispatchChangeEvent_()};mv.prototype.handleImageLoad_=function(){this.imageState_=Lo.LOADED;if(this.size_){this.image_.width=this.size_[0];this.image_.height=this.size_[1]}this.size_=[this.image_.width,this.image_.height];this.unlistenImage_();this.determineTainting_();this.replaceColor_();this.dispatchChangeEvent_()};mv.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_};mv.prototype.getImageState=function(){return this.imageState_};mv.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_){if(this.tainting_){var i=this.size_[0];var s=this.size_[1];var e=$a.createCanvasContext2D(i,s);e.fillRect(0,0,i,s);this.hitDetectionImage_=e.canvas}else{this.hitDetectionImage_=this.image_}}return this.hitDetectionImage_};mv.prototype.getSize=function(){return this.size_};mv.prototype.getSrc=function(){return this.src_};mv.prototype.load=function(){if(this.imageState_==Lo.IDLE){this.imageState_=Lo.LOADING;this.imageListenerKeys_=[Ih.listenOnce(this.image_,Ah.ERROR,this.handleImageError_,this),Ih.listenOnce(this.image_,Ah.LOAD,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}};mv.prototype.replaceColor_=function(){if(this.tainting_||this.color_===null){return}this.canvas_.width=this.image_.width;this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);var i=t.getImageData(0,0,this.image_.width,this.image_.height);var s=i.data;var e=this.color_[0]/255;var r=this.color_[1]/255;var n=this.color_[2]/255;for(var h=0,a=s.length;h<a;h+=4){s[h]*=e;s[h+1]*=r;s[h+2]*=n}t.putImageData(i,0,0)};mv.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ih.unlistenByKey);this.imageListenerKeys_=null};var pv={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var Mv=function(t){var i=t||{};this.anchor_=i.anchor!==undefined?i.anchor:[.5,.5];this.normalizedAnchor_=null;this.anchorOrigin_=i.anchorOrigin!==undefined?i.anchorOrigin:pv.TOP_LEFT;this.anchorXUnits_=i.anchorXUnits!==undefined?i.anchorXUnits:dv.FRACTION;this.anchorYUnits_=i.anchorYUnits!==undefined?i.anchorYUnits:dv.FRACTION;this.crossOrigin_=i.crossOrigin!==undefined?i.crossOrigin:null;var s=i.img!==undefined?i.img:null;var e=i.imgSize!==undefined?i.imgSize:null;var r=i.src;Dh.assert(!(r!==undefined&&s),4);Dh.assert(!s||s&&e,5);if((r===undefined||r.length===0)&&s){r=s.src||kh.getUid(s).toString()}Dh.assert(r!==undefined&&r.length>0,6);var n=i.src!==undefined?Lo.IDLE:Lo.LOADED;this.color_=i.color!==undefined?Uo.asArray(i.color):null;this.iconImage_=mv.get(s,r,e,this.crossOrigin_,n,this.color_);this.offset_=i.offset!==undefined?i.offset:[0,0];this.offsetOrigin_=i.offsetOrigin!==undefined?i.offsetOrigin:pv.TOP_LEFT;this.origin_=null;this.size_=i.size!==undefined?i.size:null;var h=i.opacity!==undefined?i.opacity:1;var a=i.rotateWithView!==undefined?i.rotateWithView:false;var o=i.rotation!==undefined?i.rotation:0;var f=i.scale!==undefined?i.scale:1;var u=i.snapToPixel!==undefined?i.snapToPixel:true;Iu.call(this,{opacity:h,rotation:o,scale:f,snapToPixel:u,rotateWithView:a})};kh.inherits(Mv,Iu);Mv.prototype.clone=function(){return new Mv({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||undefined,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:this.size_!==null?this.size_.slice():undefined,opacity:this.getOpacity(),scale:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})};Mv.prototype.getAnchor=function(){if(this.normalizedAnchor_){return this.normalizedAnchor_}var t=this.anchor_;var i=this.getSize();if(this.anchorXUnits_==dv.FRACTION||this.anchorYUnits_==dv.FRACTION){if(!i){return null}t=this.anchor_.slice();if(this.anchorXUnits_==dv.FRACTION){t[0]*=i[0]}if(this.anchorYUnits_==dv.FRACTION){t[1]*=i[1]}}if(this.anchorOrigin_!=pv.TOP_LEFT){if(!i){return null}if(t===this.anchor_){t=this.anchor_.slice()}if(this.anchorOrigin_==pv.TOP_RIGHT||this.anchorOrigin_==pv.BOTTOM_RIGHT){t[0]=-t[0]+i[0]}if(this.anchorOrigin_==pv.BOTTOM_LEFT||this.anchorOrigin_==pv.BOTTOM_RIGHT){t[1]=-t[1]+i[1]}}this.normalizedAnchor_=t;return this.normalizedAnchor_};Mv.prototype.getColor=function(){return this.color_};Mv.prototype.getImage=function(t){return this.iconImage_.getImage(t)};Mv.prototype.getImageSize=function(){return this.iconImage_.getSize()};Mv.prototype.getHitDetectionImageSize=function(){return this.getImageSize()};Mv.prototype.getImageState=function(){return this.iconImage_.getImageState()};Mv.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)};Mv.prototype.getOrigin=function(){if(this.origin_){return this.origin_}var t=this.offset_;if(this.offsetOrigin_!=pv.TOP_LEFT){var i=this.getSize();var s=this.iconImage_.getSize();if(!i||!s){return null}t=t.slice();if(this.offsetOrigin_==pv.TOP_RIGHT||this.offsetOrigin_==pv.BOTTOM_RIGHT){t[0]=s[0]-i[0]-t[0]}if(this.offsetOrigin_==pv.BOTTOM_LEFT||this.offsetOrigin_==pv.BOTTOM_RIGHT){t[1]=s[1]-i[1]-t[1]}}this.origin_=t;return this.origin_};Mv.prototype.getSrc=function(){return this.iconImage_.getSrc()};Mv.prototype.getSize=function(){return!this.size_?this.iconImage_.getSize():this.size_};Mv.prototype.listenImageChange=function(t,i){return Ih.listen(this.iconImage_,Ah.CHANGE,t,i)};Mv.prototype.load=function(){this.iconImage_.load()};Mv.prototype.unlistenImageChange=function(t,i){Ih.unlisten(this.iconImage_,Ah.CHANGE,t,i)};const zv=`<svg width="16" height="24" viewBox="0 0 16 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.0011 22.5728L13.2809 12.0132H2.72134L8.0011 22.5728Z" fill="#DEDEDE" stroke="#BFBFBF" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" fill="#D0021B"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="#D0021B" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="black" stroke-opacity="0.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n`;const _v=':host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;}:host[hidden],:host[stzh-hidden]{display:none}:host::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-olmap{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;position:relative;width:100%;aspect-ratio:1/1}stzh-olmap[hidden],stzh-olmap[stzh-hidden]{display:none}stzh-olmap::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}stzh-olmap *,stzh-olmap *::before,stzh-olmap *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}stzh-olmap .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}stzh-olmap .stzh-fylingfocus-focused{outline-style:none !important}stzh-olmap .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}@media print{stzh-olmap{page-break-inside:avoid;break-inside:avoid}}@media screen and (min-width: 600px){stzh-olmap{aspect-ratio:16/9}}@media screen and (min-width: 900px){stzh-olmap{aspect-ratio:21/9}}.stzh-olmap{}.stzh-olmap__map{position:absolute;width:100%;height:100%;top:0;left:0}.stzh-olmap__map--print{margin-top:var(--stzh-space-xxlarge);max-width:100%;height:auto}.stzh-olmap__print-image{display:block;max-width:100%}.stzh-olmap .ol-overlaycontainer-stopevent{touch-action:manipulation}.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom-in,.stzh-olmap .ol-zoom-out,.stzh-olmap .ol-rotate-reset{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-deca-font-size);line-height:var(--stzh-font-deca-text-line-height);letter-spacing:var(--stzh-font-deca-text-letter-spacing);position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border:none;border-radius:0;color:var(--stzh-color-primary);transition:all var(--stzh-base-transition-animation-speed) ease;background-color:var(--stzh-color-white);width:var(--stzh-form-input-small-height);height:var(--stzh-form-input-small-height);cursor:pointer}.stzh-olmap .ol-print stzh-icon,.stzh-olmap .ol-location stzh-icon,.stzh-olmap .ol-zoom-in stzh-icon,.stzh-olmap .ol-zoom-out stzh-icon,.stzh-olmap .ol-rotate-reset stzh-icon{--size:var(--stzh-icon-size-small)}.stzh-olmap .ol-print:hover,.stzh-olmap .ol-location:hover,.stzh-olmap .ol-zoom-in:hover,.stzh-olmap .ol-zoom-out:hover,.stzh-olmap .ol-rotate-reset:hover{color:var(--stzh-color-primary70);background:var(--stzh-color-secondary20)}.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{position:absolute;right:var(--stzh-space-xsmall);bottom:var(--stzh-space-xsmall);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--stzh-button-border-radius)}@media print{.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{display:none}}.stzh-olmap .ol-layer{left:var(--stzh-space-xsmall);right:auto;padding:var(--stzh-space-xxxsmall);border:none;cursor:pointer}.stzh-olmap .ol-layer__thumbnail{width:4.75rem;height:4.75rem;display:block}.stzh-olmap .ol-layer__text{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);position:absolute;bottom:0;left:0;right:0;text-align:left;background-color:var(--stzh-color-white);color:var(--stzh-color-primary);padding-left:calc(var(--stzh-space-xxxsmall) + 0.0625rem);padding-right:calc(var(--stzh-space-xxxsmall) + 0.0625rem)}.stzh-olmap .ol-layer:hover .ol-layer__text{color:var(--stzh-color-primary-hover)}.stzh-olmap .ol-location{margin-bottom:calc(\n var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2\n )}.stzh-olmap .ol-location:hover{color:var(--stzh-color-primary-hover);background:var(--stzh-color-white)}.stzh-olmap .ol-location.active{color:var(--stzh-color-white);background:var(--stzh-color-primary)}.stzh-olmap .ol-zoom{margin-bottom:calc(\n var(--stzh-form-input-small-height) + var(--stzh-space-xsmall) + var(--stzh-space-xxxsmall)\n );background-color:transparent;border-radius:var(--stzh-button-border-radius);overflow:hidden}.stzh-olmap .ol-zoom-in{margin-bottom:var(--stzh-space-xxxsmall)}.stzh-olmap .ol-rotate-reset{width:2rem;height:2rem;border-radius:50%;box-shadow:none;margin-right:calc((var(--stzh-form-input-small-height) - 2rem) / 2);margin-bottom:calc(\n var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2 +\n var(--stzh-space-xxxsmall)\n )}.stzh-olmap .ol-rotate-reset span{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-olmap .ol-rotate-reset svg{width:0.99rem;height:1.32188rem}.stzh-olmap .ol-hidden{display:none}.stzh-olmap .ol-compass{display:flex;align-items:center;justify-content:center}.stzh-olmap .ol-scale-line{position:absolute;left:var(--stzh-space-xsmall);bottom:var(--stzh-space-xsmall);margin-left:calc(\n 4.75rem +\n var(--stzh-space-xxxsmall) + var(--stzh-space-xsmall)\n )}.stzh-olmap .ol-scale-line-inner{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);position:relative;color:var(--stzh-color-black);text-align:center;filter:drop-shadow(-0.0625rem 0px 0px white) drop-shadow(0.0625rem 0px 0px white) drop-shadow(0px -0.0625rem 0px white) drop-shadow(0px 0.0625rem 0px white)}.stzh-olmap .ol-scale-line-inner::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:0.28125rem;border:0.0625rem solid var(--stzh-color-black);border-top:0}.stzh-olmap .ol-attribution{display:none}.stzh-olmap--has-no-layer-control .ol-scale-line{margin-left:0}.stzh-olmap--has-no-print-control .ol-zoom{margin-bottom:0}.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(\n var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall) +\n var(--stzh-space-xxxsmall)\n )}.stzh-olmap--has-location-control .ol-rotate-reset{margin-bottom:calc(\n var(--stzh-form-input-small-height) * 4 + var(--stzh-space-xsmall) * 3 +\n var(--stzh-space-xxxsmall)\n )}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-location{margin-bottom:calc(\n var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall) +\n var(--stzh-space-xxxsmall)\n )}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(\n var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2 +\n var(--stzh-space-xxxsmall)\n )}.stzh-olmap__popover{background-color:var(--stzh-color-grey10);width:18.75rem}@media screen and (max-width: 599px){.stzh-olmap__popover{position:fixed;right:0;bottom:0;left:0;width:100%;z-index:5;display:flex}}.stzh-olmap__popover-content{padding:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{padding:var(--stzh-space-small)}}@media screen and (min-width: 900px){.stzh-olmap__popover-content{padding:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-olmap__popover-content{padding:var(--stzh-space-xlarge)}}.stzh-olmap__popover-content stzh-heading{margin-bottom:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{aspect-ratio:2/1}}.stzh-olmap__popover-link{position:absolute;top:0;right:0;bottom:0;left:0}.stzh-olmap__popover-image{position:relative}@media screen and (max-width: 599px){.stzh-olmap__popover-image{width:8.75rem;min-width:8.75rem;height:8.75rem;max-height:8.75rem;overflow:hidden}}.stzh-olmap__popover-image img{width:100%}@media screen and (max-width: 599px){.stzh-olmap__popover-image img{position:absolute;top:50%;left:50%;width:100%;height:100%;object-fit:cover;transform:translate(-50%, -50%)}}.stzh-olmap__popover *{text-decoration:none}';const gv=_v;window.proj4=Ni;window.proj4.defs("EPSG:2056","+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs");const wv={anchor:[.5,1],anchorXUnits:"fraction",anchorYUnits:"fraction",scale:.5,src:`${window.stzhComponents.pathMedia}/olmap/marker.png`};const yv=Object.assign(Object.assign({},wv),{src:`${window.stzhComponents.pathMedia}/olmap/marker-active.png`});const bv=Object.assign(Object.assign({},wv),{anchor:[.5,.5],src:`${window.stzhComponents.pathMedia}/olmap/marker-position.png`});const xv=class{constructor(s){t(this,s);this.stzhInitialized=i(this,"stzhInitialized",7);this.stzhPostRender=i(this,"stzhPostRender",7);this.stzhMoveStart=i(this,"stzhMoveStart",7);this.stzhMoveEnd=i(this,"stzhMoveEnd",7);this.stzhMovePanZoom=i(this,"stzhMovePanZoom",7);this._layers={};this.geoPositionChanged=false;this.handlePostRender=()=>{this.stzhPostRender.emit({component:"stzh-olmap"})};this.handleDoubleClick=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleMoveStart=()=>{this.stzhMoveStart.emit({component:"stzh-olmap"})};this.handleMoveEnd=()=>{this.stzhMoveEnd.emit({component:"stzh-olmap"});this.writeExtentToUrl().catch()};this.handlePointerdrag=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleChangeResolution=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleInsideModalOpen=()=>{if(this.map){requestAnimationFrame((()=>{this.map.updateSize()}))}};this.handlePrintButtonClick=()=>{if(!this.printIframe){this.printIframe=document.createElement("iframe");Object.assign(this.printIframe.style,{height:"0px",width:"0px",position:"absolute",border:"none"});this.element.append(this.printIframe)}this.printIframe.innerHTML="";const t=this.printIframe.contentWindow;const i=this.constructor.style.replace('@charset "UTF-8";',"");const s=Array.from(document.querySelectorAll("link")).map((t=>t.outerHTML));let e;this.map.once("postcompose",(function(t){const i=t.context.canvas;e=i.toDataURL("image/png")}));this.map.renderSync();t.document.body.innerHTML=`\n ${s.join("")}\n\n <style type="text/css">\n ${i}\n </style>\n\n <div class="stzh-olmap__map stzh-olmap__map--print">\n <img class="stzh-olmap__print-image" src="${e}">\n ${this.element.querySelector(".ol-scale-line.ol-unselectable").outerHTML}\n </div>\n `;setTimeout((()=>{try{t.document.execCommand("print",false,null)}catch(i){t.print()}}),1e3)};this.localization=undefined;this.hostname="www.ogc.stadt-zuerich.ch";this.scaleControl=true;this.layerControl=true;this.printControl=true;this.locationControl=false;this.layer="streets";this.zoom=7;this.zoomLocation=7;this.center=[2683311,1247082];this.centerMarker=true;this.pinchRotateThreshold=.3;this.resolutions=[67.73333333333,33.8666666667,16.9333333333,8.4666666667,4.2333333333,2.1166666667,1.0583333333,.5291666667,.2645833333,.1322916667,.0661458333];this.writeExtentToUrlEnabled=false;this.layers={streets:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-streets.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"basiskarte_zuerich_gebaeudeschraegansicht",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}},satellite:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-satellite.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"orthofoto",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}}};this._initialExtent=undefined}layersWatcher(t){if(typeof t==="string"){this._layers=JSON.parse(t)}else{this._layers=t}}resolutionsWatcher(t){if(typeof t==="string"){this._resolutions=JSON.parse(t)}else{this._resolutions=t}}zoomWatcher(t){if(this.map){this.map.getView().setZoom(t)}}scaleControlWatcher(t){if(!this.map){return}if(t){this.scaleControlOl=new cv({units:"metric"});this.map.addControl(this.scaleControlOl)}else{if(this.scaleControl){this.map.removeControl(this.scaleControlOl)}this.scaleControlOl=null}}printControlWatcher(t){if(!this.map){return}if(t){this.printControlElement=document.createElement("button");this.printControlElement.className="ol-print";this.printControlElement.type="button";this.printControlElement.ariaLabel=this.localization.printLabel;this.printControlElement.addEventListener("click",this.handlePrintButtonClick);this.printControlElement.innerHTML='<stzh-icon name="print" class="ol-print__icon"></stzh-icon>';this.printControlOl=new oo({element:this.printControlElement});this.map.addControl(this.printControlOl)}else{if(this.printControlOl){this.map.removeControl(this.printControlOl)}this.printControlOl=null;this.printControlElement=null}}layerControlWatcher(t){if(!this.map||this.layersArray.length===1){return}if(t){this.layerControlElement=document.createElement("button");this.layerControlElement.className="ol-layer";this.layerControlElement.type="button";this.layerControlElement.addEventListener("click",(()=>{this.layer=this.layer==="streets"?"satellite":"streets"}));this.layerControlImageElement=document.createElement("img");this.layerControlImageElement.className="ol-layer__thumbnail";this.layerControlImageElement.setAttribute("role","presentation");this.layerControlImageElement.setAttribute("alt","");this.layerControlTextElement=document.createElement("span");this.layerControlTextElement.className="ol-layer__text";this.layerControlElement.appendChild(this.layerControlImageElement);this.layerControlElement.appendChild(this.layerControlTextElement);this.layerControlOl=new oo({element:this.layerControlElement});this.map.addControl(this.layerControlOl)}else{if(this.layerControlOl){this.map.removeControl(this.layerControlOl)}this.layerControlOl=null;this.layerControlElement=null;this.layerControlImageElement=null;this.layerControlTextElement=null}}locationControlWatcher(t){if(!this.map){return}if(t){this.locationControlElement=document.createElement("button");this.locationControlElement.type="button";this.locationControlElement.className="ol-location";this.locationControlElement.innerHTML='<stzh-icon name="target-bullet" class="ol-location__icon"></stzh-icon>';this.locationControlElement.addEventListener("click",(()=>{const t=this.geolocation.getTracking();if(t){this.disableLocationTracking().catch()}else{this.enableLocationTracking().catch()}}));this.locationControlOl=new oo({element:this.locationControlElement});this.geolocation=new ya({projection:this.map.getView().getProjection()});this.positionMarkerOl=new Ru;this.positionMarkerOl.setId("position");const t=new Au({image:new Mv(bv)});this.positionMarkerOl.setStyle(t);this.positionLayer.getSource().addFeature(this.positionMarkerOl);this.geolocation.on("change:position",(()=>{const t=this.geolocation.getPosition();this.positionMarkerOl.setGeometry(new va(t));if(!this.geoPositionChanged&&qh.containsExtent(this._layers[this.layer].options.extent,this.positionMarkerOl.getGeometry().getExtent())){this.geoPositionChanged=true;this.map.getView().setCenter(t);if(this.zoomLocation){this.map.getView().setZoom(this.zoomLocation)}}}));this.geolocation.on("change:tracking",(()=>{const t=this.geolocation.getTracking();this.positionMarkerOl.setGeometry(null);this.setLocationControlState(t)}));this.geolocation.on("error",(()=>{this.setLocationControlState(false)}));this.map.addControl(this.locationControlOl)}else{this.disableLocationTracking().catch();if(this.locationControlOl){this.map.removeControl(this.locationControlOl)}if(this.positionMarkerOl){this.positionLayer.getSource().removeFeature(this.positionMarkerOl)}this.locationControlOl=null;this.locationControlElement=null;this.geolocation=null;this.positionMarkerOl=null}}layerWatcher(t){if(!this.map){return}Object.entries(this.rasterLayers).forEach((([i,s])=>{if(i===t){s.setVisible(true);this.map.getView().set("projection",this.projections[t]);const e=this.layersArray.find((([t])=>t!==this.layer));if(e){if(this.layerControlImageElement){this.layerControlImageElement.src=e[1].thumbnailUrl}if(this.layerControlTextElement){let t="";if(i==="streets"){t=this.localization.streetsLayerTitle}else if(i==="satellite"){t=this.localization.satelliteLayerTitle}this.layerControlTextElement.textContent=e[1].title||t}}}else{s.setVisible(false)}}))}centerWatcher(t){if(typeof t==="string"){this._center=JSON.parse(t)}else{this._center=t}if(this.map&&!this._initialExtent){this.map.getView().setCenter(this._center);if(this.centerMarkerOl){this.centerMarkerOl.setGeometry(new va(this._center))}}}async centerMarkerWatcher(t){if(t){this.centerMarkerOl=await this.addIconMarker(this._center)}else if(this.centerMarkerOl){this.removeIconMarker(this.centerMarkerOl)}}async getMap(){return this.map}async writeExtentToUrl(){if(this.writeExtentToUrlEnabled){const t=this.map.getView();const i=t.calculateExtent(this.map.getSize());const[s,e,r,n]=i;const h=new URLSearchParams(window.location.search);h.set("extent[0]",s.toFixed(10));h.set("extent[1]",e.toFixed(10));h.set("extent[2]",r.toFixed(10));h.set("extent[3]",n.toFixed(10));const a=`${window.location.pathname}?${h.toString()}`;history.replaceState(null,"",a)}}async getVisibleMarkers(){const t=this.iconLayer.getSource();const i=t.getFeatures();if(i.length===0){return[]}const s=this.map.getView().calculateExtent(this.map.getSize());return i.filter((t=>{const i=t.getGeometry().getExtent();return qh.intersects(s,i)}))}async findMarkerById(t){const i=this.iconLayer.getSource().getFeatures();return i.find((i=>i.get("id")===t))}async addIconMarker(t,i){const s=new Ru({geometry:new va(t)});const e=new Au({image:new Mv(wv)});if(i&&i.id){s.setProperties({id:i.id});s.setId(i.id)}s.setProperties({stzh:i});s.setStyle(e);this.iconLayer.getSource().addFeature(s);return s}async addIconMarkers(t){for(const i of t){await this.addIconMarker(i.coordinates,i.props)}return true}async updateViewToFitMarkers(t=1e3){const i=this.iconLayer.getSource();const s=i.getFeatures();if(s.length===0){return}let e=qh.createEmpty();s.forEach((t=>{qh.extend(e,t.getGeometry().getExtent())}));this.map.getView().fit(e,{size:this.map.getSize(),duration:t})}async removeAllIconMarkers(){return this.iconLayer.getSource().clear()}async removeIconMarker(t){return this.iconLayer.getSource().removeFeature(t)}async setIconMarkerActive(t){t.setStyle(new Au({image:new Mv(yv)}))}async setIconMarkerInactive(t){t.setStyle(new Au({image:new Mv(wv)}))}async setAllIconMarkersInactive(){const t=this.iconLayer.getSource();const i=t.getFeatures();i.forEach((t=>{this.setIconMarkerInactive(t).catch((t=>console.error(t)))}))}async enableLocationTracking(t=true){this.setLocationControlState(true);this.geoPositionChanged=!t;if(this.geolocation){this.geolocation.setTracking(true)}}async disableLocationTracking(){this.setLocationControlState(false);if(this.geolocation){this.geolocation.setTracking(false)}}async getDistance(t,i){const s=new ov([t,i]);const e=Wh.getLength(s,{projection:this.map.getView().getProjection()});return e}handleLoad(){if(this.map){requestAnimationFrame((()=>{this.map.updateSize()}))}}showPopover(t,i){if(i.imageUri){this.popoverElement.innerHTML=`<div class="stzh-olmap__popover-image"><img src="${i.imageUri}" alt="${i.title}"></div>`}let s='<div class="stzh-olmap__popover-content">';if(i.title){s+=`<stzh-heading curve="p2">${i.title}</stzh-heading>`}if(i.text){s+=`<stzh-text size="milli" color="info">${i.text}</stzh-text>`}if(i.data&&i.data.length){i.data.map((t=>{s+=`<div class="stzh-poi-teaser-list-item">\n <stzh-icon name="${t.icon}"></stzh-icon>\n <stzh-text size="micro">\n ${t.text}\n </stzh-text>\n </div>`}))}s+="</div>";this.popoverElement.innerHTML+=s;if(i.href){this.popoverElement.innerHTML+=`<a href="${i.href}" class="stzh-olmap__popover-link"></a>`}const e=new Cu({element:this.popoverElement,position:t,positioning:"bottom-center",offset:[0,-50],autoPan:false,autoPanAnimation:{duration:300}});this.map.addOverlay(e);this.map.renderSync()}initializeMarkerHover(){this.map.on("pointermove",(t=>{const i=this.map.getEventPixel(t.originalEvent);const s=this.map.hasFeatureAtPixel(i,{layerFilter:t=>t===this.iconLayer});const e=this.map.getTargetElement();if(s){e.style.cursor="pointer"}else{e.style.cursor=""}}))}setLocationControlState(t){if(this.positionLayer){this.positionLayer.setVisible(t)}if(this.locationControlElement){this.locationControlElement.classList.toggle("active",t)}}createMap(){const t=document.createElement("stzh-icon");t.ariaLabel=this.localization.zoomInLabel;t.name="plus";t.addEventListener("click",(()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})}));const i=document.createElement("stzh-icon");i.ariaLabel=this.localization.zoomOutLabel;i.name="minus";i.addEventListener("click",(()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})}));const s=document.createElement("div");s.innerHTML=zv;const e=document.createElement("span");e.innerText=this.localization.rotateLabel;s.appendChild(e);const r=new Eu({controls:po.defaults({zoomOptions:{zoomInLabel:t,zoomOutLabel:i,zoomInTipLabel:"",zoomOutTipLabel:""},rotateOptions:{label:s,tipLabel:""}}),interactions:new xa([new xo,new go,new bo,new To({threshold:this.pinchRotateThreshold}),new Ao,new Io,new So,new No]),loadTilesWhileAnimating:true,loadTilesWhileInteracting:true,target:this.mapElement,logo:false});return r}createRasterLayer(t,i){return new uv({title:"wmts",type:"base",extent:i.extent,source:this.createLayerSource(t,i)})}createLayerSource(t,i){if(!this.projections){this.projections={}}this.projections[t]=new Zh({code:"EPSG:2056",extent:i.extent});return this.creatRasterSource(t,i)}creatRasterSource(t,i){const{url:s,layer:e,matrixSet:r,origin:n}=i;const h=[];for(let t=0;t<this._resolutions.length;t++){h.push(t)}const a=new $u({origin:n,resolutions:this._resolutions,matrixIds:h,tileSize:[512,512]});return new tv({url:s,tileGrid:a,style:"default",projection:this.projections[t],crossOrigin:"anonymous",layer:e,matrixSet:r,requestEncoding:"REST"})}createIconLayer(){return new vv({source:new hv({})})}initMap(){this.map=this.createMap();this.map.on("postrender",this.handlePostRender);this.map.on("movestart",this.handleMoveStart);this.map.on("dblclick",this.handleDoubleClick);this.map.on("moveend",this.handleMoveEnd);this.map.on("pointerdrag",this.handlePointerdrag);this.map.on("change:resolution",this.handleChangeResolution);this.layersArray=Object.entries(this._layers);if(this.layersArray.length>2){throw new Error("There are only two different layers allowed.")}this.rasterLayers={};this.layersArray.forEach((([t,i])=>{i.options.url=i.options.url.replace(/\{hostname\}/gi,this.hostname);this.rasterLayers[t]=this.createRasterLayer(t,i.options);this.map.addLayer(this.rasterLayers[t])}));this.positionLayer=this.createIconLayer();this.positionLayer.setVisible(false);this.map.addLayer(this.positionLayer);this.iconLayer=this.createIconLayer();this.map.addLayer(this.iconLayer);const t=new Ka({center:this._center,projection:this.projections[this.layer],zoom:this.zoom,resolutions:this._resolutions});if(this._initialExtent){t.fit(this._initialExtent,{size:this.map.getSize()})}this.map.setView(t);this.centerWatcher(this.center);this.scaleControlWatcher(this.scaleControl);this.printControlWatcher(this.printControl);this.locationControlWatcher(this.locationControl);this.layerControlWatcher(this.layerControl);this.layerWatcher(this.layer);this.centerMarkerWatcher(this.centerMarker);this.initializeMarkerHover();this.map.on("singleclick",(t=>{this.setAllIconMarkersInactive().catch();this.popoverElement.innerHTML="";this.map.forEachFeatureAtPixel(t.pixel,(t=>{if(t.getGeometry()instanceof va){this.setIconMarkerActive(t).catch();const i=t.getProperties();if(i.stzh){this.showPopover(i.geometry.flatCoordinates,i.stzh)}return true}}))}));requestAnimationFrame((()=>{this.stzhInitialized.emit({component:"stzh-olmap"})}));this.handleMoveEnd()}componentShouldUpdate(t,i,s){return["hostname","localization","layers","resolutions","pinchRotateThreshold"].includes(s)}async componentWillLoad(){this.layersWatcher(this.layers);this.resolutionsWatcher(this.resolutions);if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"olmap")}const t=new URLSearchParams(window.location.search);const i=[parseFloat(t.get("extent[0]")),parseFloat(t.get("extent[1]")),parseFloat(t.get("extent[2]")),parseFloat(t.get("extent[3]"))];if(!isNaN(i[0])&&!isNaN(i[1])&&!isNaN(i[2])&&!isNaN(i[3])){this._initialExtent=i}}componentWillUpdate(){if(this.map){this.map.setTarget(null);this.map=null}}componentDidRender(){if(this.map){return}this.initMap()}connectedCallback(){const t=this.element.closest("stzh-dialog");if(t){t.addEventListener("stzhOpen",this.handleInsideModalOpen)}}disconnectedCallback(){if(this.map){this.map.setTarget(null);this.map=null}const t=this.element.closest("stzh-dialog");if(t){t.removeEventListener("stzhOpen",this.handleInsideModalOpen)}}render(){const t={"stzh-olmap":true,"stzh-olmap--has-no-layer-control":!this.layerControl,"stzh-olmap--has-no-print-control":!this.printControl,"stzh-olmap--has-location-control":this.locationControl};return r(h,{key:"e3dcaa84f585422a2b9dcb4202958c63c4c55759"},r("div",{key:"e94097970244edad65ee79c6079f73adf19fe2df",class:t},r("div",{key:"2d93761f276134c2962862730139202eaab6e624",ref:t=>this.mapElement=t,class:"stzh-olmap__map"}),r("div",{key:"75e23dcb13b0f370bc92eb587ea56faba85cc4da",ref:t=>this.popoverElement=t,class:"stzh-olmap__popover"})))}get element(){return a(this)}static get watchers(){return{layers:["layersWatcher"],resolutions:["resolutionsWatcher"],zoom:["zoomWatcher"],scaleControl:["scaleControlWatcher"],printControl:["printControlWatcher"],layerControl:["layerControlWatcher"],locationControl:["locationControlWatcher"],layer:["layerWatcher"],center:["centerWatcher"],centerMarker:["centerMarkerWatcher"]}}};xv.style=gv;export{M as stzh_header,xv as stzh_olmap};
|
|
8
|
-
//# sourceMappingURL=p-
|
|
7
|
+
*/var Wh=function(t){this.radius=t};Wh.prototype.geodesicArea=function(t){return Wh.getArea_(t,this.radius)};Wh.prototype.haversineDistance=function(t,i){return Wh.getDistance_(t,i,this.radius)};Wh.prototype.offset=function(t,i,s){var e=Fh.toRadians(t[1]);var r=Fh.toRadians(t[0]);var n=i/this.radius;var h=Math.asin(Math.sin(e)*Math.cos(n)+Math.cos(e)*Math.sin(n)*Math.cos(s));var a=r+Math.atan2(Math.sin(s)*Math.sin(n)*Math.cos(e),Math.cos(n)-Math.sin(e)*Math.sin(h));return[Fh.toDegrees(a),Fh.toDegrees(h)]};Wh.DEFAULT_RADIUS=6371008.8;Wh.getLength=function(t,i){var s=i||{};var e=s.radius||Wh.DEFAULT_RADIUS;var r=s.projection||"EPSG:3857";t=t.clone().transform(r,"EPSG:4326");var n=t.getType();var h=0;var a,o,f,u,v,l;switch(n){case Gh.POINT:case Gh.MULTI_POINT:{break}case Gh.LINE_STRING:case Gh.LINEAR_RING:{a=t.getCoordinates();h=Wh.getLength_(a,e);break}case Gh.MULTI_LINE_STRING:case Gh.POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){h+=Wh.getLength_(a[f],e)}break}case Gh.MULTI_POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){o=a[f];for(v=0,l=o.length;v<l;++v){h+=Wh.getLength_(o[v],e)}}break}case Gh.GEOMETRY_COLLECTION:{var c=t.getGeometries();for(f=0,u=c.length;f<u;++f){h+=Wh.getLength(c[f],i)}break}default:{throw new Error("Unsupported geometry type: "+n)}}return h};Wh.getLength_=function(t,i){var s=0;for(var e=0,r=t.length;e<r-1;++e){s+=Wh.getDistance_(t[e],t[e+1],i)}return s};Wh.getDistance_=function(t,i,s){var e=Fh.toRadians(t[1]);var r=Fh.toRadians(i[1]);var n=(r-e)/2;var h=Fh.toRadians(i[0]-t[0])/2;var a=Math.sin(n)*Math.sin(n)+Math.sin(h)*Math.sin(h)*Math.cos(e)*Math.cos(r);return 2*s*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))};Wh.getArea=function(t,i){var s=i||{};var e=s.radius||Wh.DEFAULT_RADIUS;var r=s.projection||"EPSG:3857";t=t.clone().transform(r,"EPSG:4326");var n=t.getType();var h=0;var a,o,f,u,v,l;switch(n){case Gh.POINT:case Gh.MULTI_POINT:case Gh.LINE_STRING:case Gh.MULTI_LINE_STRING:case Gh.LINEAR_RING:{break}case Gh.POLYGON:{a=t.getCoordinates();h=Math.abs(Wh.getArea_(a[0],e));for(f=1,u=a.length;f<u;++f){h-=Math.abs(Wh.getArea_(a[f],e))}break}case Gh.MULTI_POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){o=a[f];h+=Math.abs(Wh.getArea_(o[0],e));for(v=1,l=o.length;v<l;++v){h-=Math.abs(Wh.getArea_(o[v],e))}}break}case Gh.GEOMETRY_COLLECTION:{var c=t.getGeometries();for(f=0,u=c.length;f<u;++f){h+=Wh.getArea(c[f],i)}break}default:{throw new Error("Unsupported geometry type: "+n)}}return h};Wh.getArea_=function(t,i){var s=0,e=t.length;var r=t[e-1][0];var n=t[e-1][1];for(var h=0;h<e;h++){var a=t[h][0],o=t[h][1];s+=Fh.toRadians(a-r)*(2+Math.sin(Fh.toRadians(n))+Math.sin(Fh.toRadians(o)));r=a;n=o}return s*i*i/2};var jh={};jh.binarySearch=function(t,i,s){var e,r;var n=s||jh.numberSafeCompareFunction;var h=0;var a=t.length;var o=false;while(h<a){e=h+(a-h>>1);r=+n(t[e],i);if(r<0){h=e+1}else{a=e;o=!r}}return o?h:~h};jh.numberSafeCompareFunction=function(t,i){return t>i?1:t<i?-1:0};jh.includes=function(t,i){return t.indexOf(i)>=0};jh.linearFindNearest=function(t,i,s){var e=t.length;if(t[0]<=i){return 0}else if(i<=t[e-1]){return e-1}else{var r;if(s>0){for(r=1;r<e;++r){if(t[r]<i){return r-1}}}else if(s<0){for(r=1;r<e;++r){if(t[r]<=i){return r}}}else{for(r=1;r<e;++r){if(t[r]==i){return r}else if(t[r]<i){if(t[r-1]-i<i-t[r]){return r-1}else{return r}}}}return e-1}};jh.reverseSubArray=function(t,i,s){while(i<s){var e=t[i];t[i]=t[s];t[s]=e;++i;--s}};jh.extend=function(t,i){var s;var e=Array.isArray(i)?i:[i];var r=e.length;for(s=0;s<r;s++){t[t.length]=e[s]}};jh.remove=function(t,i){var s=t.indexOf(i);var e=s>-1;if(e){t.splice(s,1)}return e};jh.find=function(t,i){var s=t.length>>>0;var e;for(var r=0;r<s;r++){e=t[r];if(i(e,r,t)){return e}}return null};jh.equals=function(t,i){var s=t.length;if(s!==i.length){return false}for(var e=0;e<s;e++){if(t[e]!==i[e]){return false}}return true};jh.stableSort=function(t,i){var s=t.length;var e=Array(t.length);var r;for(r=0;r<s;r++){e[r]={index:r,value:t[r]}}e.sort((function(t,s){return i(t.value,s.value)||t.index-s.index}));for(r=0;r<t.length;r++){t[r]=e[r].value}};jh.findIndex=function(t,i){var s;var e=!t.every((function(e,r){s=r;return!i(e,r,t)}));return e?s:-1};jh.isSorted=function(t,i,s){var e=i||jh.numberSafeCompareFunction;return t.every((function(i,r){if(r===0){return true}var n=e(t[r-1],i);return!(n>0||s&&n===0)}))};var Vh={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var Uh={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};var qh={};qh.boundingExtent=function(t){var i=qh.createEmpty();for(var s=0,e=t.length;s<e;++s){qh.extendCoordinate(i,t[s])}return i};qh.boundingExtentXYs_=function(t,i,s){var e=Math.min.apply(null,t);var r=Math.min.apply(null,i);var n=Math.max.apply(null,t);var h=Math.max.apply(null,i);return qh.createOrUpdate(e,r,n,h,s)};qh.buffer=function(t,i,s){if(s){s[0]=t[0]-i;s[1]=t[1]-i;s[2]=t[2]+i;s[3]=t[3]+i;return s}else{return[t[0]-i,t[1]-i,t[2]+i,t[3]+i]}};qh.clone=function(t,i){if(i){i[0]=t[0];i[1]=t[1];i[2]=t[2];i[3]=t[3];return i}else{return t.slice()}};qh.closestSquaredDistanceXY=function(t,i,s){var e,r;if(i<t[0]){e=t[0]-i}else if(t[2]<i){e=i-t[2]}else{e=0}if(s<t[1]){r=t[1]-s}else if(t[3]<s){r=s-t[3]}else{r=0}return e*e+r*r};qh.containsCoordinate=function(t,i){return qh.containsXY(t,i[0],i[1])};qh.containsExtent=function(t,i){return t[0]<=i[0]&&i[2]<=t[2]&&t[1]<=i[1]&&i[3]<=t[3]};qh.containsXY=function(t,i,s){return t[0]<=i&&i<=t[2]&&t[1]<=s&&s<=t[3]};qh.coordinateRelationship=function(t,i){var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=i[0];var a=i[1];var o=Uh.UNKNOWN;if(h<s){o=o|Uh.LEFT}else if(h>r){o=o|Uh.RIGHT}if(a<e){o=o|Uh.BELOW}else if(a>n){o=o|Uh.ABOVE}if(o===Uh.UNKNOWN){o=Uh.INTERSECTING}return o};qh.createEmpty=function(){return[Infinity,Infinity,-Infinity,-Infinity]};qh.createOrUpdate=function(t,i,s,e,r){if(r){r[0]=t;r[1]=i;r[2]=s;r[3]=e;return r}else{return[t,i,s,e]}};qh.createOrUpdateEmpty=function(t){return qh.createOrUpdate(Infinity,Infinity,-Infinity,-Infinity,t)};qh.createOrUpdateFromCoordinate=function(t,i){var s=t[0];var e=t[1];return qh.createOrUpdate(s,e,s,e,i)};qh.createOrUpdateFromCoordinates=function(t,i){var s=qh.createOrUpdateEmpty(i);return qh.extendCoordinates(s,t)};qh.createOrUpdateFromFlatCoordinates=function(t,i,s,e,r){var n=qh.createOrUpdateEmpty(r);return qh.extendFlatCoordinates(n,t,i,s,e)};qh.createOrUpdateFromRings=function(t,i){var s=qh.createOrUpdateEmpty(i);return qh.extendRings(s,t)};qh.equals=function(t,i){return t[0]==i[0]&&t[2]==i[2]&&t[1]==i[1]&&t[3]==i[3]};qh.extend=function(t,i){if(i[0]<t[0]){t[0]=i[0]}if(i[2]>t[2]){t[2]=i[2]}if(i[1]<t[1]){t[1]=i[1]}if(i[3]>t[3]){t[3]=i[3]}return t};qh.extendCoordinate=function(t,i){if(i[0]<t[0]){t[0]=i[0]}if(i[0]>t[2]){t[2]=i[0]}if(i[1]<t[1]){t[1]=i[1]}if(i[1]>t[3]){t[3]=i[1]}};qh.extendCoordinates=function(t,i){var s,e;for(s=0,e=i.length;s<e;++s){qh.extendCoordinate(t,i[s])}return t};qh.extendFlatCoordinates=function(t,i,s,e,r){for(;s<e;s+=r){qh.extendXY(t,i[s],i[s+1])}return t};qh.extendRings=function(t,i){var s,e;for(s=0,e=i.length;s<e;++s){qh.extendCoordinates(t,i[s])}return t};qh.extendXY=function(t,i,s){t[0]=Math.min(t[0],i);t[1]=Math.min(t[1],s);t[2]=Math.max(t[2],i);t[3]=Math.max(t[3],s)};qh.forEachCorner=function(t,i,s){var e;e=i.call(s,qh.getBottomLeft(t));if(e){return e}e=i.call(s,qh.getBottomRight(t));if(e){return e}e=i.call(s,qh.getTopRight(t));if(e){return e}e=i.call(s,qh.getTopLeft(t));if(e){return e}return false};qh.getArea=function(t){var i=0;if(!qh.isEmpty(t)){i=qh.getWidth(t)*qh.getHeight(t)}return i};qh.getBottomLeft=function(t){return[t[0],t[1]]};qh.getBottomRight=function(t){return[t[2],t[1]]};qh.getCenter=function(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]};qh.getCorner=function(t,i){var s;if(i===Vh.BOTTOM_LEFT){s=qh.getBottomLeft(t)}else if(i===Vh.BOTTOM_RIGHT){s=qh.getBottomRight(t)}else if(i===Vh.TOP_LEFT){s=qh.getTopLeft(t)}else if(i===Vh.TOP_RIGHT){s=qh.getTopRight(t)}else{Dh.assert(false,13)}return s};qh.getEnlargedArea=function(t,i){var s=Math.min(t[0],i[0]);var e=Math.min(t[1],i[1]);var r=Math.max(t[2],i[2]);var n=Math.max(t[3],i[3]);return(r-s)*(n-e)};qh.getForViewAndSize=function(t,i,s,e,r){var n=i*e[0]/2;var h=i*e[1]/2;var a=Math.cos(s);var o=Math.sin(s);var f=n*a;var u=n*o;var v=h*a;var l=h*o;var c=t[0];var d=t[1];var m=c-f+l;var p=c-f-l;var M=c+f-l;var z=c+f+l;var _=d-u-v;var g=d-u+v;var w=d+u+v;var y=d+u-v;return qh.createOrUpdate(Math.min(m,p,M,z),Math.min(_,g,w,y),Math.max(m,p,M,z),Math.max(_,g,w,y),r)};qh.getHeight=function(t){return t[3]-t[1]};qh.getIntersectionArea=function(t,i){var s=qh.getIntersection(t,i);return qh.getArea(s)};qh.getIntersection=function(t,i,s){var e=s?s:qh.createEmpty();if(qh.intersects(t,i)){if(t[0]>i[0]){e[0]=t[0]}else{e[0]=i[0]}if(t[1]>i[1]){e[1]=t[1]}else{e[1]=i[1]}if(t[2]<i[2]){e[2]=t[2]}else{e[2]=i[2]}if(t[3]<i[3]){e[3]=t[3]}else{e[3]=i[3]}}return e};qh.getMargin=function(t){return qh.getWidth(t)+qh.getHeight(t)};qh.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]};qh.getTopLeft=function(t){return[t[0],t[3]]};qh.getTopRight=function(t){return[t[2],t[3]]};qh.getWidth=function(t){return t[2]-t[0]};qh.intersects=function(t,i){return t[0]<=i[2]&&t[2]>=i[0]&&t[1]<=i[3]&&t[3]>=i[1]};qh.isEmpty=function(t){return t[2]<t[0]||t[3]<t[1]};qh.returnOrUpdate=function(t,i){if(i){i[0]=t[0];i[1]=t[1];i[2]=t[2];i[3]=t[3];return i}else{return t}};qh.scaleFromCenter=function(t,i){var s=(t[2]-t[0])/2*(i-1);var e=(t[3]-t[1])/2*(i-1);t[0]-=s;t[2]+=s;t[1]-=e;t[3]+=e};qh.intersectsSegment=function(t,i,s){var e=false;var r=qh.coordinateRelationship(t,i);var n=qh.coordinateRelationship(t,s);if(r===Uh.INTERSECTING||n===Uh.INTERSECTING){e=true}else{var h=t[0];var a=t[1];var o=t[2];var f=t[3];var u=i[0];var v=i[1];var l=s[0];var c=s[1];var d=(c-v)/(l-u);var m,p;if(!!(n&Uh.ABOVE)&&!(r&Uh.ABOVE)){m=l-(c-f)/d;e=m>=h&&m<=o}if(!e&&!!(n&Uh.RIGHT)&&!(r&Uh.RIGHT)){p=c-(l-o)*d;e=p>=a&&p<=f}if(!e&&!!(n&Uh.BELOW)&&!(r&Uh.BELOW)){m=l-(c-a)/d;e=m>=h&&m<=o}if(!e&&!!(n&Uh.LEFT)&&!(r&Uh.LEFT)){p=c-(l-h)*d;e=p>=a&&p<=f}}return e};qh.applyTransform=function(t,i,s){var e=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];i(e,e,2);var r=[e[0],e[2],e[4],e[6]];var n=[e[1],e[3],e[5],e[7]];return qh.boundingExtentXYs_(r,n,s)};var Xh={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};var Yh={};Yh.TRUE=function(){return true};Yh.FALSE=function(){return false};var Bh={};Bh.transform2D=function(t,i,s,e,r,n){var h=n?n:[];var a=0;var o;for(o=i;o<s;o+=e){var f=t[o];var u=t[o+1];h[a++]=r[0]*f+r[2]*u+r[4];h[a++]=r[1]*f+r[3]*u+r[5]}if(n&&h.length!=a){h.length=a}return h};Bh.rotate=function(t,i,s,e,r,n,h){var a=h?h:[];var o=Math.cos(r);var f=Math.sin(r);var u=n[0];var v=n[1];var l=0;for(var c=i;c<s;c+=e){var d=t[c]-u;var m=t[c+1]-v;a[l++]=u+d*o-m*f;a[l++]=v+d*f+m*o;for(var p=c+2;p<c+e;++p){a[l++]=t[p]}}if(h&&a.length!=l){a.length=l}return a};Bh.scale=function(t,i,s,e,r,n,h,a){var o=a?a:[];var f=h[0];var u=h[1];var v=0;for(var l=i;l<s;l+=e){var c=t[l]-f;var d=t[l+1]-u;o[v++]=f+r*c;o[v++]=u+n*d;for(var m=l+2;m<l+e;++m){o[v++]=t[m]}}if(a&&o.length!=v){o.length=v}return o};Bh.translate=function(t,i,s,e,r,n,h){var a=h?h:[];var o=0;var f,u;for(f=i;f<s;f+=e){a[o++]=t[f]+r;a[o++]=t[f+1]+n;for(u=f+2;u<f+e;++u){a[o++]=t[u]}}if(h&&a.length!=o){a.length=o}return a};var Hh={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"};Hh.METERS_PER_UNIT={};Hh.METERS_PER_UNIT[Hh.DEGREES]=2*Math.PI*6370997/360;Hh.METERS_PER_UNIT[Hh.FEET]=.3048;Hh.METERS_PER_UNIT[Hh.METERS]=1;Hh.METERS_PER_UNIT[Hh.USFEET]=1200/3937;var Jh={};Jh.cache_=null;Jh.set=function(t){Jh.cache_=t};Jh.get=function(){return Jh.cache_||window["proj4"]};var Zh=function(t){this.code_=t.code;this.units_=t.units;this.extent_=t.extent!==undefined?t.extent:null;this.worldExtent_=t.worldExtent!==undefined?t.worldExtent:null;this.axisOrientation_=t.axisOrientation!==undefined?t.axisOrientation:"enu";this.global_=t.global!==undefined?t.global:false;this.canWrapX_=!!(this.global_&&this.extent_);this.getPointResolutionFunc_=t.getPointResolution;this.defaultTileGrid_=null;this.metersPerUnit_=t.metersPerUnit;var i=t.code;if(kh.ENABLE_PROJ4JS){var s=Jh.get();if(typeof s=="function"){var e=s.defs(i);if(e!==undefined){if(e.axis!==undefined&&t.axisOrientation===undefined){this.axisOrientation_=e.axis}if(t.metersPerUnit===undefined){this.metersPerUnit_=e.to_meter}if(t.units===undefined){this.units_=e.units}}}}};Zh.prototype.canWrapX=function(){return this.canWrapX_};Zh.prototype.getCode=function(){return this.code_};Zh.prototype.getExtent=function(){return this.extent_};Zh.prototype.getUnits=function(){return this.units_};Zh.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Hh.METERS_PER_UNIT[this.units_]};Zh.prototype.getWorldExtent=function(){return this.worldExtent_};Zh.prototype.getAxisOrientation=function(){return this.axisOrientation_};Zh.prototype.isGlobal=function(){return this.global_};Zh.prototype.setGlobal=function(t){this.global_=t;this.canWrapX_=!!(t&&this.extent_)};Zh.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_};Zh.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t};Zh.prototype.setExtent=function(t){this.extent_=t;this.canWrapX_=!!(this.global_&&t)};Zh.prototype.setWorldExtent=function(t){this.worldExtent_=t};Zh.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t};Zh.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var Kh={};Kh.Projection_=function(t){Zh.call(this,{code:t,units:Hh.METERS,extent:Kh.EXTENT,global:true,worldExtent:Kh.WORLD_EXTENT,getPointResolution:function(t,i){return t/Fh.cosh(i[1]/Kh.RADIUS)}})};kh.inherits(Kh.Projection_,Zh);Kh.RADIUS=6378137;Kh.HALF_SIZE=Math.PI*Kh.RADIUS;Kh.EXTENT=[-Kh.HALF_SIZE,-Kh.HALF_SIZE,Kh.HALF_SIZE,Kh.HALF_SIZE];Kh.WORLD_EXTENT=[-180,-85,180,85];Kh.PROJECTIONS=[new Kh.Projection_("EPSG:3857"),new Kh.Projection_("EPSG:102100"),new Kh.Projection_("EPSG:102113"),new Kh.Projection_("EPSG:900913"),new Kh.Projection_("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Kh.Projection_("urn:ogc:def:crs:EPSG::3857"),new Kh.Projection_("http://www.opengis.net/gml/srs/epsg.xml#3857")];Kh.fromEPSG4326=function(t,i,s){var e=t.length,r=s>1?s:2,n=i;if(n===undefined){if(r>2){n=t.slice()}else{n=new Array(e)}}var h=Kh.HALF_SIZE;for(var a=0;a<e;a+=r){n[a]=h*t[a]/180;var o=Kh.RADIUS*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));if(o>h){o=h}else if(o<-h){o=-h}n[a+1]=o}return n};Kh.toEPSG4326=function(t,i,s){var e=t.length,r=s>1?s:2,n=i;if(n===undefined){if(r>2){n=t.slice()}else{n=new Array(e)}}for(var h=0;h<e;h+=r){n[h]=180*t[h]/Kh.HALF_SIZE;n[h+1]=360*Math.atan(Math.exp(t[h+1]/Kh.RADIUS))/Math.PI-90}return n};var $h={};$h.Projection_=function(t,i){Zh.call(this,{code:t,units:Hh.DEGREES,extent:$h.EXTENT,axisOrientation:i,global:true,metersPerUnit:$h.METERS_PER_UNIT,worldExtent:$h.EXTENT})};kh.inherits($h.Projection_,Zh);$h.RADIUS=6378137;$h.EXTENT=[-180,-90,180,90];$h.METERS_PER_UNIT=Math.PI*$h.RADIUS/180;$h.PROJECTIONS=[new $h.Projection_("CRS:84"),new $h.Projection_("EPSG:4326","neu"),new $h.Projection_("urn:ogc:def:crs:EPSG::4326","neu"),new $h.Projection_("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new $h.Projection_("urn:ogc:def:crs:OGC:1.3:CRS84"),new $h.Projection_("urn:ogc:def:crs:OGC:2:84"),new $h.Projection_("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new $h.Projection_("urn:x-ogc:def:crs:EPSG:4326","neu")];var Qh={};Qh.cache_={};Qh.clear=function(){Qh.cache_={}};Qh.get=function(t){var i=Qh.cache_;return i[t]||null};Qh.add=function(t,i){var s=Qh.cache_;s[t]=i};var ta={};ta.cache_={};ta.clear=function(){ta.cache_={}};ta.add=function(t,i,s){var e=t.getCode();var r=i.getCode();var n=ta.cache_;if(!(e in n)){n[e]={}}n[e][r]=s};ta.remove=function(t,i){var s=t.getCode();var e=i.getCode();var r=ta.cache_;var n=r[s][e];delete r[s][e];if(Ch.isEmpty(r[s])){delete r[s]}return n};ta.get=function(t,i){var s;var e=ta.cache_;if(t in e&&i in e[t]){s=e[t][i]}return s};var ia={};ia.METERS_PER_UNIT=Hh.METERS_PER_UNIT;ia.SPHERE_=new Wh(Wh.DEFAULT_RADIUS);if(kh.ENABLE_PROJ4JS){ia.setProj4=function(t){Jh.set(t)}}ia.getPointResolution=function(t,i,s,e){t=ia.get(t);var r;var n=t.getPointResolutionFunc();if(n){r=n(i,s)}else{var h=t.getUnits();if(h==Hh.DEGREES&&!e||e==Hh.DEGREES){r=i}else{var a=ia.getTransformFromProjections(t,ia.get("EPSG:4326"));var o=[s[0]-i/2,s[1],s[0]+i/2,s[1],s[0],s[1]-i/2,s[0],s[1]+i/2];o=a(o,o,2);var f=ia.SPHERE_.haversineDistance(o.slice(0,2),o.slice(2,4));var u=ia.SPHERE_.haversineDistance(o.slice(4,6),o.slice(6,8));r=(f+u)/2;var v=e?Hh.METERS_PER_UNIT[e]:t.getMetersPerUnit();if(v!==undefined){r/=v}}}return r};ia.addEquivalentProjections=function(t){ia.addProjections(t);t.forEach((function(i){t.forEach((function(t){if(i!==t){ta.add(i,t,ia.cloneTransform)}}))}))};ia.addEquivalentTransforms=function(t,i,s,e){t.forEach((function(t){i.forEach((function(i){ta.add(t,i,s);ta.add(i,t,e)}))}))};ia.addProjection=function(t){Qh.add(t.getCode(),t);ta.add(t,t,ia.cloneTransform)};ia.addProjections=function(t){t.forEach(ia.addProjection)};ia.clearAllProjections=function(){Qh.clear();ta.clear()};ia.createProjection=function(t,i){if(!t){return ia.get(i)}else if(typeof t==="string"){return ia.get(t)}else{return t}};ia.addCoordinateTransforms=function(t,i,s,e){var r=ia.get(t);var n=ia.get(i);ta.add(r,n,ia.createTransformFromCoordinateTransform(s));ta.add(n,r,ia.createTransformFromCoordinateTransform(e))};ia.createTransformFromCoordinateTransform=function(t){return function(i,s,e){var r=i.length;var n=e!==undefined?e:2;var h=s!==undefined?s:new Array(r);var a,o,f;for(o=0;o<r;o+=n){a=t([i[o],i[o+1]]);h[o]=a[0];h[o+1]=a[1];for(f=n-1;f>=2;--f){h[o+f]=i[o+f]}}return h}};ia.fromLonLat=function(t,i){return ia.transform(t,"EPSG:4326",i!==undefined?i:"EPSG:3857")};ia.toLonLat=function(t,i){var s=ia.transform(t,i!==undefined?i:"EPSG:3857","EPSG:4326");var e=s[0];if(e<-180||e>180){s[0]=Fh.modulo(e+180,360)-180}return s};ia.get=function(t){var i=null;if(t instanceof Zh){i=t}else if(typeof t==="string"){var s=t;i=Qh.get(s);if(kh.ENABLE_PROJ4JS&&!i){var e=Jh.get();if(typeof e=="function"&&e.defs(s)!==undefined){i=new Zh({code:s});ia.addProjection(i)}}}return i};ia.equivalent=function(t,i){if(t===i){return true}var s=t.getUnits()===i.getUnits();if(t.getCode()===i.getCode()){return s}else{var e=ia.getTransformFromProjections(t,i);return e===ia.cloneTransform&&s}};ia.getTransform=function(t,i){var s=ia.get(t);var e=ia.get(i);return ia.getTransformFromProjections(s,e)};ia.getTransformFromProjections=function(t,i){var s=t.getCode();var e=i.getCode();var r=ta.get(s,e);if(kh.ENABLE_PROJ4JS&&!r){var n=Jh.get();if(typeof n=="function"){var h=n.defs(s);var a=n.defs(e);if(h!==undefined&&a!==undefined){if(h===a){ia.addEquivalentProjections([i,t])}else{var o=n(e,s);ia.addCoordinateTransforms(i,t,o.forward,o.inverse)}r=ta.get(s,e)}}}if(!r){r=ia.identityTransform}return r};ia.identityTransform=function(t,i,s){if(i!==undefined&&t!==i){for(var e=0,r=t.length;e<r;++e){i[e]=t[e]}t=i}return t};ia.cloneTransform=function(t,i,s){var e;if(i!==undefined){for(var r=0,n=t.length;r<n;++r){i[r]=t[r]}e=i}else{e=t.slice()}return e};ia.transform=function(t,i,s){var e=ia.getTransform(i,s);return e(t,undefined,t.length)};ia.transformExtent=function(t,i,s){var e=ia.getTransform(i,s);return qh.applyTransform(t,e)};ia.transformWithProjections=function(t,i,s){var e=ia.getTransformFromProjections(i,s);return e(t)};ia.addCommon=function(){ia.addEquivalentProjections(Kh.PROJECTIONS);ia.addEquivalentProjections($h.PROJECTIONS);ia.addEquivalentTransforms($h.PROJECTIONS,Kh.PROJECTIONS,Kh.fromEPSG4326,Kh.toEPSG4326)};ia.addCommon();var sa={};sa.tmp_=new Array(6);sa.create=function(){return[1,0,0,1,0,0]};sa.reset=function(t){return sa.set(t,1,0,0,1,0,0)};sa.multiply=function(t,i){var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=t[4];var a=t[5];var o=i[0];var f=i[1];var u=i[2];var v=i[3];var l=i[4];var c=i[5];t[0]=s*o+r*f;t[1]=e*o+n*f;t[2]=s*u+r*v;t[3]=e*u+n*v;t[4]=s*l+r*c+h;t[5]=e*l+n*c+a;return t};sa.set=function(t,i,s,e,r,n,h){t[0]=i;t[1]=s;t[2]=e;t[3]=r;t[4]=n;t[5]=h;return t};sa.setFromArray=function(t,i){t[0]=i[0];t[1]=i[1];t[2]=i[2];t[3]=i[3];t[4]=i[4];t[5]=i[5];return t};sa.apply=function(t,i){var s=i[0],e=i[1];i[0]=t[0]*s+t[2]*e+t[4];i[1]=t[1]*s+t[3]*e+t[5];return i};sa.rotate=function(t,i){var s=Math.cos(i);var e=Math.sin(i);return sa.multiply(t,sa.set(sa.tmp_,s,e,-e,s,0,0))};sa.scale=function(t,i,s){return sa.multiply(t,sa.set(sa.tmp_,i,0,0,s,0,0))};sa.translate=function(t,i,s){return sa.multiply(t,sa.set(sa.tmp_,1,0,0,1,i,s))};sa.compose=function(t,i,s,e,r,n,h,a){var o=Math.sin(n);var f=Math.cos(n);t[0]=e*f;t[1]=r*o;t[2]=-e*o;t[3]=r*f;t[4]=h*e*f-a*e*o+i;t[5]=h*r*o+a*r*f+s;return t};sa.invert=function(t){var i=sa.determinant(t);Dh.assert(i!==0,32);var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=t[4];var a=t[5];t[0]=n/i;t[1]=-e/i;t[2]=-r/i;t[3]=s/i;t[4]=(r*a-n*h)/i;t[5]=-(s*a-e*h)/i;return t};sa.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};var ea=function(){Ph.call(this);this.extent_=qh.createEmpty();this.extentRevision_=-1;this.simplifiedGeometryCache={};this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=0;this.tmpTransform_=sa.create()};kh.inherits(ea,Ph);ea.prototype.clone=function(){};ea.prototype.closestPointXY=function(t,i,s,e){};ea.prototype.getClosestPoint=function(t,i){var s=i?i:[NaN,NaN];this.closestPointXY(t[0],t[1],s,Infinity);return s};ea.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])};ea.prototype.computeExtent=function(t){};ea.prototype.containsXY=Yh.FALSE;ea.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){this.extent_=this.computeExtent(this.extent_);this.extentRevision_=this.getRevision()}return qh.returnOrUpdate(this.extent_,t)};ea.prototype.rotate=function(t,i){};ea.prototype.scale=function(t,i,s){};ea.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)};ea.prototype.getSimplifiedGeometry=function(t){};ea.prototype.getType=function(){};ea.prototype.applyTransform=function(t){};ea.prototype.intersectsExtent=function(t){};ea.prototype.translate=function(t,i){};ea.prototype.transform=function(t,i){var s=this.tmpTransform_;t=ia.get(t);var e=t.getUnits()==Hh.TILE_PIXELS?function(e,r,n){var h=t.getExtent();var a=t.getWorldExtent();var o=qh.getHeight(a)/qh.getHeight(h);sa.compose(s,a[0],a[3],o,-o,0,0,0);Bh.transform2D(e,0,e.length,n,s,r);return ia.getTransform(t,i)(e,r,n)}:ia.getTransform(t,i);this.applyTransform(e);return this};var ra=function(){ea.call(this);this.layout=Xh.XY;this.stride=2;this.flatCoordinates=null};kh.inherits(ra,ea);ra.getLayoutForStride_=function(t){var i;if(t==2){i=Xh.XY}else if(t==3){i=Xh.XYZ}else if(t==4){i=Xh.XYZM}return i};ra.getStrideForLayout=function(t){var i;if(t==Xh.XY){i=2}else if(t==Xh.XYZ||t==Xh.XYM){i=3}else if(t==Xh.XYZM){i=4}return i};ra.prototype.containsXY=Yh.FALSE;ra.prototype.computeExtent=function(t){return qh.createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)};ra.prototype.getCoordinates=function(){};ra.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)};ra.prototype.getFlatCoordinates=function(){return this.flatCoordinates};ra.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)};ra.prototype.getLayout=function(){return this.layout};ra.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()){Ch.clear(this.simplifiedGeometryCache);this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=this.getRevision()}if(t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance){return this}var i=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(i)){return this.simplifiedGeometryCache[i]}else{var s=this.getSimplifiedGeometryInternal(t);var e=s.getFlatCoordinates();if(e.length<this.flatCoordinates.length){this.simplifiedGeometryCache[i]=s;return s}else{this.simplifiedGeometryMaxMinSquaredTolerance=t;return this}}};ra.prototype.getSimplifiedGeometryInternal=function(t){return this};ra.prototype.getStride=function(){return this.stride};ra.prototype.setFlatCoordinatesInternal=function(t,i){this.stride=ra.getStrideForLayout(t);this.layout=t;this.flatCoordinates=i};ra.prototype.setCoordinates=function(t,i){};ra.prototype.setLayout=function(t,i,s){var e;if(t){e=ra.getStrideForLayout(t)}else{var r;for(r=0;r<s;++r){if(i.length===0){this.layout=Xh.XY;this.stride=2;return}else{i=i[0]}}e=i.length;t=ra.getLayoutForStride_(e)}this.layout=t;this.stride=e};ra.prototype.applyTransform=function(t){if(this.flatCoordinates){t(this.flatCoordinates,this.flatCoordinates,this.stride);this.changed()}};ra.prototype.rotate=function(t,i){var s=this.getFlatCoordinates();if(s){var e=this.getStride();Bh.rotate(s,0,s.length,e,t,i,s);this.changed()}};ra.prototype.scale=function(t,i,s){var e=i;if(e===undefined){e=t}var r=s;if(!r){r=qh.getCenter(this.getExtent())}var n=this.getFlatCoordinates();if(n){var h=this.getStride();Bh.scale(n,0,n.length,h,t,e,r,n);this.changed()}};ra.prototype.translate=function(t,i){var s=this.getFlatCoordinates();if(s){var e=this.getStride();Bh.translate(s,0,s.length,e,t,i,s);this.changed()}};ra.transform2D=function(t,i,s){var e=t.getFlatCoordinates();if(!e){return null}else{var r=t.getStride();return Bh.transform2D(e,0,e.length,r,i,s)}};var na={};na.linearRing=function(t,i,s,e){var r=0;var n=t[s-e];var h=t[s-e+1];for(;i<s;i+=e){var a=t[i];var o=t[i+1];r+=h*a-n*o;n=a;h=o}return r/2};na.linearRings=function(t,i,s,e){var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r+=na.linearRing(t,i,a,e);i=a}return r};na.linearRingss=function(t,i,s,e){var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r+=na.linearRings(t,i,a,e);i=a[a.length-1]}return r};var ha={};ha.point=function(t,i,s,e,r,n,h){var a=t[i];var o=t[i+1];var f=t[s]-a;var u=t[s+1]-o;var v,l;if(f===0&&u===0){l=i}else{var c=((r-a)*f+(n-o)*u)/(f*f+u*u);if(c>1){l=s}else if(c>0){for(v=0;v<e;++v){h[v]=Fh.lerp(t[i+v],t[s+v],c)}h.length=e;return}else{l=i}}for(v=0;v<e;++v){h[v]=t[l+v]}h.length=e};ha.getMaxSquaredDelta=function(t,i,s,e,r){var n=t[i];var h=t[i+1];for(i+=e;i<s;i+=e){var a=t[i];var o=t[i+1];var f=Fh.squaredDistance(n,h,a,o);if(f>r){r=f}n=a;h=o}return r};ha.getsMaxSquaredDelta=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r=ha.getMaxSquaredDelta(t,i,a,e,r);i=a}return r};ha.getssMaxSquaredDelta=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r=ha.getsMaxSquaredDelta(t,i,a,e,r);i=a[a.length-1]}return r};ha.getClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){if(i==s){return f}var v,l;if(r===0){l=Fh.squaredDistance(h,a,t[i],t[i+1]);if(l<f){for(v=0;v<e;++v){o[v]=t[i+v]}o.length=e;return l}else{return f}}var c=u?u:[NaN,NaN];var d=i+e;while(d<s){ha.point(t,d-e,d,e,h,a,c);l=Fh.squaredDistance(h,a,c[0],c[1]);if(l<f){f=l;for(v=0;v<e;++v){o[v]=c[v]}o.length=e;d+=e}else{d+=e*Math.max((Math.sqrt(l)-Math.sqrt(f))/r|0,1)}}if(n){ha.point(t,s-e,i,e,h,a,c);l=Fh.squaredDistance(h,a,c[0],c[1]);if(l<f){f=l;for(v=0;v<e;++v){o[v]=c[v]}o.length=e}}return f};ha.getsClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){var v=u?u:[NaN,NaN];var l,c;for(l=0,c=s.length;l<c;++l){var d=s[l];f=ha.getClosestPoint(t,i,d,e,r,n,h,a,o,f,v);i=d}return f};ha.getssClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){var v=u?u:[NaN,NaN];var l,c;for(l=0,c=s.length;l<c;++l){var d=s[l];f=ha.getsClosestPoint(t,i,d,e,r,n,h,a,o,f,v);i=d[d.length-1]}return f};var aa={};aa.coordinate=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){t[i++]=s[r]}return i};aa.coordinates=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){var h=s[r];var a;for(a=0;a<e;++a){t[i++]=h[a]}}return i};aa.coordinatess=function(t,i,s,e,r){var n=r?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=aa.coordinates(t,i,s[a],e);n[h++]=f;i=f}n.length=h;return n};aa.coordinatesss=function(t,i,s,e,r){var n=r?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=aa.coordinatess(t,i,s[a],e,n[h]);n[h++]=f;i=f[f.length-1]}n.length=h;return n};var oa={};oa.coordinates=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a;for(a=i;a<s;a+=e){n[h++]=t.slice(a,a+e)}n.length=h;return n};oa.coordinatess=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=s[a];n[h++]=oa.coordinates(t,i,f,e,n[h]);i=f}n.length=h;return n};oa.coordinatesss=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=s[a];n[h++]=oa.coordinatess(t,i,f,e,n[h]);i=f[f.length-1]}n.length=h;return n};var fa={};fa.lineString=function(t,i,s,e,r,n,h){var a=h!==undefined?h:[];if(!n){s=fa.radialDistance(t,i,s,e,r,a,0);t=a;i=0;e=2}a.length=fa.douglasPeucker(t,i,s,e,r,a,0);return a};fa.douglasPeucker=function(t,i,s,e,r,n,h){var a=(s-i)/e;if(a<3){for(;i<s;i+=e){n[h++]=t[i];n[h++]=t[i+1]}return h}var o=new Array(a);o[0]=1;o[a-1]=1;var f=[i,s-e];var u=0;var v;while(f.length>0){var l=f.pop();var c=f.pop();var d=0;var m=t[c];var p=t[c+1];var M=t[l];var z=t[l+1];for(v=c+e;v<l;v+=e){var _=t[v];var g=t[v+1];var w=Fh.squaredSegmentDistance(_,g,m,p,M,z);if(w>d){u=v;d=w}}if(d>r){o[(u-i)/e]=1;if(c+e<u){f.push(c,u)}if(u+e<l){f.push(u,l)}}}for(v=0;v<a;++v){if(o[v]){n[h++]=t[i+v*e];n[h++]=t[i+v*e+1]}}return h};fa.douglasPeuckers=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];h=fa.douglasPeucker(t,i,u,e,r,n,h);a.push(h);i=u}return h};fa.douglasPeuckerss=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];var v=[];h=fa.douglasPeuckers(t,i,u,e,r,n,h,v);a.push(v);i=u[u.length-1]}return h};fa.radialDistance=function(t,i,s,e,r,n,h){if(s<=i+e){for(;i<s;i+=e){n[h++]=t[i];n[h++]=t[i+1]}return h}var a=t[i];var o=t[i+1];n[h++]=a;n[h++]=o;var f=a;var u=o;for(i+=e;i<s;i+=e){f=t[i];u=t[i+1];if(Fh.squaredDistance(a,o,f,u)>r){n[h++]=f;n[h++]=u;a=f;o=u}}if(f!=a||u!=o){n[h++]=f;n[h++]=u}return h};fa.snap=function(t,i){return i*Math.round(t/i)};fa.quantize=function(t,i,s,e,r,n,h){if(i==s){return h}var a=fa.snap(t[i],r);var o=fa.snap(t[i+1],r);i+=e;n[h++]=a;n[h++]=o;var f,u;do{f=fa.snap(t[i],r);u=fa.snap(t[i+1],r);i+=e;if(i==s){n[h++]=f;n[h++]=u;return h}}while(f==a&&u==o);while(i<s){var v,l;v=fa.snap(t[i],r);l=fa.snap(t[i+1],r);i+=e;if(v==f&&l==u){continue}var c=f-a;var d=u-o;var m=v-a;var p=l-o;if(c*p==d*m&&(c<0&&m<c||c==m||c>0&&m>c)&&(d<0&&p<d||d==p||d>0&&p>d)){f=v;u=l;continue}n[h++]=f;n[h++]=u;a=f;o=u;f=v;u=l}n[h++]=f;n[h++]=u;return h};fa.quantizes=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];h=fa.quantize(t,i,u,e,r,n,h);a.push(h);i=u}return h};fa.quantizess=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];var v=[];h=fa.quantizes(t,i,u,e,r,n,h,v);a.push(v);i=u[u.length-1]}return h};var ua=function(t,i){ra.call(this);this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.setCoordinates(t,i)};kh.inherits(ua,ra);ua.prototype.clone=function(){var t=new ua(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};ua.prototype.closestPointXY=function(t,i,s,e){if(e<qh.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(ha.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return ha.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,true,t,i,s,e)};ua.prototype.getArea=function(){return na.linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};ua.prototype.getCoordinates=function(){return oa.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};ua.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=fa.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new ua(null);s.setFlatCoordinates(Xh.XY,i);return s};ua.prototype.getType=function(){return Gh.LINEAR_RING};ua.prototype.intersectsExtent=function(t){};ua.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(Xh.XY,null)}else{this.setLayout(i,t,1);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=aa.coordinates(this.flatCoordinates,0,t,this.stride);this.changed()}};ua.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var va=function(t,i){ra.call(this);this.setCoordinates(t,i)};kh.inherits(va,ra);va.prototype.clone=function(){var t=new va(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};va.prototype.closestPointXY=function(t,i,s,e){var r=this.flatCoordinates;var n=Fh.squaredDistance(t,i,r[0],r[1]);if(n<e){var h=this.stride;var a;for(a=0;a<h;++a){s[a]=r[a]}s.length=h;return n}else{return e}};va.prototype.getCoordinates=function(){return!this.flatCoordinates?[]:this.flatCoordinates.slice()};va.prototype.computeExtent=function(t){return qh.createOrUpdateFromCoordinate(this.flatCoordinates,t)};va.prototype.getType=function(){return Gh.POINT};va.prototype.intersectsExtent=function(t){return qh.containsXY(t,this.flatCoordinates[0],this.flatCoordinates[1])};va.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(Xh.XY,null)}else{this.setLayout(i,t,0);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=aa.coordinate(this.flatCoordinates,0,t,this.stride);this.changed()}};va.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var la={};la.linearRingContainsExtent=function(t,i,s,e,r){var n=qh.forEachCorner(r,(function(r){return!la.linearRingContainsXY(t,i,s,e,r[0],r[1])}));return!n};la.linearRingContainsXY=function(t,i,s,e,r,n){var h=0;var a=t[s-e];var o=t[s-e+1];for(;i<s;i+=e){var f=t[i];var u=t[i+1];if(o<=n){if(u>n&&(f-a)*(n-o)-(r-a)*(u-o)>0){h++}}else if(u<=n&&(f-a)*(n-o)-(r-a)*(u-o)<0){h--}a=f;o=u}return h!==0};la.linearRingsContainsXY=function(t,i,s,e,r,n){if(s.length===0){return false}if(!la.linearRingContainsXY(t,i,s[0],e,r,n)){return false}var h,a;for(h=1,a=s.length;h<a;++h){if(la.linearRingContainsXY(t,s[h-1],s[h],e,r,n)){return false}}return true};la.linearRingssContainsXY=function(t,i,s,e,r,n){if(s.length===0){return false}var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];if(la.linearRingsContainsXY(t,i,o,e,r,n)){return true}i=o[o.length-1]}return false};var ca={};ca.linearRings=function(t,i,s,e,r,n,h){var a,o,f,u,v,l,c;var d=r[n+1];var m=[];for(var p=0,M=s.length;p<M;++p){var z=s[p];u=t[z-e];l=t[z-e+1];for(a=i;a<z;a+=e){v=t[a];c=t[a+1];if(d<=l&&c<=d||l<=d&&d<=c){f=(d-l)/(c-l)*(v-u)+u;m.push(f)}u=v;l=c}}var _=NaN;var g=-Infinity;m.sort(jh.numberSafeCompareFunction);u=m[0];for(a=1,o=m.length;a<o;++a){v=m[a];var w=Math.abs(v-u);if(w>g){f=(u+v)/2;if(la.linearRingsContainsXY(t,i,s,e,f,d)){_=f;g=w}}u=v}if(isNaN(_)){_=r[n]}if(h){h.push(_,d,g);return h}else{return[_,d,g]}};ca.linearRingss=function(t,i,s,e,r){var n=[];var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];n=ca.linearRings(t,i,o,e,r,2*h,n);i=o[o.length-1]}return n};var da={};da.forEach=function(t,i,s,e,r,n){var h=[t[i],t[i+1]];var a=[];var o;for(;i+e<s;i+=e){a[0]=t[i+e];a[1]=t[i+e+1];o=r.call(n,h,a);if(o){return o}h[0]=a[0];h[1]=a[1]}return false};var ma={};ma.lineString=function(t,i,s,e,r){var n=qh.extendFlatCoordinates(qh.createEmpty(),t,i,s,e);if(!qh.intersects(r,n)){return false}if(qh.containsExtent(r,n)){return true}if(n[0]>=r[0]&&n[2]<=r[2]){return true}if(n[1]>=r[1]&&n[3]<=r[3]){return true}return da.forEach(t,i,s,e,(function(t,i){return qh.intersectsSegment(r,t,i)}))};ma.lineStrings=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){if(ma.lineString(t,i,s[n],e,r)){return true}i=s[n]}return false};ma.linearRing=function(t,i,s,e,r){if(ma.lineString(t,i,s,e,r)){return true}if(la.linearRingContainsXY(t,i,s,e,r[0],r[1])){return true}if(la.linearRingContainsXY(t,i,s,e,r[0],r[3])){return true}if(la.linearRingContainsXY(t,i,s,e,r[2],r[1])){return true}if(la.linearRingContainsXY(t,i,s,e,r[2],r[3])){return true}return false};ma.linearRings=function(t,i,s,e,r){if(!ma.linearRing(t,i,s[0],e,r)){return false}if(s.length===1){return true}var n,h;for(n=1,h=s.length;n<h;++n){if(la.linearRingContainsExtent(t,s[n-1],s[n],e,r)){return false}}return true};ma.linearRingss=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];if(ma.linearRings(t,i,a,e,r)){return true}i=a[a.length-1]}return false};var pa={};pa.coordinates=function(t,i,s,e){while(i<s-e){var r;for(r=0;r<e;++r){var n=t[i+r];t[i+r]=t[s-e+r];t[s-e+r]=n}i+=e;s-=e}};var Ma={};Ma.linearRingIsClockwise=function(t,i,s,e){var r=0;var n=t[s-e];var h=t[s-e+1];for(;i<s;i+=e){var a=t[i];var o=t[i+1];r+=(a-n)*(o+h);n=a;h=o}return r>0};Ma.linearRingsAreOriented=function(t,i,s,e,r){var n=r!==undefined?r:false;var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];var f=Ma.linearRingIsClockwise(t,i,o,e);if(h===0){if(n&&f||!n&&!f){return false}}else{if(n&&!f||!n&&f){return false}}i=o}return true};Ma.linearRingssAreOriented=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){if(!Ma.linearRingsAreOriented(t,i,s[n],e,r)){return false}}return true};Ma.orientLinearRings=function(t,i,s,e,r){var n=r!==undefined?r:false;var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];var f=Ma.linearRingIsClockwise(t,i,o,e);var u=h===0?n&&f||!n&&!f:n&&!f||!n&&f;if(u){pa.coordinates(t,i,o,e)}i=o}return i};Ma.orientLinearRingss=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){i=Ma.orientLinearRings(t,i,s[n],e,r)}return i};var za=function(t,i){ra.call(this);this.ends_=[];this.flatInteriorPointRevision_=-1;this.flatInteriorPoint_=null;this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.orientedRevision_=-1;this.orientedFlatCoordinates_=null;this.setCoordinates(t,i)};kh.inherits(za,ra);za.prototype.appendLinearRing=function(t){if(!this.flatCoordinates){this.flatCoordinates=t.getFlatCoordinates().slice()}else{jh.extend(this.flatCoordinates,t.getFlatCoordinates())}this.ends_.push(this.flatCoordinates.length);this.changed()};za.prototype.clone=function(){var t=new za(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice());return t};za.prototype.closestPointXY=function(t,i,s,e){if(e<qh.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(ha.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return ha.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,true,t,i,s,e)};za.prototype.containsXY=function(t,i){return la.linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)};za.prototype.getArea=function(){return na.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)};za.prototype.getCoordinates=function(t){var i;if(t!==undefined){i=this.getOrientedFlatCoordinates().slice();Ma.orientLinearRings(i,0,this.ends_,this.stride,t)}else{i=this.flatCoordinates}return oa.coordinatess(i,0,this.ends_,this.stride)};za.prototype.getEnds=function(){return this.ends_};za.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=qh.getCenter(this.getExtent());this.flatInteriorPoint_=ca.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0);this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_};za.prototype.getInteriorPoint=function(){return new va(this.getFlatInteriorPoint(),Xh.XYM)};za.prototype.getLinearRingCount=function(){return this.ends_.length};za.prototype.getLinearRing=function(t){if(t<0||this.ends_.length<=t){return null}var i=new ua(null);i.setFlatCoordinates(this.layout,this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]));return i};za.prototype.getLinearRings=function(){var t=this.layout;var i=this.flatCoordinates;var s=this.ends_;var e=[];var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];var o=new ua(null);o.setFlatCoordinates(t,i.slice(r,a));e.push(o);r=a}return e};za.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;if(Ma.linearRingsAreOriented(t,0,this.ends_,this.stride)){this.orientedFlatCoordinates_=t}else{this.orientedFlatCoordinates_=t.slice();this.orientedFlatCoordinates_.length=Ma.orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)}this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_};za.prototype.getSimplifiedGeometryInternal=function(t){var i=[];var s=[];i.length=fa.quantizes(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,s);var e=new za(null);e.setFlatCoordinates(Xh.XY,i,s);return e};za.prototype.getType=function(){return Gh.POLYGON};za.prototype.intersectsExtent=function(t){return ma.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)};za.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(Xh.XY,null,this.ends_)}else{this.setLayout(i,t,2);if(!this.flatCoordinates){this.flatCoordinates=[]}var s=aa.coordinatess(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=s.length===0?0:s[s.length-1];this.changed()}};za.prototype.setFlatCoordinates=function(t,i,s){this.setFlatCoordinatesInternal(t,i);this.ends_=s;this.changed()};za.circular=function(t,i,s,e){var r=e?e:32;var n=[];var h;for(h=0;h<r;++h){jh.extend(n,t.offset(i,s,2*Math.PI*h/r))}n.push(n[0],n[1]);var a=new za(null);a.setFlatCoordinates(Xh.XY,n,[n.length]);return a};za.fromExtent=function(t){var i=t[0];var s=t[1];var e=t[2];var r=t[3];var n=[i,s,i,r,e,r,e,s,i,s];var h=new za(null);h.setFlatCoordinates(Xh.XY,n,[n.length]);return h};za.fromCircle=function(t,i,s){var e=i?i:32;var r=t.getStride();var n=t.getLayout();var h=new za(null,n);var a=r*(e+1);var o=new Array(a);for(var f=0;f<a;f++){o[f]=0}var u=[o.length];h.setFlatCoordinates(n,o,u);za.makeRegular(h,t.getCenter(),t.getRadius(),s);return h};za.makeRegular=function(t,i,s,e){var r=t.getFlatCoordinates();var n=t.getLayout();var h=t.getStride();var a=t.getEnds();var o=r.length/h-1;var f=e?e:0;var u,v;for(var l=0;l<=o;++l){v=l*h;u=f+Fh.modulo(l,o)*2*Math.PI/o;r[v]=i[0]+s*Math.cos(u);r[v+1]=i[1]+s*Math.sin(u)}t.setFlatCoordinates(n,r,a)};var _a={};_a.ONE=1;_a.SRC_ALPHA=770;_a.COLOR_ATTACHMENT0=36064;_a.COLOR_BUFFER_BIT=16384;_a.TRIANGLES=4;_a.TRIANGLE_STRIP=5;_a.ONE_MINUS_SRC_ALPHA=771;_a.ARRAY_BUFFER=34962;_a.ELEMENT_ARRAY_BUFFER=34963;_a.STREAM_DRAW=35040;_a.STATIC_DRAW=35044;_a.DYNAMIC_DRAW=35048;_a.CULL_FACE=2884;_a.BLEND=3042;_a.STENCIL_TEST=2960;_a.DEPTH_TEST=2929;_a.SCISSOR_TEST=3089;_a.UNSIGNED_BYTE=5121;_a.UNSIGNED_SHORT=5123;_a.UNSIGNED_INT=5125;_a.FLOAT=5126;_a.RGBA=6408;_a.FRAGMENT_SHADER=35632;_a.VERTEX_SHADER=35633;_a.LINK_STATUS=35714;_a.LINEAR=9729;_a.TEXTURE_MAG_FILTER=10240;_a.TEXTURE_MIN_FILTER=10241;_a.TEXTURE_WRAP_S=10242;_a.TEXTURE_WRAP_T=10243;_a.TEXTURE_2D=3553;_a.TEXTURE0=33984;_a.CLAMP_TO_EDGE=33071;_a.COMPILE_STATUS=35713;_a.FRAMEBUFFER=36160;_a.CONTEXT_IDS_=["experimental-webgl","webgl","webkit-3d","moz-webgl"];_a.getContext=function(t,i){var s,e,r=_a.CONTEXT_IDS_.length;for(e=0;e<r;++e){try{s=t.getContext(_a.CONTEXT_IDS_[e],i);if(s){return s}}catch(t){}}return null};var ga={};var wa=typeof navigator!=="undefined"?navigator.userAgent.toLowerCase():"";ga.FIREFOX=wa.indexOf("firefox")!==-1;ga.SAFARI=wa.indexOf("safari")!==-1&&wa.indexOf("chrom")==-1;ga.WEBKIT=wa.indexOf("webkit")!==-1&&wa.indexOf("edge")==-1;ga.MAC=wa.indexOf("macintosh")!==-1;ga.DEVICE_PIXEL_RATIO=window.devicePixelRatio||1;ga.CANVAS_LINE_DASH=false;ga.CANVAS=kh.ENABLE_CANVAS&&function(){if(!("HTMLCanvasElement"in window)){return false}try{var t=document.createElement("CANVAS").getContext("2d");if(!t){return false}else{if(t.setLineDash!==undefined){ga.CANVAS_LINE_DASH=true}return true}}catch(t){return false}}();ga.DEVICE_ORIENTATION="DeviceOrientationEvent"in window;ga.GEOLOCATION="geolocation"in navigator;ga.TOUCH=kh.ASSUME_TOUCH||"ontouchstart"in window;ga.POINTER="PointerEvent"in window;ga.MSPOINTER=!!navigator.msPointerEnabled;(function(){if(kh.ENABLE_WEBGL){var t=false;var i;var s=[];if("WebGLRenderingContext"in window){try{var e=document.createElement("CANVAS");var r=_a.getContext(e,{failIfMajorPerformanceCaveat:true});if(r){t=true;i=r.getParameter(r.MAX_TEXTURE_SIZE);s=r.getSupportedExtensions()}}catch(t){}}ga.WEBGL=t;kh.WEBGL_EXTENSIONS=s;kh.WEBGL_MAX_TEXTURE_SIZE=i}})();var ya=function(t){Ph.call(this);var i=t||{};this.position_=null;this.transform_=ia.identityTransform;this.sphere_=new Wh($h.RADIUS);this.watchId_=undefined;Ih.listen(this,Ph.getChangeEventType(Eh.PROJECTION),this.handleProjectionChanged_,this);Ih.listen(this,Ph.getChangeEventType(Eh.TRACKING),this.handleTrackingChanged_,this);if(i.projection!==undefined){this.setProjection(i.projection)}if(i.trackingOptions!==undefined){this.setTrackingOptions(i.trackingOptions)}this.setTracking(i.tracking!==undefined?i.tracking:false)};kh.inherits(ya,Ph);ya.prototype.disposeInternal=function(){this.setTracking(false);Ph.prototype.disposeInternal.call(this)};ya.prototype.handleProjectionChanged_=function(){var t=this.getProjection();if(t){this.transform_=ia.getTransformFromProjections(ia.get("EPSG:4326"),t);if(this.position_){this.set(Eh.POSITION,this.transform_(this.position_))}}};ya.prototype.handleTrackingChanged_=function(){if(ga.GEOLOCATION){var t=this.getTracking();if(t&&this.watchId_===undefined){this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions())}else if(!t&&this.watchId_!==undefined){navigator.geolocation.clearWatch(this.watchId_);this.watchId_=undefined}}};ya.prototype.positionChange_=function(t){var i=t.coords;this.set(Eh.ACCURACY,i.accuracy);this.set(Eh.ALTITUDE,i.altitude===null?undefined:i.altitude);this.set(Eh.ALTITUDE_ACCURACY,i.altitudeAccuracy===null?undefined:i.altitudeAccuracy);this.set(Eh.HEADING,i.heading===null?undefined:Fh.toRadians(i.heading));if(!this.position_){this.position_=[i.longitude,i.latitude]}else{this.position_[0]=i.longitude;this.position_[1]=i.latitude}var s=this.transform_(this.position_);this.set(Eh.POSITION,s);this.set(Eh.SPEED,i.speed===null?undefined:i.speed);var e=za.circular(this.sphere_,this.position_,i.accuracy);e.applyTransform(this.transform_);this.set(Eh.ACCURACY_GEOMETRY,e);this.changed()};ya.prototype.positionError_=function(t){t.type=Ah.ERROR;this.setTracking(false);this.dispatchEvent(t)};ya.prototype.getAccuracy=function(){return this.get(Eh.ACCURACY)};ya.prototype.getAccuracyGeometry=function(){return this.get(Eh.ACCURACY_GEOMETRY)||null};ya.prototype.getAltitude=function(){return this.get(Eh.ALTITUDE)};ya.prototype.getAltitudeAccuracy=function(){return this.get(Eh.ALTITUDE_ACCURACY)};ya.prototype.getHeading=function(){return this.get(Eh.HEADING)};ya.prototype.getPosition=function(){return this.get(Eh.POSITION)};ya.prototype.getProjection=function(){return this.get(Eh.PROJECTION)};ya.prototype.getSpeed=function(){return this.get(Eh.SPEED)};ya.prototype.getTracking=function(){return this.get(Eh.TRACKING)};ya.prototype.getTrackingOptions=function(){return this.get(Eh.TRACKING_OPTIONS)};ya.prototype.setProjection=function(t){this.set(Eh.PROJECTION,ia.get(t))};ya.prototype.setTracking=function(t){this.set(Eh.TRACKING,t)};ya.prototype.setTrackingOptions=function(t){this.set(Eh.TRACKING_OPTIONS,t)};var ba={ADD:"add",REMOVE:"remove"};var xa=function(t,i){Ph.call(this);var s=i||{};this.unique_=!!s.unique;this.array_=t?t:[];if(this.unique_){for(var e=0,r=this.array_.length;e<r;++e){this.assertUnique_(this.array_[e],e)}}this.updateLength_()};kh.inherits(xa,Ph);xa.prototype.clear=function(){while(this.getLength()>0){this.pop()}};xa.prototype.extend=function(t){var i,s;for(i=0,s=t.length;i<s;++i){this.push(t[i])}return this};xa.prototype.forEach=function(t,i){var s=i?t.bind(i):t;var e=this.array_;for(var r=0,n=e.length;r<n;++r){s(e[r],r,e)}};xa.prototype.getArray=function(){return this.array_};xa.prototype.item=function(t){return this.array_[t]};xa.prototype.getLength=function(){return this.get(xa.Property_.LENGTH)};xa.prototype.insertAt=function(t,i){if(this.unique_){this.assertUnique_(i)}this.array_.splice(t,0,i);this.updateLength_();this.dispatchEvent(new xa.Event(ba.ADD,i))};xa.prototype.pop=function(){return this.removeAt(this.getLength()-1)};xa.prototype.push=function(t){if(this.unique_){this.assertUnique_(t)}var i=this.getLength();this.insertAt(i,t);return this.getLength()};xa.prototype.remove=function(t){var i=this.array_;var s,e;for(s=0,e=i.length;s<e;++s){if(i[s]===t){return this.removeAt(s)}}return undefined};xa.prototype.removeAt=function(t){var i=this.array_[t];this.array_.splice(t,1);this.updateLength_();this.dispatchEvent(new xa.Event(ba.REMOVE,i));return i};xa.prototype.setAt=function(t,i){var s=this.getLength();if(t<s){if(this.unique_){this.assertUnique_(i,t)}var e=this.array_[t];this.array_[t]=i;this.dispatchEvent(new xa.Event(ba.REMOVE,e));this.dispatchEvent(new xa.Event(ba.ADD,i))}else{var r;for(r=s;r<t;++r){this.insertAt(r,undefined)}this.insertAt(t,i)}};xa.prototype.updateLength_=function(){this.set(xa.Property_.LENGTH,this.array_.length)};xa.prototype.assertUnique_=function(t,i){for(var s=0,e=this.array_.length;s<e;++s){if(this.array_[s]===t&&s!==i){throw new Lh(58)}}};xa.Property_={LENGTH:"length"};xa.Event=function(t,i){Oh.call(this,t);this.element=i};kh.inherits(xa.Event,Oh);var ka=function(t,i,s){Oh.call(this,t);this.map=i;this.frameState=s!==undefined?s:null};kh.inherits(ka,Oh);var Ea=function(t,i,s,e,r){ka.call(this,t,i,r);this.originalEvent=s;this.pixel=i.getEventPixel(s);this.coordinate=i.getCoordinateFromPixel(this.pixel);this.dragging=e!==undefined?e:false};kh.inherits(Ea,ka);Ea.prototype.preventDefault=function(){ka.prototype.preventDefault.call(this);this.originalEvent.preventDefault()};Ea.prototype.stopPropagation=function(){ka.prototype.stopPropagation.call(this);this.originalEvent.stopPropagation()};var Na={SINGLECLICK:"singleclick",CLICK:Ah.CLICK,DBLCLICK:Ah.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var Ca=function(t,i,s,e,r){Ea.call(this,t,i,s.originalEvent,e,r);this.pointerEvent=s};kh.inherits(Ca,Ea);var Ia={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var Sa=function(t,i){this.dispatcher=t;this.mapping_=i};Sa.prototype.getEvents=function(){return Object.keys(this.mapping_)};Sa.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var Oa=function(t){var i={mousedown:this.mousedown,mousemove:this.mousemove,mouseup:this.mouseup,mouseover:this.mouseover,mouseout:this.mouseout};Sa.call(this,t,i);this.pointerMap=t.pointerMap;this.lastTouches=[]};kh.inherits(Oa,Sa);Oa.POINTER_ID=1;Oa.POINTER_TYPE="mouse";Oa.DEDUP_DIST=25;Oa.prototype.isEventSimulatedFromTouch_=function(t){var i=this.lastTouches;var s=t.clientX,e=t.clientY;for(var r=0,n=i.length,h;r<n&&(h=i[r]);r++){var a=Math.abs(s-h[0]),o=Math.abs(e-h[1]);if(a<=Oa.DEDUP_DIST&&o<=Oa.DEDUP_DIST){return true}}return false};Oa.prepareEvent=function(t,i){var s=i.cloneEvent(t,t);var e=s.preventDefault;s.preventDefault=function(){t.preventDefault();e()};s.pointerId=Oa.POINTER_ID;s.isPrimary=true;s.pointerType=Oa.POINTER_TYPE;return s};Oa.prototype.mousedown=function(t){if(!this.isEventSimulatedFromTouch_(t)){if(Oa.POINTER_ID.toString()in this.pointerMap){this.cancel(t)}var i=Oa.prepareEvent(t,this.dispatcher);this.pointerMap[Oa.POINTER_ID.toString()]=t;this.dispatcher.down(i,t)}};Oa.prototype.mousemove=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Oa.prepareEvent(t,this.dispatcher);this.dispatcher.move(i,t)}};Oa.prototype.mouseup=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=this.pointerMap[Oa.POINTER_ID.toString()];if(i&&i.button===t.button){var s=Oa.prepareEvent(t,this.dispatcher);this.dispatcher.up(s,t);this.cleanupMouse()}}};Oa.prototype.mouseover=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Oa.prepareEvent(t,this.dispatcher);this.dispatcher.enterOver(i,t)}};Oa.prototype.mouseout=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Oa.prepareEvent(t,this.dispatcher);this.dispatcher.leaveOut(i,t)}};Oa.prototype.cancel=function(t){var i=Oa.prepareEvent(t,this.dispatcher);this.dispatcher.cancel(i,t);this.cleanupMouse()};Oa.prototype.cleanupMouse=function(){delete this.pointerMap[Oa.POINTER_ID.toString()]};var Ta=function(t){var i={MSPointerDown:this.msPointerDown,MSPointerMove:this.msPointerMove,MSPointerUp:this.msPointerUp,MSPointerOut:this.msPointerOut,MSPointerOver:this.msPointerOver,MSPointerCancel:this.msPointerCancel,MSGotPointerCapture:this.msGotPointerCapture,MSLostPointerCapture:this.msLostPointerCapture};Sa.call(this,t,i);this.pointerMap=t.pointerMap;this.POINTER_TYPES=["","unavailable","touch","pen","mouse"]};kh.inherits(Ta,Sa);Ta.prototype.prepareEvent_=function(t){var i=t;if(typeof t.pointerType==="number"){i=this.dispatcher.cloneEvent(t,t);i.pointerType=this.POINTER_TYPES[t.pointerType]}return i};Ta.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]};Ta.prototype.msPointerDown=function(t){this.pointerMap[t.pointerId.toString()]=t;var i=this.prepareEvent_(t);this.dispatcher.down(i,t)};Ta.prototype.msPointerMove=function(t){var i=this.prepareEvent_(t);this.dispatcher.move(i,t)};Ta.prototype.msPointerUp=function(t){var i=this.prepareEvent_(t);this.dispatcher.up(i,t);this.cleanup(t.pointerId)};Ta.prototype.msPointerOut=function(t){var i=this.prepareEvent_(t);this.dispatcher.leaveOut(i,t)};Ta.prototype.msPointerOver=function(t){var i=this.prepareEvent_(t);this.dispatcher.enterOver(i,t)};Ta.prototype.msPointerCancel=function(t){var i=this.prepareEvent_(t);this.dispatcher.cancel(i,t);this.cleanup(t.pointerId)};Ta.prototype.msLostPointerCapture=function(t){var i=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(i)};Ta.prototype.msGotPointerCapture=function(t){var i=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(i)};var Aa=function(t){var i={pointerdown:this.pointerDown,pointermove:this.pointerMove,pointerup:this.pointerUp,pointerout:this.pointerOut,pointerover:this.pointerOver,pointercancel:this.pointerCancel,gotpointercapture:this.gotPointerCapture,lostpointercapture:this.lostPointerCapture};Sa.call(this,t,i)};kh.inherits(Aa,Sa);Aa.prototype.pointerDown=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.pointerMove=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.pointerUp=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.pointerOut=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.pointerOver=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.pointerCancel=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.lostPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};Aa.prototype.gotPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};var Ra=function(t,i,s){Oh.call(this,t);this.originalEvent=i;var e=s?s:{};this.buttons=this.getButtons_(e);this.pressure=this.getPressure_(e,this.buttons);this.bubbles="bubbles"in e?e["bubbles"]:false;this.cancelable="cancelable"in e?e["cancelable"]:false;this.view="view"in e?e["view"]:null;this.detail="detail"in e?e["detail"]:null;this.screenX="screenX"in e?e["screenX"]:0;this.screenY="screenY"in e?e["screenY"]:0;this.clientX="clientX"in e?e["clientX"]:0;this.clientY="clientY"in e?e["clientY"]:0;this.ctrlKey="ctrlKey"in e?e["ctrlKey"]:false;this.altKey="altKey"in e?e["altKey"]:false;this.shiftKey="shiftKey"in e?e["shiftKey"]:false;this.metaKey="metaKey"in e?e["metaKey"]:false;this.button="button"in e?e["button"]:0;this.relatedTarget="relatedTarget"in e?e["relatedTarget"]:null;this.pointerId="pointerId"in e?e["pointerId"]:0;this.width="width"in e?e["width"]:0;this.height="height"in e?e["height"]:0;this.tiltX="tiltX"in e?e["tiltX"]:0;this.tiltY="tiltY"in e?e["tiltY"]:0;this.pointerType="pointerType"in e?e["pointerType"]:"";this.hwTimestamp="hwTimestamp"in e?e["hwTimestamp"]:0;this.isPrimary="isPrimary"in e?e["isPrimary"]:false;if(i.preventDefault){this.preventDefault=function(){i.preventDefault()}}};kh.inherits(Ra,Oh);Ra.prototype.getButtons_=function(t){var i;if(t.buttons||Ra.HAS_BUTTONS){i=t.buttons}else{switch(t.which){case 1:i=1;break;case 2:i=4;break;case 3:i=2;break;default:i=0}}return i};Ra.prototype.getPressure_=function(t,i){var s=0;if(t.pressure){s=t.pressure}else{s=i?.5:0}return s};Ra.HAS_BUTTONS=false;(function(){try{var t=new MouseEvent("click",{buttons:1});Ra.HAS_BUTTONS=t.buttons===1}catch(t){}})();var Pa=function(t,i){var s={touchstart:this.touchstart,touchmove:this.touchmove,touchend:this.touchend,touchcancel:this.touchcancel};Sa.call(this,t,s);this.pointerMap=t.pointerMap;this.mouseSource=i;this.firstTouchId_=undefined;this.clickCount_=0;this.resetId_=undefined};kh.inherits(Pa,Sa);Pa.DEDUP_TIMEOUT=2500;Pa.CLICK_COUNT_TIMEOUT=200;Pa.POINTER_TYPE="touch";Pa.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier};Pa.prototype.setPrimaryTouch_=function(t){var i=Object.keys(this.pointerMap).length;if(i===0||i===1&&Oa.POINTER_ID.toString()in this.pointerMap){this.firstTouchId_=t.identifier;this.cancelResetClickCount_()}};Pa.prototype.removePrimaryPointer_=function(t){if(t.isPrimary){this.firstTouchId_=undefined;this.resetClickCount_()}};Pa.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),Pa.CLICK_COUNT_TIMEOUT)};Pa.prototype.resetClickCountHandler_=function(){this.clickCount_=0;this.resetId_=undefined};Pa.prototype.cancelResetClickCount_=function(){if(this.resetId_!==undefined){clearTimeout(this.resetId_)}};Pa.prototype.touchToPointer_=function(t,i){var s=this.dispatcher.cloneEvent(t,i);s.pointerId=i.identifier+2;s.bubbles=true;s.cancelable=true;s.detail=this.clickCount_;s.button=0;s.buttons=1;s.width=i.webkitRadiusX||i.radiusX||0;s.height=i.webkitRadiusY||i.radiusY||0;s.pressure=i.webkitForce||i.force||.5;s.isPrimary=this.isPrimaryTouch_(i);s.pointerType=Pa.POINTER_TYPE;s.clientX=i.clientX;s.clientY=i.clientY;s.screenX=i.screenX;s.screenY=i.screenY;return s};Pa.prototype.processTouches_=function(t,i){var s=Array.prototype.slice.call(t.changedTouches);var e=s.length;function r(){t.preventDefault()}var n,h;for(n=0;n<e;++n){h=this.touchToPointer_(t,s[n]);h.preventDefault=r;i.call(this,t,h)}};Pa.prototype.findTouch_=function(t,i){var s=t.length;var e;for(var r=0;r<s;r++){e=t[r];if(e.identifier===i){return true}}return false};Pa.prototype.vacuumTouches_=function(t){var i=t.touches;var s=Object.keys(this.pointerMap);var e=s.length;if(e>=i.length){var r=[];var n,h,a;for(n=0;n<e;++n){h=s[n];a=this.pointerMap[h];if(h!=Oa.POINTER_ID&&!this.findTouch_(i,h-2)){r.push(a.out)}}for(n=0;n<r.length;++n){this.cancelOut_(t,r[n])}}};Pa.prototype.touchstart=function(t){this.vacuumTouches_(t);this.setPrimaryTouch_(t.changedTouches[0]);this.dedupSynthMouse_(t);this.clickCount_++;this.processTouches_(t,this.overDown_)};Pa.prototype.overDown_=function(t,i){this.pointerMap[i.pointerId]={target:i.target,out:i,outTarget:i.target};this.dispatcher.over(i,t);this.dispatcher.enter(i,t);this.dispatcher.down(i,t)};Pa.prototype.touchmove=function(t){t.preventDefault();this.processTouches_(t,this.moveOverOut_)};Pa.prototype.moveOverOut_=function(t,i){var s=i;var e=this.pointerMap[s.pointerId];if(!e){return}var r=e.out;var n=e.outTarget;this.dispatcher.move(s,t);if(r&&n!==s.target){r.relatedTarget=s.target;s.relatedTarget=n;r.target=n;if(s.target){this.dispatcher.leaveOut(r,t);this.dispatcher.enterOver(s,t)}else{s.target=n;s.relatedTarget=null;this.cancelOut_(t,s)}}e.out=s;e.outTarget=s.target};Pa.prototype.touchend=function(t){this.dedupSynthMouse_(t);this.processTouches_(t,this.upOut_)};Pa.prototype.upOut_=function(t,i){this.dispatcher.up(i,t);this.dispatcher.out(i,t);this.dispatcher.leave(i,t);this.cleanUpPointer_(i)};Pa.prototype.touchcancel=function(t){this.processTouches_(t,this.cancelOut_)};Pa.prototype.cancelOut_=function(t,i){this.dispatcher.cancel(i,t);this.dispatcher.out(i,t);this.dispatcher.leave(i,t);this.cleanUpPointer_(i)};Pa.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId];this.removePrimaryPointer_(t)};Pa.prototype.dedupSynthMouse_=function(t){var i=this.mouseSource.lastTouches;var s=t.changedTouches[0];if(this.isPrimaryTouch_(s)){var e=[s.clientX,s.clientY];i.push(e);setTimeout((function(){jh.remove(i,e)}),Pa.DEDUP_TIMEOUT)}};var La=function(t){Th.call(this);this.element_=t;this.pointerMap={};this.eventMap_={};this.eventSourceList_=[];this.registerSources()};kh.inherits(La,Th);La.prototype.registerSources=function(){if(ga.POINTER){this.registerSource("native",new Aa(this))}else if(ga.MSPOINTER){this.registerSource("ms",new Ta(this))}else{var t=new Oa(this);this.registerSource("mouse",t);if(ga.TOUCH){this.registerSource("touch",new Pa(this,t))}}this.register_()};La.prototype.registerSource=function(t,i){var s=i;var e=s.getEvents();if(e){e.forEach((function(t){var i=s.getHandlerForEvent(t);if(i){this.eventMap_[t]=i.bind(s)}}),this);this.eventSourceList_.push(s)}};La.prototype.register_=function(){var t=this.eventSourceList_.length;var i;for(var s=0;s<t;s++){i=this.eventSourceList_[s];this.addEvents_(i.getEvents())}};La.prototype.unregister_=function(){var t=this.eventSourceList_.length;var i;for(var s=0;s<t;s++){i=this.eventSourceList_[s];this.removeEvents_(i.getEvents())}};La.prototype.eventHandler_=function(t){var i=t.type;var s=this.eventMap_[i];if(s){s(t)}};La.prototype.addEvents_=function(t){t.forEach((function(t){Ih.listen(this.element_,t,this.eventHandler_,this)}),this)};La.prototype.removeEvents_=function(t){t.forEach((function(t){Ih.unlisten(this.element_,t,this.eventHandler_,this)}),this)};La.prototype.cloneEvent=function(t,i){var s={},e;for(var r=0,n=La.CLONE_PROPS.length;r<n;r++){e=La.CLONE_PROPS[r][0];s[e]=t[e]||i[e]||La.CLONE_PROPS[r][1]}return s};La.prototype.down=function(t,i){this.fireEvent(Ia.POINTERDOWN,t,i)};La.prototype.move=function(t,i){this.fireEvent(Ia.POINTERMOVE,t,i)};La.prototype.up=function(t,i){this.fireEvent(Ia.POINTERUP,t,i)};La.prototype.enter=function(t,i){t.bubbles=false;this.fireEvent(Ia.POINTERENTER,t,i)};La.prototype.leave=function(t,i){t.bubbles=false;this.fireEvent(Ia.POINTERLEAVE,t,i)};La.prototype.over=function(t,i){t.bubbles=true;this.fireEvent(Ia.POINTEROVER,t,i)};La.prototype.out=function(t,i){t.bubbles=true;this.fireEvent(Ia.POINTEROUT,t,i)};La.prototype.cancel=function(t,i){this.fireEvent(Ia.POINTERCANCEL,t,i)};La.prototype.leaveOut=function(t,i){this.out(t,i);if(!this.contains_(t.target,t.relatedTarget)){this.leave(t,i)}};La.prototype.enterOver=function(t,i){this.over(t,i);if(!this.contains_(t.target,t.relatedTarget)){this.enter(t,i)}};La.prototype.contains_=function(t,i){if(!t||!i){return false}return t.contains(i)};La.prototype.makeEvent=function(t,i,s){return new Ra(t,s,i)};La.prototype.fireEvent=function(t,i,s){var e=this.makeEvent(t,i,s);this.dispatchEvent(e)};La.prototype.fireNativeEvent=function(t){var i=this.makeEvent(t.type,t,t);this.dispatchEvent(i)};La.prototype.wrapMouseEvent=function(t,i){var s=this.makeEvent(t,Oa.prepareEvent(i,this),i);return s};La.prototype.disposeInternal=function(){this.unregister_();Th.prototype.disposeInternal.call(this)};La.CLONE_PROPS=[["bubbles",false],["cancelable",false],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",false],["altKey",false],["shiftKey",false],["metaKey",false],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",false],["type",""],["target",null],["currentTarget",null],["which",0]];var Da=function(t,i){Th.call(this);this.map_=t;this.clickTimeoutId_=0;this.dragging_=false;this.dragListenerKeys_=[];this.moveTolerance_=i?i*ga.DEVICE_PIXEL_RATIO:ga.DEVICE_PIXEL_RATIO;this.down_=null;var s=this.map_.getViewport();this.activePointers_=0;this.trackedTouches_={};this.pointerEventHandler_=new La(s);this.documentPointerEventHandler_=null;this.pointerdownListenerKey_=Ih.listen(this.pointerEventHandler_,Ia.POINTERDOWN,this.handlePointerDown_,this);this.relayedListenerKey_=Ih.listen(this.pointerEventHandler_,Ia.POINTERMOVE,this.relayEvent_,this)};kh.inherits(Da,Th);Da.prototype.emulateClick_=function(t){var i=new Ca(Na.CLICK,this.map_,t);this.dispatchEvent(i);if(this.clickTimeoutId_!==0){clearTimeout(this.clickTimeoutId_);this.clickTimeoutId_=0;i=new Ca(Na.DBLCLICK,this.map_,t);this.dispatchEvent(i)}else{this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=0;var i=new Ca(Na.SINGLECLICK,this.map_,t);this.dispatchEvent(i)}.bind(this),250)}};Da.prototype.updateActivePointers_=function(t){var i=t;if(i.type==Na.POINTERUP||i.type==Na.POINTERCANCEL){delete this.trackedTouches_[i.pointerId]}else if(i.type==Na.POINTERDOWN){this.trackedTouches_[i.pointerId]=true}this.activePointers_=Object.keys(this.trackedTouches_).length};Da.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var i=new Ca(Na.POINTERUP,this.map_,t);this.dispatchEvent(i);if(!i.propagationStopped&&!this.dragging_&&this.isMouseActionButton_(t)){this.emulateClick_(this.down_)}if(this.activePointers_===0){this.dragListenerKeys_.forEach(Ih.unlistenByKey);this.dragListenerKeys_.length=0;this.dragging_=false;this.down_=null;this.documentPointerEventHandler_.dispose();this.documentPointerEventHandler_=null}};Da.prototype.isMouseActionButton_=function(t){return t.button===0};Da.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var i=new Ca(Na.POINTERDOWN,this.map_,t);this.dispatchEvent(i);this.down_=t;if(this.dragListenerKeys_.length===0){this.documentPointerEventHandler_=new La(document);this.dragListenerKeys_.push(Ih.listen(this.documentPointerEventHandler_,Na.POINTERMOVE,this.handlePointerMove_,this),Ih.listen(this.documentPointerEventHandler_,Na.POINTERUP,this.handlePointerUp_,this),Ih.listen(this.pointerEventHandler_,Na.POINTERCANCEL,this.handlePointerUp_,this))}};Da.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=true;var i=new Ca(Na.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(i)}t.preventDefault()};Da.prototype.relayEvent_=function(t){var i=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new Ca(t.type,this.map_,t,i))};Da.prototype.isMoving_=function(t){return Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_};Da.prototype.disposeInternal=function(){if(this.relayedListenerKey_){Ih.unlistenByKey(this.relayedListenerKey_);this.relayedListenerKey_=null}if(this.pointerdownListenerKey_){Ih.unlistenByKey(this.pointerdownListenerKey_);this.pointerdownListenerKey_=null}this.dragListenerKeys_.forEach(Ih.unlistenByKey);this.dragListenerKeys_.length=0;if(this.documentPointerEventHandler_){this.documentPointerEventHandler_.dispose();this.documentPointerEventHandler_=null}if(this.pointerEventHandler_){this.pointerEventHandler_.dispose();this.pointerEventHandler_=null}Th.prototype.disposeInternal.call(this)};var Fa={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"};var Ga={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var Wa={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4,ABORT:5};var ja=function(t,i){this.priorityFunction_=t;this.keyFunction_=i;this.elements_=[];this.priorities_=[];this.queuedElements_={}};ja.DROP=Infinity;ja.prototype.clear=function(){this.elements_.length=0;this.priorities_.length=0;Ch.clear(this.queuedElements_)};ja.prototype.dequeue=function(){var t=this.elements_;var i=this.priorities_;var s=t[0];if(t.length==1){t.length=0;i.length=0}else{t[0]=t.pop();i[0]=i.pop();this.siftUp_(0)}var e=this.keyFunction_(s);delete this.queuedElements_[e];return s};ja.prototype.enqueue=function(t){Dh.assert(!(this.keyFunction_(t)in this.queuedElements_),31);var i=this.priorityFunction_(t);if(i!=ja.DROP){this.elements_.push(t);this.priorities_.push(i);this.queuedElements_[this.keyFunction_(t)]=true;this.siftDown_(0,this.elements_.length-1);return true}return false};ja.prototype.getCount=function(){return this.elements_.length};ja.prototype.getLeftChildIndex_=function(t){return t*2+1};ja.prototype.getRightChildIndex_=function(t){return t*2+2};ja.prototype.getParentIndex_=function(t){return t-1>>1};ja.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--){this.siftUp_(t)}};ja.prototype.isEmpty=function(){return this.elements_.length===0};ja.prototype.isKeyQueued=function(t){return t in this.queuedElements_};ja.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))};ja.prototype.siftUp_=function(t){var i=this.elements_;var s=this.priorities_;var e=i.length;var r=i[t];var n=s[t];var h=t;while(t<e>>1){var a=this.getLeftChildIndex_(t);var o=this.getRightChildIndex_(t);var f=o<e&&s[o]<s[a]?o:a;i[t]=i[f];s[t]=s[f];t=f}i[t]=r;s[t]=n;this.siftDown_(h,t)};ja.prototype.siftDown_=function(t,i){var s=this.elements_;var e=this.priorities_;var r=s[i];var n=e[i];while(i>t){var h=this.getParentIndex_(i);if(e[h]>n){s[i]=s[h];e[i]=e[h];i=h}else{break}}s[i]=r;e[i]=n};ja.prototype.reprioritize=function(){var t=this.priorityFunction_;var i=this.elements_;var s=this.priorities_;var e=0;var r=i.length;var n,h,a;for(h=0;h<r;++h){n=i[h];a=t(n);if(a==ja.DROP){delete this.queuedElements_[this.keyFunction_(n)]}else{s[e]=a;i[e++]=n}}i.length=e;s.length=e;this.heapify_()};var Va=function(t,i){ja.call(this,(function(i){return t.apply(null,i)}),(function(t){return t[0].getKey()}));this.tileChangeCallback_=i;this.tilesLoading_=0;this.tilesLoadingKeys_={}};kh.inherits(Va,ja);Va.prototype.enqueue=function(t){var i=ja.prototype.enqueue.call(this,t);if(i){var s=t[0];Ih.listen(s,Ah.CHANGE,this.handleTileChange,this)}return i};Va.prototype.getTilesLoading=function(){return this.tilesLoading_};Va.prototype.handleTileChange=function(t){var i=t.target;var s=i.getState();if(s===Wa.LOADED||s===Wa.ERROR||s===Wa.EMPTY||s===Wa.ABORT){Ih.unlisten(i,Ah.CHANGE,this.handleTileChange,this);var e=i.getKey();if(e in this.tilesLoadingKeys_){delete this.tilesLoadingKeys_[e];--this.tilesLoading_}this.tileChangeCallback_()}};Va.prototype.loadMoreTiles=function(t,i){var s=0;var e=false;var r,n,h;while(this.tilesLoading_<t&&s<i&&this.getCount()>0){n=this.dequeue()[0];h=n.getKey();r=n.getState();if(r===Wa.ABORT){e=true}else if(r===Wa.IDLE&&!(h in this.tilesLoadingKeys_)){this.tilesLoadingKeys_[h]=true;++this.tilesLoading_;++s;n.load()}}if(s===0&&e){this.tileChangeCallback_()}};var Ua={};Ua.createExtent=function(t){return function(i){if(i){return[Fh.clamp(i[0],t[0],t[2]),Fh.clamp(i[1],t[1],t[3])]}else{return undefined}}};Ua.none=function(t){return t};var qa={};qa.createSnapToResolutions=function(t){return function(i,s,e){if(i!==undefined){var r=jh.linearFindNearest(t,i,e);r=Fh.clamp(r+s,0,t.length-1);var n=Math.floor(r);if(r!=n&&n<t.length-1){var h=t[n]/t[n+1];return t[n]/Math.pow(h,r-n)}else{return t[n]}}else{return undefined}}};qa.createSnapToPower=function(t,i,s){return function(e,r,n){if(e!==undefined){var h=-n/2+.5;var a=Math.floor(Math.log(i/e)/Math.log(t)+h);var o=Math.max(a+r,0);if(s!==undefined){o=Math.min(o,s)}return i/Math.pow(t,o)}else{return undefined}}};var Xa={};Xa.disable=function(t,i){if(t!==undefined){return 0}else{return undefined}};Xa.none=function(t,i){if(t!==undefined){return t+i}else{return undefined}};Xa.createSnapToN=function(t){var i=2*Math.PI/t;return function(t,s){if(t!==undefined){t=Math.floor((t+s)/i+.5)*i;return t}else{return undefined}}};Xa.createSnapToZero=function(t){var i=t||Fh.toRadians(5);return function(t,s){if(t!==undefined){if(Math.abs(t+s)<=i){return 0}else{return t+s}}else{return undefined}}};var Ya={ANIMATING:0,INTERACTING:1};var Ba={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var Ha={};Ha.padNumber=function(t,i,s){var e=s!==undefined?t.toFixed(s):""+t;var r=e.indexOf(".");r=r===-1?e.length:r;return r>i?e:new Array(1+i-r).join("0")+e};Ha.compareVersions=function(t,i){var s=(""+t).split(".");var e=(""+i).split(".");for(var r=0;r<Math.max(s.length,e.length);r++){var n=parseInt(s[r]||"0",10);var h=parseInt(e[r]||"0",10);if(n>h){return 1}if(h>n){return-1}}return 0};var Ja={};Ja.add=function(t,i){t[0]+=i[0];t[1]+=i[1];return t};Ja.closestOnCircle=function(t,i){var s=i.getRadius();var e=i.getCenter();var r=e[0];var n=e[1];var h=t[0];var a=t[1];var o=h-r;var f=a-n;if(o===0&&f===0){o=1}var u=Math.sqrt(o*o+f*f);var v,l;v=r+s*o/u;l=n+s*f/u;return[v,l]};Ja.closestOnSegment=function(t,i){var s=t[0];var e=t[1];var r=i[0];var n=i[1];var h=r[0];var a=r[1];var o=n[0];var f=n[1];var u=o-h;var v=f-a;var l=u===0&&v===0?0:(u*(s-h)+v*(e-a))/(u*u+v*v||0);var c,d;if(l<=0){c=h;d=a}else if(l>=1){c=o;d=f}else{c=h+l*u;d=a+l*v}return[c,d]};Ja.createStringXY=function(t){return function(i){return Ja.toStringXY(i,t)}};Ja.degreesToStringHDMS=function(t,i,s){var e=Fh.modulo(i+180,360)-180;var r=Math.abs(3600*e);var n=s||0;var h=Math.pow(10,n);var a=Math.floor(r/3600);var o=Math.floor((r-a*3600)/60);var f=r-a*3600-o*60;f=Math.ceil(f*h)/h;if(f>=60){f=0;o+=1}if(o>=60){o=0;a+=1}return a+"° "+Ha.padNumber(o,2)+"′ "+Ha.padNumber(f,2,n)+"″"+(e==0?"":" "+t.charAt(e<0?1:0))};Ja.format=function(t,i,s){if(t){return i.replace("{x}",t[0].toFixed(s)).replace("{y}",t[1].toFixed(s))}else{return""}};Ja.equals=function(t,i){var s=true;for(var e=t.length-1;e>=0;--e){if(t[e]!=i[e]){s=false;break}}return s};Ja.rotate=function(t,i){var s=Math.cos(i);var e=Math.sin(i);var r=t[0]*s-t[1]*e;var n=t[1]*s+t[0]*e;t[0]=r;t[1]=n;return t};Ja.scale=function(t,i){t[0]*=i;t[1]*=i;return t};Ja.sub=function(t,i){t[0]-=i[0];t[1]-=i[1];return t};Ja.squaredDistance=function(t,i){var s=t[0]-i[0];var e=t[1]-i[1];return s*s+e*e};Ja.distance=function(t,i){return Math.sqrt(Ja.squaredDistance(t,i))};Ja.squaredDistanceToSegment=function(t,i){return Ja.squaredDistance(t,Ja.closestOnSegment(t,i))};Ja.toStringHDMS=function(t,i){if(t){return Ja.degreesToStringHDMS("NS",t[1],i)+" "+Ja.degreesToStringHDMS("EW",t[0],i)}else{return""}};Ja.toStringXY=function(t,i){return Ja.format(t,"{x}, {y}",i)};var Za={};Za.easeIn=function(t){return Math.pow(t,3)};Za.easeOut=function(t){return 1-Za.easeIn(1-t)};Za.inAndOut=function(t){return 3*t*t-2*t*t*t};Za.linear=function(t){return t};Za.upAndDown=function(t){if(t<.5){return Za.inAndOut(2*t)}else{return 1-Za.inAndOut(2*(t-.5))}};var Ka=function(t){Ph.call(this);var i=Ch.assign({},t);this.hints_=[0,0];this.animations_=[];this.updateAnimations_=this.updateAnimations_.bind(this);this.projection_=ia.createProjection(i.projection,"EPSG:3857");this.applyOptions_(i)};kh.inherits(Ka,Ph);Ka.prototype.applyOptions_=function(t){var i={};i[Ba.CENTER]=t.center!==undefined?t.center:null;var s=Ka.createResolutionConstraint_(t);this.maxResolution_=s.maxResolution;this.minResolution_=s.minResolution;this.zoomFactor_=s.zoomFactor;this.resolutions_=t.resolutions;this.minZoom_=s.minZoom;var e=Ka.createCenterConstraint_(t);var r=s.constraint;var n=Ka.createRotationConstraint_(t);this.constraints_={center:e,resolution:r,rotation:n};if(t.resolution!==undefined){i[Ba.RESOLUTION]=t.resolution}else if(t.zoom!==undefined){i[Ba.RESOLUTION]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_);if(this.resolutions_){i[Ba.RESOLUTION]=Fh.clamp(Number(this.getResolution()||i[Ba.RESOLUTION]),this.minResolution_,this.maxResolution_)}}i[Ba.ROTATION]=t.rotation!==undefined?t.rotation:0;this.setProperties(i);this.options_=t};Ka.prototype.getUpdatedOptions_=function(t){var i=Ch.assign({},this.options_);if(i.resolution!==undefined){i.resolution=this.getResolution()}else{i.zoom=this.getZoom()}i.center=this.getCenter();i.rotation=this.getRotation();return Ch.assign({},i,t)};Ka.prototype.animate=function(t){var i=arguments.length;var s;if(i>1&&typeof arguments[i-1]==="function"){s=arguments[i-1];--i}if(!this.isDef()){var e=arguments[i-1];if(e.center){this.setCenter(e.center)}if(e.zoom!==undefined){this.setZoom(e.zoom)}if(e.rotation!==undefined){this.setRotation(e.rotation)}if(s){s(true)}return}var r=Date.now();var n=this.getCenter().slice();var h=this.getResolution();var a=this.getRotation();var o=[];for(var f=0;f<i;++f){var u=arguments[f];var v={start:r,complete:false,anchor:u.anchor,duration:u.duration!==undefined?u.duration:1e3,easing:u.easing||Za.inAndOut};if(u.center){v.sourceCenter=n;v.targetCenter=u.center;n=v.targetCenter}if(u.zoom!==undefined){v.sourceResolution=h;v.targetResolution=this.constrainResolution(this.maxResolution_,u.zoom-this.minZoom_,0);h=v.targetResolution}else if(u.resolution){v.sourceResolution=h;v.targetResolution=u.resolution;h=v.targetResolution}if(u.rotation!==undefined){v.sourceRotation=a;var l=Fh.modulo(u.rotation-a+Math.PI,2*Math.PI)-Math.PI;v.targetRotation=a+l;a=v.targetRotation}v.callback=s;if(Ka.isNoopAnimation(v)){v.complete=true}else{r+=v.duration}o.push(v)}this.animations_.push(o);this.setHint(Ya.ANIMATING,1);this.updateAnimations_()};Ka.prototype.getAnimating=function(){return this.hints_[Ya.ANIMATING]>0};Ka.prototype.getInteracting=function(){return this.hints_[Ya.INTERACTING]>0};Ka.prototype.cancelAnimations=function(){this.setHint(Ya.ANIMATING,-this.hints_[Ya.ANIMATING]);for(var t=0,i=this.animations_.length;t<i;++t){var s=this.animations_[t];if(s[0].callback){s[0].callback(false)}}this.animations_.length=0};Ka.prototype.updateAnimations_=function(){if(this.updateAnimationKey_!==undefined){cancelAnimationFrame(this.updateAnimationKey_);this.updateAnimationKey_=undefined}if(!this.getAnimating()){return}var t=Date.now();var i=false;for(var s=this.animations_.length-1;s>=0;--s){var e=this.animations_[s];var r=true;for(var n=0,h=e.length;n<h;++n){var a=e[n];if(a.complete){continue}var o=t-a.start;var f=a.duration>0?o/a.duration:1;if(f>=1){a.complete=true;f=1}else{r=false}var u=a.easing(f);if(a.sourceCenter){var v=a.sourceCenter[0];var l=a.sourceCenter[1];var c=a.targetCenter[0];var d=a.targetCenter[1];var m=v+u*(c-v);var p=l+u*(d-l);this.set(Ba.CENTER,[m,p])}if(a.sourceResolution&&a.targetResolution){var M=u===1?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){this.set(Ba.CENTER,this.calculateCenterZoom(M,a.anchor))}this.set(Ba.RESOLUTION,M)}if(a.sourceRotation!==undefined&&a.targetRotation!==undefined){var z=u===1?Fh.modulo(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){this.set(Ba.CENTER,this.calculateCenterRotate(z,a.anchor))}this.set(Ba.ROTATION,z)}i=true;if(!a.complete){break}}if(r){this.animations_[s]=null;this.setHint(Ya.ANIMATING,-1);var _=e[0].callback;if(_){_(true)}}}this.animations_=this.animations_.filter(Boolean);if(i&&this.updateAnimationKey_===undefined){this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_)}};Ka.prototype.calculateCenterRotate=function(t,i){var s;var e=this.getCenter();if(e!==undefined){s=[e[0]-i[0],e[1]-i[1]];Ja.rotate(s,t-this.getRotation());Ja.add(s,i)}return s};Ka.prototype.calculateCenterZoom=function(t,i){var s;var e=this.getCenter();var r=this.getResolution();if(e!==undefined&&r!==undefined){var n=i[0]-t*(i[0]-e[0])/r;var h=i[1]-t*(i[1]-e[1])/r;s=[n,h]}return s};Ka.prototype.getSizeFromViewport_=function(){var t=[100,100];var i='.ol-viewport[data-view="'+kh.getUid(this)+'"]';var s=document.querySelector(i);if(s){var e=getComputedStyle(s);t[0]=parseInt(e.width,10);t[1]=parseInt(e.height,10)}return t};Ka.prototype.constrainCenter=function(t){return this.constraints_.center(t)};Ka.prototype.constrainResolution=function(t,i,s){var e=i||0;var r=s||0;return this.constraints_.resolution(t,e,r)};Ka.prototype.constrainRotation=function(t,i){var s=i||0;return this.constraints_.rotation(t,s)};Ka.prototype.getCenter=function(){return this.get(Ba.CENTER)};Ka.prototype.getConstraints=function(){return this.constraints_};Ka.prototype.getHints=function(t){if(t!==undefined){t[0]=this.hints_[0];t[1]=this.hints_[1];return t}else{return this.hints_.slice()}};Ka.prototype.calculateExtent=function(t){var i=t||this.getSizeFromViewport_();var s=this.getCenter();Dh.assert(s,1);var e=this.getResolution();Dh.assert(e!==undefined,2);var r=this.getRotation();Dh.assert(r!==undefined,3);return qh.getForViewAndSize(s,e,r,i)};Ka.prototype.getMaxResolution=function(){return this.maxResolution_};Ka.prototype.getMinResolution=function(){return this.minResolution_};Ka.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)};Ka.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))};Ka.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)};Ka.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))};Ka.prototype.getProjection=function(){return this.projection_};Ka.prototype.getResolution=function(){return this.get(Ba.RESOLUTION)};Ka.prototype.getResolutions=function(){return this.resolutions_};Ka.prototype.getResolutionForExtent=function(t,i){var s=i||this.getSizeFromViewport_();var e=qh.getWidth(t)/s[0];var r=qh.getHeight(t)/s[1];return Math.max(e,r)};Ka.prototype.getResolutionForValueFunction=function(t){var i=t||2;var s=this.maxResolution_;var e=this.minResolution_;var r=Math.log(s/e)/Math.log(i);return function(t){var e=s/Math.pow(i,t*r);return e}};Ka.prototype.getRotation=function(){return this.get(Ba.ROTATION)};Ka.prototype.getValueForResolutionFunction=function(t){var i=t||2;var s=this.maxResolution_;var e=this.minResolution_;var r=Math.log(s/e)/Math.log(i);return function(t){var e=Math.log(s/t)/Math.log(i)/r;return e}};Ka.prototype.getState=function(){var t=this.getCenter();var i=this.getProjection();var s=this.getResolution();var e=this.getRotation();return{center:t.slice(),projection:i!==undefined?i:null,resolution:s,rotation:e,zoom:this.getZoom()}};Ka.prototype.getZoom=function(){var t;var i=this.getResolution();if(i!==undefined){t=this.getZoomForResolution(i)}return t};Ka.prototype.getZoomForResolution=function(t){var i=this.minZoom_||0;var s,e;if(this.resolutions_){var r=jh.linearFindNearest(this.resolutions_,t,1);i=r;s=this.resolutions_[r];if(r==this.resolutions_.length-1){e=2}else{e=s/this.resolutions_[r+1]}}else{s=this.maxResolution_;e=this.zoomFactor_}return i+Math.log(s/t)/Math.log(e)};Ka.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)};Ka.prototype.fit=function(t,i){var s=i||{};var e=s.size;if(!e){e=this.getSizeFromViewport_()}var r;if(!(t instanceof ra)){Dh.assert(Array.isArray(t),24);Dh.assert(!qh.isEmpty(t),25);r=za.fromExtent(t)}else if(t.getType()===Gh.CIRCLE){t=t.getExtent();r=za.fromExtent(t);r.rotate(this.getRotation(),qh.getCenter(t))}else{r=t}var n=s.padding!==undefined?s.padding:[0,0,0,0];var h=s.constrainResolution!==undefined?s.constrainResolution:true;var a=s.nearest!==undefined?s.nearest:false;var o;if(s.minResolution!==undefined){o=s.minResolution}else if(s.maxZoom!==undefined){o=this.constrainResolution(this.maxResolution_,s.maxZoom-this.minZoom_,0)}else{o=0}var f=r.getFlatCoordinates();var u=this.getRotation();var v=Math.cos(-u);var l=Math.sin(-u);var c=+Infinity;var d=+Infinity;var m=-Infinity;var p=-Infinity;var M=r.getStride();for(var z=0,_=f.length;z<_;z+=M){var g=f[z]*v-f[z+1]*l;var w=f[z]*l+f[z+1]*v;c=Math.min(c,g);d=Math.min(d,w);m=Math.max(m,g);p=Math.max(p,w)}var y=this.getResolutionForExtent([c,d,m,p],[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]);y=isNaN(y)?o:Math.max(y,o);if(h){var b=this.constrainResolution(y,0,0);if(!a&&b<y){b=this.constrainResolution(b,-1,0)}y=b}l=-l;var x=(c+m)/2;var k=(d+p)/2;x+=(n[1]-n[3])/2*y;k+=(n[0]-n[2])/2*y;var E=x*v-k*l;var N=k*v+x*l;var C=[E,N];var I=s.callback?s.callback:kh.nullFunction;if(s.duration!==undefined){this.animate({resolution:y,center:C,duration:s.duration,easing:s.easing},I)}else{this.setResolution(y);this.setCenter(C);setTimeout(I.bind(undefined,true),0)}};Ka.prototype.centerOn=function(t,i,s){var e=this.getRotation();var r=Math.cos(-e);var n=Math.sin(-e);var h=t[0]*r-t[1]*n;var a=t[1]*r+t[0]*n;var o=this.getResolution();h+=(i[0]/2-s[0])*o;a+=(s[1]-i[1]/2)*o;n=-n;var f=h*r-a*n;var u=a*r+h*n;this.setCenter([f,u])};Ka.prototype.isDef=function(){return!!this.getCenter()&&this.getResolution()!==undefined};Ka.prototype.rotate=function(t,i){if(i!==undefined){var s=this.calculateCenterRotate(t,i);this.setCenter(s)}this.setRotation(t)};Ka.prototype.setCenter=function(t){this.set(Ba.CENTER,t);if(this.getAnimating()){this.cancelAnimations()}};Ka.prototype.setHint=function(t,i){this.hints_[t]+=i;this.changed();return this.hints_[t]};Ka.prototype.setResolution=function(t){this.set(Ba.RESOLUTION,t);if(this.getAnimating()){this.cancelAnimations()}};Ka.prototype.setRotation=function(t){this.set(Ba.ROTATION,t);if(this.getAnimating()){this.cancelAnimations()}};Ka.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))};Ka.createCenterConstraint_=function(t){if(t.extent!==undefined){return Ua.createExtent(t.extent)}else{return Ua.none}};Ka.createResolutionConstraint_=function(t){var i;var s;var e;var r=28;var n=2;var h=t.minZoom!==undefined?t.minZoom:kh.DEFAULT_MIN_ZOOM;var a=t.maxZoom!==undefined?t.maxZoom:r;var o=t.zoomFactor!==undefined?t.zoomFactor:n;if(t.resolutions!==undefined){var f=t.resolutions;s=f[h];e=f[a]!==undefined?f[a]:f[f.length-1];i=qa.createSnapToResolutions(f)}else{var u=ia.createProjection(t.projection,"EPSG:3857");var v=u.getExtent();var l=!v?360*ia.METERS_PER_UNIT[Hh.DEGREES]/u.getMetersPerUnit():Math.max(qh.getWidth(v),qh.getHeight(v));var c=l/kh.DEFAULT_TILE_SIZE/Math.pow(n,kh.DEFAULT_MIN_ZOOM);var d=c/Math.pow(n,r-kh.DEFAULT_MIN_ZOOM);s=t.maxResolution;if(s!==undefined){h=0}else{s=c/Math.pow(o,h)}e=t.minResolution;if(e===undefined){if(t.maxZoom!==undefined){if(t.maxResolution!==undefined){e=s/Math.pow(o,a)}else{e=c/Math.pow(o,a)}}else{e=d}}a=h+Math.floor(Math.log(s/e)/Math.log(o));e=s/Math.pow(o,a-h);i=qa.createSnapToPower(o,s,a-h)}return{constraint:i,maxResolution:s,minResolution:e,minZoom:h,zoomFactor:o}};Ka.createRotationConstraint_=function(t){var i=t.enableRotation!==undefined?t.enableRotation:true;if(i){var s=t.constrainRotation;if(s===undefined||s===true){return Xa.createSnapToZero()}else if(s===false){return Xa.none}else if(typeof s==="number"){return Xa.createSnapToN(s)}else{return Xa.none}}else{return Xa.disable}};Ka.isNoopAnimation=function(t){if(t.sourceCenter&&t.targetCenter){if(!Ja.equals(t.sourceCenter,t.targetCenter)){return false}}if(t.sourceResolution!==t.targetResolution){return false}if(t.sourceRotation!==t.targetRotation){return false}return true};var $a={};$a.createCanvasContext2D=function(t,i){var s=document.createElement("CANVAS");if(t){s.width=t}if(i){s.height=i}return s.getContext("2d")};$a.outerWidth=function(t){var i=t.offsetWidth;var s=getComputedStyle(t);i+=parseInt(s.marginLeft,10)+parseInt(s.marginRight,10);return i};$a.outerHeight=function(t){var i=t.offsetHeight;var s=getComputedStyle(t);i+=parseInt(s.marginTop,10)+parseInt(s.marginBottom,10);return i};$a.replaceNode=function(t,i){var s=i.parentNode;if(s){s.replaceChild(t,i)}};$a.removeNode=function(t){return t&&t.parentNode?t.parentNode.removeChild(t):null};$a.removeChildren=function(t){while(t.lastChild){t.removeChild(t.lastChild)}};var Qa={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",SOURCE:"source"};var to=function(t){Ph.call(this);var i=Ch.assign({},t);i[Qa.OPACITY]=t.opacity!==undefined?t.opacity:1;i[Qa.VISIBLE]=t.visible!==undefined?t.visible:true;i[Qa.Z_INDEX]=t.zIndex!==undefined?t.zIndex:0;i[Qa.MAX_RESOLUTION]=t.maxResolution!==undefined?t.maxResolution:Infinity;i[Qa.MIN_RESOLUTION]=t.minResolution!==undefined?t.minResolution:0;this.setProperties(i);this.state_={layer:this,managed:true}};kh.inherits(to,Ph);to.prototype.getType=function(){return this.type};to.prototype.getLayerState=function(){this.state_.opacity=Fh.clamp(this.getOpacity(),0,1);this.state_.sourceState=this.getSourceState();this.state_.visible=this.getVisible();this.state_.extent=this.getExtent();this.state_.zIndex=this.getZIndex();this.state_.maxResolution=this.getMaxResolution();this.state_.minResolution=Math.max(this.getMinResolution(),0);return this.state_};to.prototype.getLayersArray=function(t){};to.prototype.getLayerStatesArray=function(t){};to.prototype.getExtent=function(){return this.get(Qa.EXTENT)};to.prototype.getMaxResolution=function(){return this.get(Qa.MAX_RESOLUTION)};to.prototype.getMinResolution=function(){return this.get(Qa.MIN_RESOLUTION)};to.prototype.getOpacity=function(){return this.get(Qa.OPACITY)};to.prototype.getSourceState=function(){};to.prototype.getVisible=function(){return this.get(Qa.VISIBLE)};to.prototype.getZIndex=function(){return this.get(Qa.Z_INDEX)};to.prototype.setExtent=function(t){this.set(Qa.EXTENT,t)};to.prototype.setMaxResolution=function(t){this.set(Qa.MAX_RESOLUTION,t)};to.prototype.setMinResolution=function(t){this.set(Qa.MIN_RESOLUTION,t)};to.prototype.setOpacity=function(t){this.set(Qa.OPACITY,t)};to.prototype.setVisible=function(t){this.set(Qa.VISIBLE,t)};to.prototype.setZIndex=function(t){this.set(Qa.Z_INDEX,t)};var io={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};var so=function(t){var i=t||{};var s=Ch.assign({},i);delete s.layers;var e=i.layers;to.call(this,s);this.layersListenerKeys_=[];this.listenerKeys_={};Ih.listen(this,Ph.getChangeEventType(so.Property_.LAYERS),this.handleLayersChanged_,this);if(e){if(Array.isArray(e)){e=new xa(e.slice(),{unique:true})}else{Dh.assert(e instanceof xa,43);e=e}}else{e=new xa(undefined,{unique:true})}this.setLayers(e)};kh.inherits(so,to);so.prototype.handleLayerChange_=function(){this.changed()};so.prototype.handleLayersChanged_=function(t){this.layersListenerKeys_.forEach(Ih.unlistenByKey);this.layersListenerKeys_.length=0;var i=this.getLayers();this.layersListenerKeys_.push(Ih.listen(i,ba.ADD,this.handleLayersAdd_,this),Ih.listen(i,ba.REMOVE,this.handleLayersRemove_,this));for(var s in this.listenerKeys_){this.listenerKeys_[s].forEach(Ih.unlistenByKey)}Ch.clear(this.listenerKeys_);var e=i.getArray();var r,n,h;for(r=0,n=e.length;r<n;r++){h=e[r];this.listenerKeys_[kh.getUid(h).toString()]=[Ih.listen(h,Nh.PROPERTYCHANGE,this.handleLayerChange_,this),Ih.listen(h,Ah.CHANGE,this.handleLayerChange_,this)]}this.changed()};so.prototype.handleLayersAdd_=function(t){var i=t.element;var s=kh.getUid(i).toString();this.listenerKeys_[s]=[Ih.listen(i,Nh.PROPERTYCHANGE,this.handleLayerChange_,this),Ih.listen(i,Ah.CHANGE,this.handleLayerChange_,this)];this.changed()};so.prototype.handleLayersRemove_=function(t){var i=t.element;var s=kh.getUid(i).toString();this.listenerKeys_[s].forEach(Ih.unlistenByKey);delete this.listenerKeys_[s];this.changed()};so.prototype.getLayers=function(){return this.get(so.Property_.LAYERS)};so.prototype.setLayers=function(t){this.set(so.Property_.LAYERS,t)};so.prototype.getLayersArray=function(t){var i=t!==undefined?t:[];this.getLayers().forEach((function(t){t.getLayersArray(i)}));return i};so.prototype.getLayerStatesArray=function(t){var i=t!==undefined?t:[];var s=i.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(i)}));var e=this.getLayerState();var r,n,h;for(r=s,n=i.length;r<n;r++){h=i[r];h.opacity*=e.opacity;h.visible=h.visible&&e.visible;h.maxResolution=Math.min(h.maxResolution,e.maxResolution);h.minResolution=Math.max(h.minResolution,e.minResolution);if(e.extent!==undefined){if(h.extent!==undefined){h.extent=qh.getIntersection(h.extent,e.extent)}else{h.extent=e.extent}}}return i};so.prototype.getSourceState=function(){return io.READY};so.Property_={LAYERS:"layers"};var eo={MAP_RENDERER:"MAP_RENDERER",LAYER_RENDERER:"LAYER_RENDERER"};var ro={};ro.mapRendererPlugins_=[];ro.getMapRendererPlugins=function(){return ro.mapRendererPlugins_};ro.layerRendererPlugins_=[];ro.getLayerRendererPlugins=function(){return ro.layerRendererPlugins_};ro.register=function(t,i){var s;switch(t){case eo.MAP_RENDERER:{s=ro.mapRendererPlugins_;s.push(i);break}case eo.LAYER_RENDERER:{s=ro.layerRendererPlugins_;s.push(i);break}default:{throw new Error("Unsupported plugin type: "+t)}}};ro.registerMultiple=function(t,i){for(var s=0,e=i.length;s<e;++s){ro.register(t,i[s])}};var no={CANVAS:"canvas",WEBGL:"webgl"};var ho={};ho.buffer=function(t,i,s){if(s===undefined){s=[0,0]}s[0]=t[0]+2*i;s[1]=t[1]+2*i;return s};ho.hasArea=function(t){return t[0]>0&&t[1]>0};ho.scale=function(t,i,s){if(s===undefined){s=[0,0]}s[0]=t[0]*i+.5|0;s[1]=t[1]*i+.5|0;return s};ho.toSize=function(t,i){if(Array.isArray(t)){return t}else{if(i===undefined){i=[t,t]}else{i[0]=i[1]=t}return i}};var ao=function(t){Ph.call(this);var i=ao.createOptionsInternal(t);this.loadTilesWhileAnimating_=t.loadTilesWhileAnimating!==undefined?t.loadTilesWhileAnimating:false;this.loadTilesWhileInteracting_=t.loadTilesWhileInteracting!==undefined?t.loadTilesWhileInteracting:false;this.pixelRatio_=t.pixelRatio!==undefined?t.pixelRatio:ga.DEVICE_PIXEL_RATIO;this.logos_=i.logos;this.animationDelay_=function(){this.animationDelayKey_=undefined;this.renderFrame_.call(this,Date.now())}.bind(this);this.coordinateToPixelTransform_=sa.create();this.pixelToCoordinateTransform_=sa.create();this.frameIndex_=0;this.frameState_=null;this.previousExtent_=null;this.viewPropertyListenerKey_=null;this.viewChangeListenerKey_=null;this.layerGroupPropertyListenerKeys_=null;this.viewport_=document.createElement("DIV");this.viewport_.className="ol-viewport"+(ga.TOUCH?" ol-touch":"");this.viewport_.style.position="relative";this.viewport_.style.overflow="hidden";this.viewport_.style.width="100%";this.viewport_.style.height="100%";this.viewport_.style.msTouchAction="none";this.viewport_.style.touchAction="none";this.overlayContainer_=document.createElement("DIV");this.overlayContainer_.className="ol-overlaycontainer";this.viewport_.appendChild(this.overlayContainer_);this.overlayContainerStopEvent_=document.createElement("DIV");this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";var s=[Ah.CLICK,Ah.DBLCLICK,Ah.MOUSEDOWN,Ah.TOUCHSTART,Ah.MSPOINTERDOWN,Na.POINTERDOWN,Ah.MOUSEWHEEL,Ah.WHEEL];for(var e=0,r=s.length;e<r;++e){Ih.listen(this.overlayContainerStopEvent_,s[e],Oh.stopPropagation)}this.viewport_.appendChild(this.overlayContainerStopEvent_);this.mapBrowserEventHandler_=new Da(this,t.moveTolerance);for(var n in Na){Ih.listen(this.mapBrowserEventHandler_,Na[n],this.handleMapBrowserEvent,this)}this.keyboardEventTarget_=i.keyboardEventTarget;this.keyHandlerKeys_=null;Ih.listen(this.viewport_,Ah.WHEEL,this.handleBrowserEvent,this);Ih.listen(this.viewport_,Ah.MOUSEWHEEL,this.handleBrowserEvent,this);this.controls=i.controls||new xa;this.interactions=i.interactions||new xa;this.overlays_=i.overlays;this.overlayIdIndex_={};this.renderer_=i.mapRendererPlugin["create"](this.viewport_,this);this.focus_=null;this.postRenderFunctions_=[];this.tileQueue_=new Va(this.getTilePriority.bind(this),this.handleTileChange_.bind(this));this.skippedFeatureUids_={};Ih.listen(this,Ph.getChangeEventType(Ga.LAYERGROUP),this.handleLayerGroupChanged_,this);Ih.listen(this,Ph.getChangeEventType(Ga.VIEW),this.handleViewChanged_,this);Ih.listen(this,Ph.getChangeEventType(Ga.SIZE),this.handleSizeChanged_,this);Ih.listen(this,Ph.getChangeEventType(Ga.TARGET),this.handleTargetChanged_,this);this.setProperties(i.values);this.controls.forEach((function(t){t.setMap(this)}),this);Ih.listen(this.controls,ba.ADD,(function(t){t.element.setMap(this)}),this);Ih.listen(this.controls,ba.REMOVE,(function(t){t.element.setMap(null)}),this);this.interactions.forEach((function(t){t.setMap(this)}),this);Ih.listen(this.interactions,ba.ADD,(function(t){t.element.setMap(this)}),this);Ih.listen(this.interactions,ba.REMOVE,(function(t){t.element.setMap(null)}),this);this.overlays_.forEach(this.addOverlayInternal_,this);Ih.listen(this.overlays_,ba.ADD,(function(t){this.addOverlayInternal_(t.element)}),this);Ih.listen(this.overlays_,ba.REMOVE,(function(t){var i=t.element;var s=i.getId();if(s!==undefined){delete this.overlayIdIndex_[s.toString()]}t.element.setMap(null)}),this)};kh.inherits(ao,Ph);ao.prototype.addControl=function(t){this.getControls().push(t)};ao.prototype.addInteraction=function(t){this.getInteractions().push(t)};ao.prototype.addLayer=function(t){var i=this.getLayerGroup().getLayers();i.push(t)};ao.prototype.addOverlay=function(t){this.getOverlays().push(t)};ao.prototype.addOverlayInternal_=function(t){var i=t.getId();if(i!==undefined){this.overlayIdIndex_[i.toString()]=t}t.setMap(this)};ao.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose();Ih.unlisten(this.viewport_,Ah.WHEEL,this.handleBrowserEvent,this);Ih.unlisten(this.viewport_,Ah.MOUSEWHEEL,this.handleBrowserEvent,this);if(this.handleResize_!==undefined){window.removeEventListener(Ah.RESIZE,this.handleResize_,false);this.handleResize_=undefined}if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_);this.animationDelayKey_=undefined}this.setTarget(null);Ph.prototype.disposeInternal.call(this)};ao.prototype.forEachFeatureAtPixel=function(t,i,s){if(!this.frameState_){return}var e=this.getCoordinateFromPixel(t);s=s!==undefined?s:{};var r=s.hitTolerance!==undefined?s.hitTolerance*this.frameState_.pixelRatio:0;var n=s.layerFilter!==undefined?s.layerFilter:Yh.TRUE;return this.renderer_.forEachFeatureAtCoordinate(e,this.frameState_,r,i,null,n,null)};ao.prototype.getFeaturesAtPixel=function(t,i){var s=null;this.forEachFeatureAtPixel(t,(function(t){if(!s){s=[]}s.push(t)}),i);return s};ao.prototype.forEachLayerAtPixel=function(t,i,s,e,r){if(!this.frameState_){return}var n=s!==undefined?s:null;var h=e!==undefined?e:Yh.TRUE;var a=r!==undefined?r:null;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,n,h,a)};ao.prototype.hasFeatureAtPixel=function(t,i){if(!this.frameState_){return false}var s=this.getCoordinateFromPixel(t);i=i!==undefined?i:{};var e=i.layerFilter!==undefined?i.layerFilter:Yh.TRUE;var r=i.hitTolerance!==undefined?i.hitTolerance*this.frameState_.pixelRatio:0;return this.renderer_.hasFeatureAtCoordinate(s,this.frameState_,r,e,null)};ao.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))};ao.prototype.getEventPixel=function(t){var i=this.viewport_.getBoundingClientRect();var s=t.changedTouches?t.changedTouches[0]:t;return[s.clientX-i.left,s.clientY-i.top]};ao.prototype.getTarget=function(){return this.get(Ga.TARGET)};ao.prototype.getTargetElement=function(){var t=this.getTarget();if(t!==undefined){return typeof t==="string"?document.getElementById(t):t}else{return null}};ao.prototype.getCoordinateFromPixel=function(t){var i=this.frameState_;if(!i){return null}else{return sa.apply(i.pixelToCoordinateTransform,t.slice())}};ao.prototype.getControls=function(){return this.controls};ao.prototype.getOverlays=function(){return this.overlays_};ao.prototype.getOverlayById=function(t){var i=this.overlayIdIndex_[t.toString()];return i!==undefined?i:null};ao.prototype.getInteractions=function(){return this.interactions};ao.prototype.getLayerGroup=function(){return this.get(Ga.LAYERGROUP)};ao.prototype.getLayers=function(){var t=this.getLayerGroup().getLayers();return t};ao.prototype.getPixelFromCoordinate=function(t){var i=this.frameState_;if(!i){return null}else{return sa.apply(i.coordinateToPixelTransform,t.slice(0,2))}};ao.prototype.getRenderer=function(){return this.renderer_};ao.prototype.getSize=function(){return this.get(Ga.SIZE)};ao.prototype.getView=function(){return this.get(Ga.VIEW)};ao.prototype.getViewport=function(){return this.viewport_};ao.prototype.getOverlayContainer=function(){return this.overlayContainer_};ao.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_};ao.prototype.getTilePriority=function(t,i,s,e){var r=this.frameState_;if(!r||!(i in r.wantedTiles)){return ja.DROP}if(!r.wantedTiles[i][t.getKey()]){return ja.DROP}var n=s[0]-r.focus[0];var h=s[1]-r.focus[1];return 65536*Math.log(e)+Math.sqrt(n*n+h*h)/e};ao.prototype.handleBrowserEvent=function(t,i){var s=i||t.type;var e=new Ea(s,this,t);this.handleMapBrowserEvent(e)};ao.prototype.handleMapBrowserEvent=function(t){if(!this.frameState_){return}this.focus_=t.coordinate;t.frameState=this.frameState_;var i=this.getInteractions().getArray();var s;if(this.dispatchEvent(t)!==false){for(s=i.length-1;s>=0;s--){var e=i[s];if(!e.getActive()){continue}var r=e.handleEvent(t);if(!r){break}}}};ao.prototype.handlePostRender=function(){var t=this.frameState_;var i=this.tileQueue_;if(!i.isEmpty()){var s=16;var e=s;if(t){var r=t.viewHints;if(r[Ya.ANIMATING]){s=this.loadTilesWhileAnimating_?8:0;e=2}if(r[Ya.INTERACTING]){s=this.loadTilesWhileInteracting_?8:0;e=2}}if(i.getTilesLoading()<s){i.reprioritize();i.loadMoreTiles(s,e)}}var n=this.postRenderFunctions_;var h,a;for(h=0,a=n.length;h<a;++h){n[h](this,t)}n.length=0};ao.prototype.handleSizeChanged_=function(){this.render()};ao.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()){t=this.getTargetElement()}if(this.keyHandlerKeys_){for(var i=0,s=this.keyHandlerKeys_.length;i<s;++i){Ih.unlistenByKey(this.keyHandlerKeys_[i])}this.keyHandlerKeys_=null}if(!t){this.renderer_.removeLayerRenderers();$a.removeNode(this.viewport_);if(this.handleResize_!==undefined){window.removeEventListener(Ah.RESIZE,this.handleResize_,false);this.handleResize_=undefined}}else{t.appendChild(this.viewport_);var e=!this.keyboardEventTarget_?t:this.keyboardEventTarget_;this.keyHandlerKeys_=[Ih.listen(e,Ah.KEYDOWN,this.handleBrowserEvent,this),Ih.listen(e,Ah.KEYPRESS,this.handleBrowserEvent,this)];if(!this.handleResize_){this.handleResize_=this.updateSize.bind(this);window.addEventListener(Ah.RESIZE,this.handleResize_,false)}}this.updateSize()};ao.prototype.handleTileChange_=function(){this.render()};ao.prototype.handleViewPropertyChanged_=function(){this.render()};ao.prototype.handleViewChanged_=function(){if(this.viewPropertyListenerKey_){Ih.unlistenByKey(this.viewPropertyListenerKey_);this.viewPropertyListenerKey_=null}if(this.viewChangeListenerKey_){Ih.unlistenByKey(this.viewChangeListenerKey_);this.viewChangeListenerKey_=null}var t=this.getView();if(t){this.viewport_.setAttribute("data-view",kh.getUid(t));this.viewPropertyListenerKey_=Ih.listen(t,Nh.PROPERTYCHANGE,this.handleViewPropertyChanged_,this);this.viewChangeListenerKey_=Ih.listen(t,Ah.CHANGE,this.handleViewPropertyChanged_,this)}this.render()};ao.prototype.handleLayerGroupChanged_=function(){if(this.layerGroupPropertyListenerKeys_){this.layerGroupPropertyListenerKeys_.forEach(Ih.unlistenByKey);this.layerGroupPropertyListenerKeys_=null}var t=this.getLayerGroup();if(t){this.layerGroupPropertyListenerKeys_=[Ih.listen(t,Nh.PROPERTYCHANGE,this.render,this),Ih.listen(t,Ah.CHANGE,this.render,this)]}this.render()};ao.prototype.isRendered=function(){return!!this.frameState_};ao.prototype.renderSync=function(){if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_)}this.animationDelay_()};ao.prototype.render=function(){if(this.animationDelayKey_===undefined){this.animationDelayKey_=requestAnimationFrame(this.animationDelay_)}};ao.prototype.removeControl=function(t){return this.getControls().remove(t)};ao.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)};ao.prototype.removeLayer=function(t){var i=this.getLayerGroup().getLayers();return i.remove(t)};ao.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)};ao.prototype.renderFrame_=function(t){var i,s,e;var r=this.getSize();var n=this.getView();var h=qh.createEmpty();var a=this.frameState_;var o=null;if(r!==undefined&&ho.hasArea(r)&&n&&n.isDef()){var f=n.getHints(this.frameState_?this.frameState_.viewHints:undefined);var u=this.getLayerGroup().getLayerStatesArray();var v={};for(i=0,s=u.length;i<s;++i){v[kh.getUid(u[i].layer)]=u[i]}e=n.getState();var l=e.center;var c=e.resolution/this.pixelRatio_;l[0]=Math.round(l[0]/c)*c;l[1]=Math.round(l[1]/c)*c;o={animate:false,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:h,focus:!this.focus_?l:this.focus_,index:this.frameIndex_++,layerStates:v,layerStatesArray:u,logos:Ch.assign({},this.logos_),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:e,viewHints:f,wantedTiles:{}}}if(o){o.extent=qh.getForViewAndSize(e.center,e.resolution,e.rotation,o.size,h)}this.frameState_=o;this.renderer_.renderFrame(o);if(o){if(o.animate){this.render()}Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions);if(a){var d=!this.previousExtent_||!qh.isEmpty(this.previousExtent_)&&!qh.equals(o.extent,this.previousExtent_);if(d){this.dispatchEvent(new ka(Fa.MOVESTART,this,a));this.previousExtent_=qh.createOrUpdateEmpty(this.previousExtent_)}}var m=this.previousExtent_&&!o.viewHints[Ya.ANIMATING]&&!o.viewHints[Ya.INTERACTING]&&!qh.equals(o.extent,this.previousExtent_);if(m){this.dispatchEvent(new ka(Fa.MOVEEND,this,o));qh.clone(o.extent,this.previousExtent_)}}this.dispatchEvent(new ka(Fa.POSTRENDER,this,o));setTimeout(this.handlePostRender.bind(this),0)};ao.prototype.setLayerGroup=function(t){this.set(Ga.LAYERGROUP,t)};ao.prototype.setSize=function(t){this.set(Ga.SIZE,t)};ao.prototype.setTarget=function(t){this.set(Ga.TARGET,t)};ao.prototype.setView=function(t){this.set(Ga.VIEW,t)};ao.prototype.skipFeature=function(t){var i=kh.getUid(t).toString();this.skippedFeatureUids_[i]=true;this.render()};ao.prototype.updateSize=function(){var t=this.getTargetElement();if(!t){this.setSize(undefined)}else{var i=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(i["borderLeftWidth"])-parseFloat(i["paddingLeft"])-parseFloat(i["paddingRight"])-parseFloat(i["borderRightWidth"]),t.offsetHeight-parseFloat(i["borderTopWidth"])-parseFloat(i["paddingTop"])-parseFloat(i["paddingBottom"])-parseFloat(i["borderBottomWidth"])])}};ao.prototype.unskipFeature=function(t){var i=kh.getUid(t).toString();delete this.skippedFeatureUids_[i];this.render()};ao.DEFAULT_RENDERER_TYPES=[no.CANVAS,no.WEBGL];ao.LOGO_URL="data:image/png;base64,"+"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBI"+"WXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAA"+"AhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszW"+"WMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvY"+"asvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvX"+"H1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1Vk"+"bMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW"+"2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLP"+"VcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqT"+"acrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaar"+"ldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+Hi"+"zeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDn"+"BAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSF"+"hYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJ"+"REFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxC"+"Brb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe"+"0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8"+"a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7a"+"hgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCn"+"B3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDg"+"q82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC";ao.createOptionsInternal=function(t){var i=null;if(t.keyboardEventTarget!==undefined){i=typeof t.keyboardEventTarget==="string"?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget}var s={};var e={};if(t.logo===undefined||typeof t.logo==="boolean"&&t.logo){e[ao.LOGO_URL]="https://openlayers.org/"}else{var r=t.logo;if(typeof r==="string"){e[r]=""}else if(r instanceof HTMLElement){e[kh.getUid(r).toString()]=r}else if(r){Dh.assert(typeof r.href=="string",44);Dh.assert(typeof r.src=="string",45);e[r.src]=r.href}}var n=t.layers instanceof so?t.layers:new so({layers:t.layers});s[Ga.LAYERGROUP]=n;s[Ga.TARGET]=t.target;s[Ga.VIEW]=t.view!==undefined?t.view:new Ka;var h;if(t.renderer!==undefined){if(Array.isArray(t.renderer)){h=t.renderer}else if(typeof t.renderer==="string"){h=[t.renderer]}else{Dh.assert(false,46)}if(h.indexOf("dom")>=0){h=h.concat(ao.DEFAULT_RENDERER_TYPES)}}else{h=ao.DEFAULT_RENDERER_TYPES}var a;var o=ro.getMapRendererPlugins();t:for(var f=0,u=h.length;f<u;++f){var v=h[f];for(var l=0,c=o.length;l<c;++l){var d=o[l];if(d["handles"](v)){a=d;break t}}}if(!a){throw new Error("Unable to create a map renderer for types: "+h.join(", "))}var m;if(t.controls!==undefined){if(Array.isArray(t.controls)){m=new xa(t.controls.slice())}else{Dh.assert(t.controls instanceof xa,47);m=t.controls}}var p;if(t.interactions!==undefined){if(Array.isArray(t.interactions)){p=new xa(t.interactions.slice())}else{Dh.assert(t.interactions instanceof xa,48);p=t.interactions}}var M;if(t.overlays!==undefined){if(Array.isArray(t.overlays)){M=new xa(t.overlays.slice())}else{Dh.assert(t.overlays instanceof xa,49);M=t.overlays}}else{M=new xa}return{controls:m,interactions:p,keyboardEventTarget:i,logos:e,overlays:M,mapRendererPlugin:a,values:s}};var oo=function(t){Ph.call(this);this.element=t.element?t.element:null;this.target_=null;this.map_=null;this.listenerKeys=[];this.render=t.render?t.render:kh.nullFunction;if(t.target){this.setTarget(t.target)}};kh.inherits(oo,Ph);oo.prototype.disposeInternal=function(){$a.removeNode(this.element);Ph.prototype.disposeInternal.call(this)};oo.prototype.getMap=function(){return this.map_};oo.prototype.setMap=function(t){if(this.map_){$a.removeNode(this.element)}for(var i=0,s=this.listenerKeys.length;i<s;++i){Ih.unlistenByKey(this.listenerKeys[i])}this.listenerKeys.length=0;this.map_=t;if(this.map_){var e=this.target_?this.target_:t.getOverlayContainerStopEvent();e.appendChild(this.element);if(this.render!==kh.nullFunction){this.listenerKeys.push(Ih.listen(t,Fa.POSTRENDER,this.render,this))}t.render()}};oo.prototype.setTarget=function(t){this.target_=typeof t==="string"?document.getElementById(t):t};var fo={};fo.CLASS_HIDDEN="ol-hidden";fo.CLASS_SELECTABLE="ol-selectable";fo.CLASS_UNSELECTABLE="ol-unselectable";fo.CLASS_UNSUPPORTED="ol-unsupported";fo.CLASS_CONTROL="ol-control";fo.getFontFamilies=function(){var t;var i={};return function(s){if(!t){t=document.createElement("div").style}if(!(s in i)){t.font=s;var e=t.fontFamily;t.font="";if(!e){return null}i[s]=e.split(/,\s?/)}return i[s]}}();var uo={POSTCOMPOSE:"postcompose",PRECOMPOSE:"precompose",RENDER:"render"};var vo=function(t){var i=Ch.assign({},t);delete i.source;to.call(this,i);this.mapPrecomposeKey_=null;this.mapRenderKey_=null;this.sourceChangeKey_=null;if(t.map){this.setMap(t.map)}Ih.listen(this,Ph.getChangeEventType(Qa.SOURCE),this.handleSourcePropertyChange_,this);var s=t.source?t.source:null;this.setSource(s)};kh.inherits(vo,to);vo.visibleAtResolution=function(t,i){return t.visible&&i>=t.minResolution&&i<t.maxResolution};vo.prototype.getLayersArray=function(t){var i=t?t:[];i.push(this);return i};vo.prototype.getLayerStatesArray=function(t){var i=t?t:[];i.push(this.getLayerState());return i};vo.prototype.getSource=function(){var t=this.get(Qa.SOURCE);return t||null};vo.prototype.getSourceState=function(){var t=this.getSource();return!t?io.UNDEFINED:t.getState()};vo.prototype.handleSourceChange_=function(){this.changed()};vo.prototype.handleSourcePropertyChange_=function(){if(this.sourceChangeKey_){Ih.unlistenByKey(this.sourceChangeKey_);this.sourceChangeKey_=null}var t=this.getSource();if(t){this.sourceChangeKey_=Ih.listen(t,Ah.CHANGE,this.handleSourceChange_,this)}this.changed()};vo.prototype.setMap=function(t){if(this.mapPrecomposeKey_){Ih.unlistenByKey(this.mapPrecomposeKey_);this.mapPrecomposeKey_=null}if(!t){this.changed()}if(this.mapRenderKey_){Ih.unlistenByKey(this.mapRenderKey_);this.mapRenderKey_=null}if(t){this.mapPrecomposeKey_=Ih.listen(t,uo.PRECOMPOSE,(function(t){var i=this.getLayerState();i.managed=false;i.zIndex=Infinity;t.frameState.layerStatesArray.push(i);t.frameState.layerStates[kh.getUid(this)]=i}),this);this.mapRenderKey_=Ih.listen(this,Ah.CHANGE,t.render,t);this.changed()}};vo.prototype.setSource=function(t){this.set(Qa.SOURCE,t)};var lo=function(t){var i=t?t:{};this.ulElement_=document.createElement("UL");this.logoLi_=document.createElement("LI");this.ulElement_.appendChild(this.logoLi_);this.logoLi_.style.display="none";this.collapsed_=i.collapsed!==undefined?i.collapsed:true;this.collapsible_=i.collapsible!==undefined?i.collapsible:true;if(!this.collapsible_){this.collapsed_=false}var s=i.className!==undefined?i.className:"ol-attribution";var e=i.tipLabel!==undefined?i.tipLabel:"Attributions";var r=i.collapseLabel!==undefined?i.collapseLabel:"»";if(typeof r==="string"){this.collapseLabel_=document.createElement("span");this.collapseLabel_.textContent=r}else{this.collapseLabel_=r}var n=i.label!==undefined?i.label:"i";if(typeof n==="string"){this.label_=document.createElement("span");this.label_.textContent=n}else{this.label_=n}var h=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;var a=document.createElement("button");a.setAttribute("type","button");a.title=e;a.appendChild(h);Ih.listen(a,Ah.CLICK,this.handleClick_,this);var o=s+" "+fo.CLASS_UNSELECTABLE+" "+fo.CLASS_CONTROL+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible");var f=document.createElement("div");f.className=o;f.appendChild(this.ulElement_);f.appendChild(a);var u=i.render?i.render:lo.render;oo.call(this,{element:f,render:u,target:i.target});this.renderedAttributions_=[];this.renderedVisible_=true;this.logoElements_={}};kh.inherits(lo,oo);lo.prototype.getSourceAttributions_=function(t){var i={};var s=[];var e=t.layerStatesArray;var r=t.viewState.resolution;for(var n=0,h=e.length;n<h;++n){var a=e[n];if(!vo.visibleAtResolution(a,r)){continue}var o=a.layer.getSource();if(!o){continue}var f=o.getAttributions2();if(!f){continue}var u=f(t);if(!u){continue}if(Array.isArray(u)){for(var v=0,l=u.length;v<l;++v){if(!(u[v]in i)){s.push(u[v]);i[u[v]]=true}}}else{if(!(u in i)){s.push(u);i[u]=true}}}return s};lo.render=function(t){this.updateElement_(t.frameState)};lo.prototype.updateElement_=function(t){if(!t){if(this.renderedVisible_){this.element.style.display="none";this.renderedVisible_=false}return}var i=this.getSourceAttributions_(t);if(jh.equals(i,this.renderedAttributions_)){return}while(this.ulElement_.lastChild!==this.logoLi_){this.ulElement_.removeChild(this.ulElement_.lastChild)}for(var s=0,e=i.length;s<e;++s){var r=document.createElement("LI");r.innerHTML=i[s];this.ulElement_.appendChild(r)}if(i.length===0&&this.renderedAttributions_.length>0){this.element.classList.add("ol-logo-only")}else if(this.renderedAttributions_.length===0&&i.length>0){this.element.classList.remove("ol-logo-only")}var n=i.length>0||!Ch.isEmpty(t.logos);if(this.renderedVisible_!=n){this.element.style.display=n?"":"none";this.renderedVisible_=n}this.renderedAttributions_=i;this.insertLogos_(t)};lo.prototype.insertLogos_=function(t){var i;var s=t.logos;var e=this.logoElements_;for(i in e){if(!(i in s)){$a.removeNode(e[i]);delete e[i]}}var r,n,h;for(h in s){var a=s[h];if(a instanceof HTMLElement){this.logoLi_.appendChild(a);e[h]=a}if(!(h in e)){r=new Image;r.src=h;if(a===""){n=r}else{n=document.createElement("a");n.href=a;n.appendChild(r)}this.logoLi_.appendChild(n);e[h]=n}}this.logoLi_.style.display=!Ch.isEmpty(s)?"":"none"};lo.prototype.handleClick_=function(t){t.preventDefault();this.handleToggle_()};lo.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed");if(this.collapsed_){$a.replaceNode(this.collapseLabel_,this.label_)}else{$a.replaceNode(this.label_,this.collapseLabel_)}this.collapsed_=!this.collapsed_};lo.prototype.getCollapsible=function(){return this.collapsible_};lo.prototype.setCollapsible=function(t){if(this.collapsible_===t){return}this.collapsible_=t;this.element.classList.toggle("ol-uncollapsible");if(!t&&this.collapsed_){this.handleToggle_()}};lo.prototype.setCollapsed=function(t){if(!this.collapsible_||this.collapsed_===t){return}this.handleToggle_()};lo.prototype.getCollapsed=function(){return this.collapsed_};var co=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-rotate";var e=i.label!==undefined?i.label:"⇧";this.label_=null;if(typeof e==="string"){this.label_=document.createElement("span");this.label_.className="ol-compass";this.label_.textContent=e}else{this.label_=e;this.label_.classList.add("ol-compass")}var r=i.tipLabel?i.tipLabel:"Reset rotation";var n=document.createElement("button");n.className=s+"-reset";n.setAttribute("type","button");n.title=r;n.appendChild(this.label_);Ih.listen(n,Ah.CLICK,co.prototype.handleClick_,this);var h=s+" "+fo.CLASS_UNSELECTABLE+" "+fo.CLASS_CONTROL;var a=document.createElement("div");a.className=h;a.appendChild(n);var o=i.render?i.render:co.render;this.callResetNorth_=i.resetNorth?i.resetNorth:undefined;oo.call(this,{element:a,render:o,target:i.target});this.duration_=i.duration!==undefined?i.duration:250;this.autoHide_=i.autoHide!==undefined?i.autoHide:true;this.rotation_=undefined;if(this.autoHide_){this.element.classList.add(fo.CLASS_HIDDEN)}};kh.inherits(co,oo);co.prototype.handleClick_=function(t){t.preventDefault();if(this.callResetNorth_!==undefined){this.callResetNorth_()}else{this.resetNorth_()}};co.prototype.resetNorth_=function(){var t=this.getMap();var i=t.getView();if(!i){return}if(i.getRotation()!==undefined){if(this.duration_>0){i.animate({rotation:0,duration:this.duration_,easing:Za.easeOut})}else{i.setRotation(0)}}};co.render=function(t){var i=t.frameState;if(!i){return}var s=i.viewState.rotation;if(s!=this.rotation_){var e="rotate("+s+"rad)";if(this.autoHide_){var r=this.element.classList.contains(fo.CLASS_HIDDEN);if(!r&&s===0){this.element.classList.add(fo.CLASS_HIDDEN)}else if(r&&s!==0){this.element.classList.remove(fo.CLASS_HIDDEN)}}this.label_.style.msTransform=e;this.label_.style.webkitTransform=e;this.label_.style.transform=e}this.rotation_=s};var mo=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-zoom";var e=i.delta!==undefined?i.delta:1;var r=i.zoomInLabel!==undefined?i.zoomInLabel:"+";var n=i.zoomOutLabel!==undefined?i.zoomOutLabel:"−";var h=i.zoomInTipLabel!==undefined?i.zoomInTipLabel:"Zoom in";var a=i.zoomOutTipLabel!==undefined?i.zoomOutTipLabel:"Zoom out";var o=document.createElement("button");o.className=s+"-in";o.setAttribute("type","button");o.title=h;o.appendChild(typeof r==="string"?document.createTextNode(r):r);Ih.listen(o,Ah.CLICK,mo.prototype.handleClick_.bind(this,e));var f=document.createElement("button");f.className=s+"-out";f.setAttribute("type","button");f.title=a;f.appendChild(typeof n==="string"?document.createTextNode(n):n);Ih.listen(f,Ah.CLICK,mo.prototype.handleClick_.bind(this,-e));var u=s+" "+fo.CLASS_UNSELECTABLE+" "+fo.CLASS_CONTROL;var v=document.createElement("div");v.className=u;v.appendChild(o);v.appendChild(f);oo.call(this,{element:v,target:i.target});this.duration_=i.duration!==undefined?i.duration:250};kh.inherits(mo,oo);mo.prototype.handleClick_=function(t,i){i.preventDefault();this.zoomByDelta_(t)};mo.prototype.zoomByDelta_=function(t){var i=this.getMap();var s=i.getView();if(!s){return}var e=s.getResolution();if(e){var r=s.constrainResolution(e,t);if(this.duration_>0){if(s.getAnimating()){s.cancelAnimations()}s.animate({resolution:r,duration:this.duration_,easing:Za.easeOut})}else{s.setResolution(r)}}};var po={};po.defaults=function(t){var i=t?t:{};var s=new xa;var e=i.zoom!==undefined?i.zoom:true;if(e){s.push(new mo(i.zoomOptions))}var r=i.rotate!==undefined?i.rotate:true;if(r){s.push(new co(i.rotateOptions))}var n=i.attribution!==undefined?i.attribution:true;if(n){s.push(new lo(i.attributionOptions))}return s};var Mo=function(t,i,s){this.decay_=t;this.minVelocity_=i;this.delay_=s;this.points_=[];this.angle_=0;this.initialVelocity_=0};Mo.prototype.begin=function(){this.points_.length=0;this.angle_=0;this.initialVelocity_=0};Mo.prototype.update=function(t,i){this.points_.push(t,i,Date.now())};Mo.prototype.end=function(){if(this.points_.length<6){return false}var t=Date.now()-this.delay_;var i=this.points_.length-3;if(this.points_[i+2]<t){return false}var s=i-3;while(s>0&&this.points_[s+2]>t){s-=3}var e=this.points_[i+2]-this.points_[s+2];if(e<1e3/60){return false}var r=this.points_[i]-this.points_[s];var n=this.points_[i+1]-this.points_[s+1];this.angle_=Math.atan2(n,r);this.initialVelocity_=Math.sqrt(r*r+n*n)/e;return this.initialVelocity_>this.minVelocity_};Mo.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_};Mo.prototype.getAngle=function(){return this.angle_};var zo={ACTIVE:"active"};var _o=function(t){Ph.call(this);this.map_=null;this.setActive(true);this.handleEvent=t.handleEvent};kh.inherits(_o,Ph);_o.prototype.getActive=function(){return this.get(zo.ACTIVE)};_o.prototype.getMap=function(){return this.map_};_o.prototype.setActive=function(t){this.set(zo.ACTIVE,t)};_o.prototype.setMap=function(t){this.map_=t};_o.pan=function(t,i,s){var e=t.getCenter();if(e){var r=t.constrainCenter([e[0]+i[0],e[1]+i[1]]);if(s){t.animate({duration:s,easing:Za.linear,center:r})}else{t.setCenter(r)}}};_o.rotate=function(t,i,s,e){i=t.constrainRotation(i,0);_o.rotateWithoutConstraints(t,i,s,e)};_o.rotateWithoutConstraints=function(t,i,s,e){if(i!==undefined){var r=t.getRotation();var n=t.getCenter();if(r!==undefined&&n&&e>0){t.animate({rotation:i,anchor:s,duration:e,easing:Za.easeOut})}else{t.rotate(i,s)}}};_o.zoom=function(t,i,s,e,r){i=t.constrainResolution(i,0,r);_o.zoomWithoutConstraints(t,i,s,e)};_o.zoomByDelta=function(t,i,s,e){var r=t.getResolution();var n=t.constrainResolution(r,i,0);if(n!==undefined){var h=t.getResolutions();n=Fh.clamp(n,t.getMinResolution()||h[h.length-1],t.getMaxResolution()||h[0])}if(s&&n!==undefined&&n!==r){var a=t.getCenter();var o=t.calculateCenterZoom(n,s);o=t.constrainCenter(o);s=[(n*a[0]-r*o[0])/(n-r),(n*a[1]-r*o[1])/(n-r)]}_o.zoomWithoutConstraints(t,n,s,e)};_o.zoomWithoutConstraints=function(t,i,s,e){if(i){var r=t.getResolution();var n=t.getCenter();if(r!==undefined&&n&&i!==r&&e){t.animate({resolution:i,anchor:s,duration:e,easing:Za.easeOut})}else{if(s){var h=t.calculateCenterZoom(i,s);t.setCenter(h)}t.setResolution(i)}}};var go=function(t){var i=t?t:{};this.delta_=i.delta?i.delta:1;_o.call(this,{handleEvent:go.handleEvent});this.duration_=i.duration!==undefined?i.duration:250};kh.inherits(go,_o);go.handleEvent=function(t){var i=false;var s=t.originalEvent;if(t.type==Na.DBLCLICK){var e=t.map;var r=t.coordinate;var n=s.shiftKey?-this.delta_:this.delta_;var h=e.getView();_o.zoomByDelta(h,n,r,this.duration_);t.preventDefault();i=true}return!i};var wo={};wo.altKeyOnly=function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey};wo.altShiftKeysOnly=function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey};wo.always=Yh.TRUE;wo.click=function(t){return t.type==Na.CLICK};wo.mouseActionButton=function(t){var i=t.originalEvent;return i.button==0&&!(ga.WEBKIT&&ga.MAC&&i.ctrlKey)};wo.never=Yh.FALSE;wo.pointerMove=function(t){return t.type=="pointermove"};wo.singleClick=function(t){return t.type==Na.SINGLECLICK};wo.doubleClick=function(t){return t.type==Na.DBLCLICK};wo.noModifierKeys=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey};wo.platformModifierKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&(ga.MAC?i.metaKey:i.ctrlKey)&&!i.shiftKey};wo.shiftKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey};wo.targetNotEditable=function(t){var i=t.originalEvent.target;var s=i.tagName;return s!=="INPUT"&&s!=="SELECT"&&s!=="TEXTAREA"};wo.mouseOnly=function(t){Dh.assert(t.pointerEvent,56);return t.pointerEvent.pointerType=="mouse"};wo.primaryAction=function(t){var i=t.pointerEvent;return i.isPrimary&&i.button===0};var yo=function(t){var i=t?t:{};var s=i.handleEvent?i.handleEvent:yo.handleEvent;_o.call(this,{handleEvent:s});this.handleDownEvent_=i.handleDownEvent?i.handleDownEvent:yo.handleDownEvent;this.handleDragEvent_=i.handleDragEvent?i.handleDragEvent:yo.handleDragEvent;this.handleMoveEvent_=i.handleMoveEvent?i.handleMoveEvent:yo.handleMoveEvent;this.handleUpEvent_=i.handleUpEvent?i.handleUpEvent:yo.handleUpEvent;this.handlingDownUpSequence=false;this.trackedPointers_={};this.targetPointers=[]};kh.inherits(yo,_o);yo.centroid=function(t){var i=t.length;var s=0;var e=0;for(var r=0;r<i;r++){s+=t[r].clientX;e+=t[r].clientY}return[s/i,e/i]};yo.prototype.isPointerDraggingEvent_=function(t){var i=t.type;return i===Na.POINTERDOWN||i===Na.POINTERDRAG||i===Na.POINTERUP};yo.prototype.updateTrackedPointers_=function(t){if(this.isPointerDraggingEvent_(t)){var i=t.pointerEvent;var s=i.pointerId.toString();if(t.type==Na.POINTERUP){delete this.trackedPointers_[s]}else if(t.type==Na.POINTERDOWN){this.trackedPointers_[s]=i}else if(s in this.trackedPointers_){this.trackedPointers_[s]=i}this.targetPointers=Ch.getValues(this.trackedPointers_)}};yo.handleDragEvent=kh.nullFunction;yo.handleUpEvent=Yh.FALSE;yo.handleDownEvent=Yh.FALSE;yo.handleMoveEvent=kh.nullFunction;yo.handleEvent=function(t){if(!(t instanceof Ca)){return true}var i=false;this.updateTrackedPointers_(t);if(this.handlingDownUpSequence){if(t.type==Na.POINTERDRAG){this.handleDragEvent_(t)}else if(t.type==Na.POINTERUP){var s=this.handleUpEvent_(t);this.handlingDownUpSequence=s&&this.targetPointers.length>0}}else{if(t.type==Na.POINTERDOWN){var e=this.handleDownEvent_(t);this.handlingDownUpSequence=e;i=this.shouldStopEvent(e)}else if(t.type==Na.POINTERMOVE){this.handleMoveEvent_(t)}}return!i};yo.prototype.shouldStopEvent=function(t){return t};var bo=function(t){yo.call(this,{handleDownEvent:bo.handleDownEvent_,handleDragEvent:bo.handleDragEvent_,handleUpEvent:bo.handleUpEvent_});var i=t?t:{};this.kinetic_=i.kinetic;this.lastCentroid=null;this.condition_=i.condition?i.condition:wo.noModifierKeys;this.noKinetic_=false};kh.inherits(bo,yo);bo.handleDragEvent_=function(t){var i=this.targetPointers;var s=yo.centroid(i);if(i.length==this.lastPointersCount_){if(this.kinetic_){this.kinetic_.update(s[0],s[1])}if(this.lastCentroid){var e=this.lastCentroid[0]-s[0];var r=s[1]-this.lastCentroid[1];var n=t.map;var h=n.getView();var a=h.getState();var o=[e,r];Ja.scale(o,a.resolution);Ja.rotate(o,a.rotation);Ja.add(o,a.center);o=h.constrainCenter(o);h.setCenter(o)}}else if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=s;this.lastPointersCount_=i.length};bo.handleUpEvent_=function(t){var i=t.map;var s=i.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var e=this.kinetic_.getDistance();var r=this.kinetic_.getAngle();var n=s.getCenter();var h=i.getPixelFromCoordinate(n);var a=i.getCoordinateFromPixel([h[0]-e*Math.cos(r),h[1]-e*Math.sin(r)]);s.animate({center:s.constrainCenter(a),duration:500,easing:Za.easeOut})}s.setHint(Ya.INTERACTING,-1);return false}else{if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=null;return true}};bo.handleDownEvent_=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var i=t.map;var s=i.getView();this.lastCentroid=null;if(!this.handlingDownUpSequence){s.setHint(Ya.INTERACTING,1)}if(s.getAnimating()){s.setCenter(t.frameState.viewState.center)}if(this.kinetic_){this.kinetic_.begin()}this.noKinetic_=this.targetPointers.length>1;return true}else{return false}};bo.prototype.shouldStopEvent=Yh.FALSE;var xo=function(t){var i=t?t:{};yo.call(this,{handleDownEvent:xo.handleDownEvent_,handleDragEvent:xo.handleDragEvent_,handleUpEvent:xo.handleUpEvent_});this.condition_=i.condition?i.condition:wo.altShiftKeysOnly;this.lastAngle_=undefined;this.duration_=i.duration!==undefined?i.duration:250};kh.inherits(xo,yo);xo.handleDragEvent_=function(t){if(!wo.mouseOnly(t)){return}var i=t.map;var s=i.getView();if(s.getConstraints().rotation===Xa.disable){return}var e=i.getSize();var r=t.pixel;var n=Math.atan2(e[1]/2-r[1],r[0]-e[0]/2);if(this.lastAngle_!==undefined){var h=n-this.lastAngle_;var a=s.getRotation();_o.rotateWithoutConstraints(s,a-h)}this.lastAngle_=n};xo.handleUpEvent_=function(t){if(!wo.mouseOnly(t)){return true}var i=t.map;var s=i.getView();s.setHint(Ya.INTERACTING,-1);var e=s.getRotation();_o.rotate(s,e,undefined,this.duration_);return false};xo.handleDownEvent_=function(t){if(!wo.mouseOnly(t)){return false}if(wo.mouseActionButton(t)&&this.condition_(t)){var i=t.map;i.getView().setHint(Ya.INTERACTING,1);this.lastAngle_=undefined;return true}else{return false}};xo.prototype.shouldStopEvent=Yh.FALSE;var ko=function(t){this.geometry_=null;this.element_=document.createElement("div");this.element_.style.position="absolute";this.element_.className="ol-box "+t;this.map_=null;this.startPixel_=null;this.endPixel_=null};kh.inherits(ko,Sh);ko.prototype.disposeInternal=function(){this.setMap(null)};ko.prototype.render_=function(){var t=this.startPixel_;var i=this.endPixel_;var s="px";var e=this.element_.style;e.left=Math.min(t[0],i[0])+s;e.top=Math.min(t[1],i[1])+s;e.width=Math.abs(i[0]-t[0])+s;e.height=Math.abs(i[1]-t[1])+s};ko.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var i=this.element_.style;i.left=i.top=i.width=i.height="inherit"}this.map_=t;if(this.map_){this.map_.getOverlayContainer().appendChild(this.element_)}};ko.prototype.setPixels=function(t,i){this.startPixel_=t;this.endPixel_=i;this.createOrUpdateGeometry();this.render_()};ko.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_;var i=this.endPixel_;var s=[t,[t[0],i[1]],i,[i[0],t[1]]];var e=s.map(this.map_.getCoordinateFromPixel,this.map_);e[4]=e[0].slice();if(!this.geometry_){this.geometry_=new za([e])}else{this.geometry_.setCoordinates([e])}};ko.prototype.getGeometry=function(){return this.geometry_};var Eo=function(t){yo.call(this,{handleDownEvent:Eo.handleDownEvent_,handleDragEvent:Eo.handleDragEvent_,handleUpEvent:Eo.handleUpEvent_});var i=t?t:{};this.box_=new ko(i.className||"ol-dragbox");this.minArea_=i.minArea!==undefined?i.minArea:64;this.startPixel_=null;this.condition_=i.condition?i.condition:wo.always;this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:Eo.defaultBoxEndCondition};kh.inherits(Eo,yo);Eo.defaultBoxEndCondition=function(t,i,s){var e=s[0]-i[0];var r=s[1]-i[1];return e*e+r*r>=this.minArea_};Eo.handleDragEvent_=function(t){if(!wo.mouseOnly(t)){return}this.box_.setPixels(this.startPixel_,t.pixel);this.dispatchEvent(new Eo.Event(Eo.EventType_.BOXDRAG,t.coordinate,t))};Eo.prototype.getGeometry=function(){return this.box_.getGeometry()};Eo.prototype.onBoxEnd=kh.nullFunction;Eo.handleUpEvent_=function(t){if(!wo.mouseOnly(t)){return true}this.box_.setMap(null);if(this.boxEndCondition_(t,this.startPixel_,t.pixel)){this.onBoxEnd(t);this.dispatchEvent(new Eo.Event(Eo.EventType_.BOXEND,t.coordinate,t))}return false};Eo.handleDownEvent_=function(t){if(!wo.mouseOnly(t)){return false}if(wo.mouseActionButton(t)&&this.condition_(t)){this.startPixel_=t.pixel;this.box_.setMap(t.map);this.box_.setPixels(this.startPixel_,this.startPixel_);this.dispatchEvent(new Eo.Event(Eo.EventType_.BOXSTART,t.coordinate,t));return true}else{return false}};Eo.EventType_={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"};Eo.Event=function(t,i,s){Oh.call(this,t);this.coordinate=i;this.mapBrowserEvent=s};kh.inherits(Eo.Event,Oh);var No=function(t){var i=t?t:{};var s=i.condition?i.condition:wo.shiftKeyOnly;this.duration_=i.duration!==undefined?i.duration:200;this.out_=i.out!==undefined?i.out:false;Eo.call(this,{condition:s,className:i.className||"ol-dragzoom"})};kh.inherits(No,Eo);No.prototype.onBoxEnd=function(){var t=this.getMap();var i=t.getView();var s=t.getSize();var e=this.getGeometry().getExtent();if(this.out_){var r=i.calculateExtent(s);var n=qh.createOrUpdateFromCoordinates([t.getPixelFromCoordinate(qh.getBottomLeft(e)),t.getPixelFromCoordinate(qh.getTopRight(e))]);var h=i.getResolutionForExtent(n,s);qh.scaleFromCenter(r,1/h);e=r}var a=i.constrainResolution(i.getResolutionForExtent(e,s));var o=qh.getCenter(e);o=i.constrainCenter(o);i.animate({resolution:a,center:o,duration:this.duration_,easing:Za.easeOut})};var Co={LEFT:37,UP:38,RIGHT:39,DOWN:40};var Io=function(t){_o.call(this,{handleEvent:Io.handleEvent});var i=t||{};this.defaultCondition_=function(t){return wo.noModifierKeys(t)&&wo.targetNotEditable(t)};this.condition_=i.condition!==undefined?i.condition:this.defaultCondition_;this.duration_=i.duration!==undefined?i.duration:100;this.pixelDelta_=i.pixelDelta!==undefined?i.pixelDelta:128};kh.inherits(Io,_o);Io.handleEvent=function(t){var i=false;if(t.type==Ah.KEYDOWN){var s=t.originalEvent;var e=s.keyCode;if(this.condition_(t)&&(e==Co.DOWN||e==Co.LEFT||e==Co.RIGHT||e==Co.UP)){var r=t.map;var n=r.getView();var h=n.getResolution()*this.pixelDelta_;var a=0,o=0;if(e==Co.DOWN){o=-h}else if(e==Co.LEFT){a=-h}else if(e==Co.RIGHT){a=h}else{o=h}var f=[a,o];Ja.rotate(f,n.getRotation());_o.pan(n,f,this.duration_);t.preventDefault();i=true}}return!i};var So=function(t){_o.call(this,{handleEvent:So.handleEvent});var i=t?t:{};this.condition_=i.condition?i.condition:wo.targetNotEditable;this.delta_=i.delta?i.delta:1;this.duration_=i.duration!==undefined?i.duration:100};kh.inherits(So,_o);So.handleEvent=function(t){var i=false;if(t.type==Ah.KEYDOWN||t.type==Ah.KEYPRESS){var s=t.originalEvent;var e=s.charCode;if(this.condition_(t)&&(e=="+".charCodeAt(0)||e=="-".charCodeAt(0))){var r=t.map;var n=e=="+".charCodeAt(0)?this.delta_:-this.delta_;var h=r.getView();_o.zoomByDelta(h,n,undefined,this.duration_);t.preventDefault();i=true}}return!i};var Oo=function(t){_o.call(this,{handleEvent:Oo.handleEvent});var i=t||{};this.delta_=0;this.duration_=i.duration!==undefined?i.duration:250;this.timeout_=i.timeout!==undefined?i.timeout:80;this.useAnchor_=i.useAnchor!==undefined?i.useAnchor:true;this.constrainResolution_=i.constrainResolution||false;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_=undefined;this.mode_=undefined;this.trackpadEventGap_=400;this.trackpadTimeoutId_=undefined;this.trackpadDeltaPerZoom_=300;this.trackpadZoomBuffer_=1.5};kh.inherits(Oo,_o);Oo.handleEvent=function(t){var i=t.type;if(i!==Ah.WHEEL&&i!==Ah.MOUSEWHEEL){return true}t.preventDefault();var s=t.map;var e=t.originalEvent;if(this.useAnchor_){this.lastAnchor_=t.coordinate}var r;if(t.type==Ah.WHEEL){r=e.deltaY;if(ga.FIREFOX&&e.deltaMode===WheelEvent.DOM_DELTA_PIXEL){r/=ga.DEVICE_PIXEL_RATIO}if(e.deltaMode===WheelEvent.DOM_DELTA_LINE){r*=40}}else if(t.type==Ah.MOUSEWHEEL){r=-e.wheelDeltaY;if(ga.SAFARI){r/=3}}if(r===0){return false}var n=Date.now();if(this.startTime_===undefined){this.startTime_=n}if(!this.mode_||n-this.startTime_>this.trackpadEventGap_){this.mode_=Math.abs(r)<4?Oo.Mode_.TRACKPAD:Oo.Mode_.WHEEL}if(this.mode_===Oo.Mode_.TRACKPAD){var h=s.getView();if(this.trackpadTimeoutId_){clearTimeout(this.trackpadTimeoutId_)}else{h.setHint(Ya.INTERACTING,1)}this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=h.getResolution()*Math.pow(2,r/this.trackpadDeltaPerZoom_);var o=h.getMinResolution();var f=h.getMaxResolution();var u=0;if(a<o){a=Math.max(a,o/this.trackpadZoomBuffer_);u=1}else if(a>f){a=Math.min(a,f*this.trackpadZoomBuffer_);u=-1}if(this.lastAnchor_){var v=h.calculateCenterZoom(a,this.lastAnchor_);h.setCenter(h.constrainCenter(v))}h.setResolution(a);if(u===0&&this.constrainResolution_){h.animate({resolution:h.constrainResolution(a,r>0?-1:1),easing:Za.easeOut,anchor:this.lastAnchor_,duration:this.duration_})}if(u>0){h.animate({resolution:o,easing:Za.easeOut,anchor:this.lastAnchor_,duration:500})}else if(u<0){h.animate({resolution:f,easing:Za.easeOut,anchor:this.lastAnchor_,duration:500})}this.startTime_=n;return false}this.delta_+=r;var l=Math.max(this.timeout_-(n-this.startTime_),0);clearTimeout(this.timeoutId_);this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,s),l);return false};Oo.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=undefined;var t=this.getMap().getView();t.setHint(Ya.INTERACTING,-1)};Oo.prototype.handleWheelZoom_=function(t){var i=t.getView();if(i.getAnimating()){i.cancelAnimations()}var s=kh.MOUSEWHEELZOOM_MAXDELTA;var e=Fh.clamp(this.delta_,-s,s);_o.zoomByDelta(i,-e,this.lastAnchor_,this.duration_);this.mode_=undefined;this.delta_=0;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_=undefined};Oo.prototype.setMouseAnchor=function(t){this.useAnchor_=t;if(!t){this.lastAnchor_=null}};Oo.Mode_={TRACKPAD:"trackpad",WHEEL:"wheel"};var To=function(t){yo.call(this,{handleDownEvent:To.handleDownEvent_,handleDragEvent:To.handleDragEvent_,handleUpEvent:To.handleUpEvent_});var i=t||{};this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;this.threshold_=i.threshold!==undefined?i.threshold:.3;this.duration_=i.duration!==undefined?i.duration:250};kh.inherits(To,yo);To.handleDragEvent_=function(t){var i=0;var s=this.targetPointers[0];var e=this.targetPointers[1];var r=Math.atan2(e.clientY-s.clientY,e.clientX-s.clientX);if(this.lastAngle_!==undefined){var n=r-this.lastAngle_;this.rotationDelta_+=n;if(!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_){this.rotating_=true}i=n}this.lastAngle_=r;var h=t.map;var a=h.getView();if(a.getConstraints().rotation===Xa.disable){return}var o=h.getViewport().getBoundingClientRect();var f=yo.centroid(this.targetPointers);f[0]-=o.left;f[1]-=o.top;this.anchor_=h.getCoordinateFromPixel(f);if(this.rotating_){var u=a.getRotation();h.render();_o.rotateWithoutConstraints(a,u+i,this.anchor_)}};To.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map;var s=i.getView();s.setHint(Ya.INTERACTING,-1);if(this.rotating_){var e=s.getRotation();_o.rotate(s,e,this.anchor_,this.duration_)}return false}else{return true}};To.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;if(!this.handlingDownUpSequence){i.getView().setHint(Ya.INTERACTING,1)}return true}else{return false}};To.prototype.shouldStopEvent=Yh.FALSE;var Ao=function(t){yo.call(this,{handleDownEvent:Ao.handleDownEvent_,handleDragEvent:Ao.handleDragEvent_,handleUpEvent:Ao.handleUpEvent_});var i=t?t:{};this.constrainResolution_=i.constrainResolution||false;this.anchor_=null;this.duration_=i.duration!==undefined?i.duration:400;this.lastDistance_=undefined;this.lastScaleDelta_=1};kh.inherits(Ao,yo);Ao.handleDragEvent_=function(t){var i=1;var s=this.targetPointers[0];var e=this.targetPointers[1];var r=s.clientX-e.clientX;var n=s.clientY-e.clientY;var h=Math.sqrt(r*r+n*n);if(this.lastDistance_!==undefined){i=this.lastDistance_/h}this.lastDistance_=h;var a=t.map;var o=a.getView();var f=o.getResolution();var u=o.getMaxResolution();var v=o.getMinResolution();var l=f*i;if(l>u){i=u/f;l=u}else if(l<v){i=v/f;l=v}if(i!=1){this.lastScaleDelta_=i}var c=a.getViewport().getBoundingClientRect();var d=yo.centroid(this.targetPointers);d[0]-=c.left;d[1]-=c.top;this.anchor_=a.getCoordinateFromPixel(d);a.render();_o.zoomWithoutConstraints(o,l,this.anchor_)};Ao.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map;var s=i.getView();s.setHint(Ya.INTERACTING,-1);var e=s.getResolution();if(this.constrainResolution_||e<s.getMinResolution()||e>s.getMaxResolution()){var r=this.lastScaleDelta_-1;_o.zoom(s,e,this.anchor_,this.duration_,r)}return false}else{return true}};Ao.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;this.anchor_=null;this.lastDistance_=undefined;this.lastScaleDelta_=1;if(!this.handlingDownUpSequence){i.getView().setHint(Ya.INTERACTING,1)}return true}else{return false}};Ao.prototype.shouldStopEvent=Yh.FALSE;var Ro={};Ro.defaults=function(t){var i=t?t:{};var s=new xa;var e=new Mo(-.005,.05,100);var r=i.altShiftDragRotate!==undefined?i.altShiftDragRotate:true;if(r){s.push(new xo)}var n=i.doubleClickZoom!==undefined?i.doubleClickZoom:true;if(n){s.push(new go({delta:i.zoomDelta,duration:i.zoomDuration}))}var h=i.dragPan!==undefined?i.dragPan:true;if(h){s.push(new bo({kinetic:e}))}var a=i.pinchRotate!==undefined?i.pinchRotate:true;if(a){s.push(new To)}var o=i.pinchZoom!==undefined?i.pinchZoom:true;if(o){s.push(new Ao({constrainResolution:i.constrainResolution,duration:i.zoomDuration}))}var f=i.keyboard!==undefined?i.keyboard:true;if(f){s.push(new Io);s.push(new So({delta:i.zoomDelta,duration:i.zoomDuration}))}var u=i.mouseWheelZoom!==undefined?i.mouseWheelZoom:true;if(u){s.push(new Oo({constrainResolution:i.constrainResolution,duration:i.zoomDuration}))}var v=i.shiftDragZoom!==undefined?i.shiftDragZoom:true;if(v){s.push(new No({duration:i.zoomDuration}))}return s};var Po=function(t,i,s,e){Th.call(this);this.extent=t;this.pixelRatio_=s;this.resolution=i;this.state=e};kh.inherits(Po,Th);Po.prototype.changed=function(){this.dispatchEvent(Ah.CHANGE)};Po.prototype.getExtent=function(){return this.extent};Po.prototype.getImage=function(){};Po.prototype.getPixelRatio=function(){return this.pixelRatio_};Po.prototype.getResolution=function(){return this.resolution};Po.prototype.getState=function(){return this.state};Po.prototype.load=function(){};var Lo={IDLE:0,LOADING:1,LOADED:2,ERROR:3};var Do=function(t,i,s,e,r){this.loader_=r!==undefined?r:null;var n=r!==undefined?Lo.IDLE:Lo.LOADED;Po.call(this,t,i,s,n);this.canvas_=e;this.error_=null};kh.inherits(Do,Po);Do.prototype.getError=function(){return this.error_};Do.prototype.handleLoad_=function(t){if(t){this.error_=t;this.state=Lo.ERROR}else{this.state=Lo.LOADED}this.changed()};Do.prototype.load=function(){if(this.state==Lo.IDLE){this.state=Lo.LOADING;this.changed();this.loader_(this.handleLoad_.bind(this))}};Do.prototype.getImage=function(){return this.canvas_};var Fo={IMAGE:"IMAGE",TILE:"TILE",VECTOR_TILE:"VECTOR_TILE",VECTOR:"VECTOR"};var Go={IMAGE:"image",VECTOR:"vector"};var Wo=function(t,i,s,e,r){Oh.call(this,t);this.vectorContext=i;this.frameState=s;this.context=e;this.glContext=r};kh.inherits(Wo,Oh);var jo=function(t){Th.call(this);this.highWaterMark=t!==undefined?t:2048;this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null};kh.inherits(jo,Th);jo.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark};jo.prototype.clear=function(){this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null;this.dispatchEvent(Ah.CLEAR)};jo.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)};jo.prototype.forEach=function(t,i){var s=this.oldest_;while(s){t.call(i,s.value_,s.key_,this);s=s.newer}};jo.prototype.get=function(t){var i=this.entries_[t];Dh.assert(i!==undefined,15);if(i===this.newest_){return i.value_}else if(i===this.oldest_){this.oldest_=this.oldest_.newer;this.oldest_.older=null}else{i.newer.older=i.older;i.older.newer=i.newer}i.newer=null;i.older=this.newest_;this.newest_.newer=i;this.newest_=i;return i.value_};jo.prototype.remove=function(t){var i=this.entries_[t];Dh.assert(i!==undefined,15);if(i===this.newest_){this.newest_=i.older;if(this.newest_){this.newest_.newer=null}}else if(i===this.oldest_){this.oldest_=i.newer;if(this.oldest_){this.oldest_.older=null}}else{i.newer.older=i.older;i.older.newer=i.newer}delete this.entries_[t];--this.count_;return i.value_};jo.prototype.getCount=function(){return this.count_};jo.prototype.getKeys=function(){var t=new Array(this.count_);var i=0;var s;for(s=this.newest_;s;s=s.older){t[i++]=s.key_}return t};jo.prototype.getValues=function(){var t=new Array(this.count_);var i=0;var s;for(s=this.newest_;s;s=s.older){t[i++]=s.value_}return t};jo.prototype.peekLast=function(){return this.oldest_.value_};jo.prototype.peekLastKey=function(){return this.oldest_.key_};jo.prototype.peekFirstKey=function(){return this.newest_.key_};jo.prototype.pop=function(){var t=this.oldest_;delete this.entries_[t.key_];if(t.newer){t.newer.older=null}this.oldest_=t.newer;if(!this.oldest_){this.newest_=null}--this.count_;return t.value_};jo.prototype.replace=function(t,i){this.get(t);this.entries_[t].value_=i};jo.prototype.set=function(t,i){Dh.assert(!(t in this.entries_),16);var s={key_:t,newer:null,older:this.newest_,value_:i};if(!this.newest_){this.oldest_=s}else{this.newest_.newer=s}this.newest_=s;this.entries_[t]=s;++this.count_};jo.prototype.prune=function(){while(this.canExpireCache()){this.pop()}};var Vo={};Vo.defaultFont="10px sans-serif";Vo.defaultFillStyle=[0,0,0,1];Vo.defaultLineCap="round";Vo.defaultLineDash=[];Vo.defaultLineDashOffset=0;Vo.defaultLineJoin="round";Vo.defaultMiterLimit=10;Vo.defaultStrokeStyle=[0,0,0,1];Vo.defaultTextAlign="center";Vo.defaultTextBaseline="middle";Vo.defaultPadding=[0,0,0,0];Vo.defaultLineWidth=1;Vo.labelCache=new jo;Vo.checkedFonts_={};Vo.measureContext_=null;Vo.textHeights_={};Vo.checkFont=function(){var t=60;var i=Vo.checkedFonts_;var s=Vo.labelCache;var e="32px monospace";var r="wmytzilWMYTZIL@#/&?$%10";var n,h;function a(t){var i=Vo.getMeasureContext();i.font=e;h=i.measureText(r).width;var s=true;if(t!="monospace"){i.font="32px "+t+",monospace";var n=i.measureText(r).width;s=n!=h}return s}function o(){var e=true;for(var r in i){if(i[r]<t){if(a(r)){i[r]=t;Ch.clear(Vo.textHeights_);Vo.measureContext_=null;s.clear()}else{++i[r];e=false}}}if(e){window.clearInterval(n);n=undefined}}return function(s){var e=fo.getFontFamilies(s);if(!e){return}for(var r=0,h=e.length;r<h;++r){var f=e[r];if(!(f in i)){i[f]=t;if(!a(f)){i[f]=0;if(n===undefined){n=window.setInterval(o,32)}}}}}}();Vo.getMeasureContext=function(){var t=Vo.measureContext_;if(!t){t=Vo.measureContext_=$a.createCanvasContext2D(1,1)}return t};Vo.measureTextHeight=function(){var t;var i=Vo.textHeights_;return function(s){var e=i[s];if(e==undefined){if(!t){t=document.createElement("span");t.textContent="M";t.style.margin=t.style.padding="0 !important";t.style.position="absolute !important";t.style.left="-99999px !important"}t.style.font=s;document.body.appendChild(t);e=i[s]=t.offsetHeight;document.body.removeChild(t)}return e}}();Vo.measureTextWidth=function(t,i){var s=Vo.getMeasureContext();if(t!=s.font){s.font=t}return s.measureText(i).width};Vo.rotateAtOffset=function(t,i,s,e){if(i!==0){t.translate(s,e);t.rotate(i);t.translate(-s,-e)}};Vo.resetTransform_=sa.create();Vo.drawImage=function(t,i,s,e,r,n,h,a,o,f,u){var v;if(s!=1){v=t.globalAlpha;t.globalAlpha=v*s}if(i){t.setTransform.apply(t,i)}t.drawImage(e,r,n,h,a,o,f,h*u,a*u);if(v){t.globalAlpha=v}if(i){t.setTransform.apply(t,Vo.resetTransform_)}};var Uo={};Uo.HEX_COLOR_RE_=/^#(?:[0-9a-f]{3,4}){1,2}$/i;Uo.NAMED_COLOR_RE_=/^([a-z]*)$/i;Uo.asArray=function(t){if(Array.isArray(t)){return t}else{return Uo.fromString(t)}};Uo.asString=function(t){if(typeof t==="string"){return t}else{return Uo.toString(t)}};Uo.fromNamed=function(t){var i=document.createElement("div");i.style.color=t;document.body.appendChild(i);var s=getComputedStyle(i).color;document.body.removeChild(i);return s};Uo.fromString=function(){var t=1024;var i={};var s=0;return function(e){var r;if(i.hasOwnProperty(e)){r=i[e]}else{if(s>=t){var n=0;var h;for(h in i){if((n++&3)===0){delete i[h];--s}}}r=Uo.fromStringInternal_(e);i[e]=r;++s}return r}}();Uo.fromStringInternal_=function(t){var i,s,e,r,n,h;if(Uo.NAMED_COLOR_RE_.exec(t)){t=Uo.fromNamed(t)}if(Uo.HEX_COLOR_RE_.exec(t)){var a=t.length-1;var o;if(a<=4){o=1}else{o=2}var f=a===4||a===8;i=parseInt(t.substr(1+0*o,o),16);s=parseInt(t.substr(1+1*o,o),16);e=parseInt(t.substr(1+2*o,o),16);if(f){r=parseInt(t.substr(1+3*o,o),16)}else{r=255}if(o==1){i=(i<<4)+i;s=(s<<4)+s;e=(e<<4)+e;if(f){r=(r<<4)+r}}n=[i,s,e,r/255]}else if(t.indexOf("rgba(")==0){h=t.slice(5,-1).split(",").map(Number);n=Uo.normalize(h)}else if(t.indexOf("rgb(")==0){h=t.slice(4,-1).split(",").map(Number);h.push(1);n=Uo.normalize(h)}else{Dh.assert(false,14)}return n};Uo.normalize=function(t,i){var s=i||[];s[0]=Fh.clamp(t[0]+.5|0,0,255);s[1]=Fh.clamp(t[1]+.5|0,0,255);s[2]=Fh.clamp(t[2]+.5|0,0,255);s[3]=Fh.clamp(t[3],0,1);return s};Uo.toString=function(t){var i=t[0];if(i!=(i|0)){i=i+.5|0}var s=t[1];if(s!=(s|0)){s=s+.5|0}var e=t[2];if(e!=(e|0)){e=e+.5|0}var r=t[3]===undefined?1:t[3];return"rgba("+i+","+s+","+e+","+r+")"};var qo={};qo.asColorLike=function(t){if(qo.isColorLike(t)){return t}else{return Uo.asString(t)}};qo.isColorLike=function(t){return typeof t==="string"||t instanceof CanvasPattern||t instanceof CanvasGradient};var Xo=function(){};Xo.prototype.drawCustom=function(t,i,s){};Xo.prototype.drawGeometry=function(t){};Xo.prototype.setStyle=function(t){};Xo.prototype.drawCircle=function(t,i){};Xo.prototype.drawFeature=function(t,i){};Xo.prototype.drawGeometryCollection=function(t,i){};Xo.prototype.drawLineString=function(t,i){};Xo.prototype.drawMultiLineString=function(t,i){};Xo.prototype.drawMultiPoint=function(t,i){};Xo.prototype.drawMultiPolygon=function(t,i){};Xo.prototype.drawPoint=function(t,i){};Xo.prototype.drawPolygon=function(t,i){};Xo.prototype.drawText=function(t,i){};Xo.prototype.setFillStrokeStyle=function(t,i){};Xo.prototype.setImageStyle=function(t,i){};Xo.prototype.setTextStyle=function(t,i){};var Yo=function(t,i,s,e,r){Xo.call(this);this.context_=t;this.pixelRatio_=i;this.extent_=s;this.transform_=e;this.viewRotation_=r;this.contextFillState_=null;this.contextStrokeState_=null;this.contextTextState_=null;this.fillState_=null;this.strokeState_=null;this.image_=null;this.imageAnchorX_=0;this.imageAnchorY_=0;this.imageHeight_=0;this.imageOpacity_=0;this.imageOriginX_=0;this.imageOriginY_=0;this.imageRotateWithView_=false;this.imageRotation_=0;this.imageScale_=0;this.imageSnapToPixel_=false;this.imageWidth_=0;this.text_="";this.textOffsetX_=0;this.textOffsetY_=0;this.textRotateWithView_=false;this.textRotation_=0;this.textScale_=0;this.textFillState_=null;this.textStrokeState_=null;this.textState_=null;this.pixelCoordinates_=[];this.tmpLocalTransform_=sa.create()};kh.inherits(Yo,Xo);Yo.prototype.drawImages_=function(t,i,s,e){if(!this.image_){return}var r=Bh.transform2D(t,i,s,2,this.transform_,this.pixelCoordinates_);var n=this.context_;var h=this.tmpLocalTransform_;var a=n.globalAlpha;if(this.imageOpacity_!=1){n.globalAlpha=a*this.imageOpacity_}var o=this.imageRotation_;if(this.imageRotateWithView_){o+=this.viewRotation_}var f,u;for(f=0,u=r.length;f<u;f+=2){var v=r[f]-this.imageAnchorX_;var l=r[f+1]-this.imageAnchorY_;if(this.imageSnapToPixel_){v=Math.round(v);l=Math.round(l)}if(o!==0||this.imageScale_!=1){var c=v+this.imageAnchorX_;var d=l+this.imageAnchorY_;sa.compose(h,c,d,this.imageScale_,this.imageScale_,o,-c,-d);n.setTransform.apply(n,h)}n.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,v,l,this.imageWidth_,this.imageHeight_)}if(o!==0||this.imageScale_!=1){n.setTransform(1,0,0,1,0,0)}if(this.imageOpacity_!=1){n.globalAlpha=a}};Yo.prototype.drawText_=function(t,i,s,e){if(!this.textState_||this.text_===""){return}if(this.textFillState_){this.setContextFillState_(this.textFillState_)}if(this.textStrokeState_){this.setContextStrokeState_(this.textStrokeState_)}this.setContextTextState_(this.textState_);var r=Bh.transform2D(t,i,s,e,this.transform_,this.pixelCoordinates_);var n=this.context_;var h=this.textRotation_;if(this.textRotateWithView_){h+=this.viewRotation_}for(;i<s;i+=e){var a=r[i]+this.textOffsetX_;var o=r[i+1]+this.textOffsetY_;if(h!==0||this.textScale_!=1){var f=sa.compose(this.tmpLocalTransform_,a,o,this.textScale_,this.textScale_,h,-a,-o);n.setTransform.apply(n,f)}if(this.textStrokeState_){n.strokeText(this.text_,a,o)}if(this.textFillState_){n.fillText(this.text_,a,o)}}if(h!==0||this.textScale_!=1){n.setTransform(1,0,0,1,0,0)}};Yo.prototype.moveToLineTo_=function(t,i,s,e,r){var n=this.context_;var h=Bh.transform2D(t,i,s,e,this.transform_,this.pixelCoordinates_);n.moveTo(h[0],h[1]);var a=h.length;if(r){a-=2}for(var o=2;o<a;o+=2){n.lineTo(h[o],h[o+1])}if(r){n.closePath()}return s};Yo.prototype.drawRings_=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){i=this.moveToLineTo_(t,i,s[r],e,true)}return i};Yo.prototype.drawCircle=function(t){if(!qh.intersects(this.extent_,t.getExtent())){return}if(this.fillState_||this.strokeState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=ra.transform2D(t,this.transform_,this.pixelCoordinates_);var s=i[2]-i[0];var e=i[3]-i[1];var r=Math.sqrt(s*s+e*e);var n=this.context_;n.beginPath();n.arc(i[0],i[1],r,0,2*Math.PI);if(this.fillState_){n.fill()}if(this.strokeState_){n.stroke()}}if(this.text_!==""){this.drawText_(t.getCenter(),0,2,2)}};Yo.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke());this.setImageStyle(t.getImage());this.setTextStyle(t.getText())};Yo.prototype.drawGeometry=function(t){var i=t.getType();switch(i){case Gh.POINT:this.drawPoint(t);break;case Gh.LINE_STRING:this.drawLineString(t);break;case Gh.POLYGON:this.drawPolygon(t);break;case Gh.MULTI_POINT:this.drawMultiPoint(t);break;case Gh.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case Gh.MULTI_POLYGON:this.drawMultiPolygon(t);break;case Gh.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case Gh.CIRCLE:this.drawCircle(t);break}};Yo.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);if(!s||!qh.intersects(this.extent_,s.getExtent())){return}this.setStyle(i);this.drawGeometry(s)};Yo.prototype.drawGeometryCollection=function(t){var i=t.getGeometriesArray();var s,e;for(s=0,e=i.length;s<e;++s){this.drawGeometry(i[s])}};Yo.prototype.drawPoint=function(t){var i=t.getFlatCoordinates();var s=t.getStride();if(this.image_){this.drawImages_(i,0,i.length,s)}if(this.text_!==""){this.drawText_(i,0,i.length,s)}};Yo.prototype.drawMultiPoint=function(t){var i=t.getFlatCoordinates();var s=t.getStride();if(this.image_){this.drawImages_(i,0,i.length,s)}if(this.text_!==""){this.drawText_(i,0,i.length,s)}};Yo.prototype.drawLineString=function(t){if(!qh.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_;var s=t.getFlatCoordinates();i.beginPath();this.moveToLineTo_(s,0,s.length,t.getStride(),false);i.stroke()}if(this.text_!==""){var e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}};Yo.prototype.drawMultiLineString=function(t){var i=t.getExtent();if(!qh.intersects(this.extent_,i)){return}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var s=this.context_;var e=t.getFlatCoordinates();var r=0;var n=t.getEnds();var h=t.getStride();s.beginPath();var a,o;for(a=0,o=n.length;a<o;++a){r=this.moveToLineTo_(e,r,n[a],h,false)}s.stroke()}if(this.text_!==""){var f=t.getFlatMidpoints();this.drawText_(f,0,f.length,2)}};Yo.prototype.drawPolygon=function(t){if(!qh.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_||this.fillState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=this.context_;i.beginPath();this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride());if(this.fillState_){i.fill()}if(this.strokeState_){i.stroke()}}if(this.text_!==""){var s=t.getFlatInteriorPoint();this.drawText_(s,0,2,2)}};Yo.prototype.drawMultiPolygon=function(t){if(!qh.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_||this.fillState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=this.context_;var s=t.getOrientedFlatCoordinates();var e=0;var r=t.getEndss();var n=t.getStride();var h,a;i.beginPath();for(h=0,a=r.length;h<a;++h){var o=r[h];e=this.drawRings_(s,e,o,n)}if(this.fillState_){i.fill()}if(this.strokeState_){i.stroke()}}if(this.text_!==""){var f=t.getFlatInteriorPoints();this.drawText_(f,0,f.length,2)}};Yo.prototype.setContextFillState_=function(t){var i=this.context_;var s=this.contextFillState_;if(!s){i.fillStyle=t.fillStyle;this.contextFillState_={fillStyle:t.fillStyle}}else{if(s.fillStyle!=t.fillStyle){s.fillStyle=i.fillStyle=t.fillStyle}}};Yo.prototype.setContextStrokeState_=function(t){var i=this.context_;var s=this.contextStrokeState_;if(!s){i.lineCap=t.lineCap;if(ga.CANVAS_LINE_DASH){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.lineJoin=t.lineJoin;i.lineWidth=t.lineWidth;i.miterLimit=t.miterLimit;i.strokeStyle=t.strokeStyle;this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle}}else{if(s.lineCap!=t.lineCap){s.lineCap=i.lineCap=t.lineCap}if(ga.CANVAS_LINE_DASH){if(!jh.equals(s.lineDash,t.lineDash)){i.setLineDash(s.lineDash=t.lineDash)}if(s.lineDashOffset!=t.lineDashOffset){s.lineDashOffset=i.lineDashOffset=t.lineDashOffset}}if(s.lineJoin!=t.lineJoin){s.lineJoin=i.lineJoin=t.lineJoin}if(s.lineWidth!=t.lineWidth){s.lineWidth=i.lineWidth=t.lineWidth}if(s.miterLimit!=t.miterLimit){s.miterLimit=i.miterLimit=t.miterLimit}if(s.strokeStyle!=t.strokeStyle){s.strokeStyle=i.strokeStyle=t.strokeStyle}}};Yo.prototype.setContextTextState_=function(t){var i=this.context_;var s=this.contextTextState_;var e=t.textAlign?t.textAlign:Vo.defaultTextAlign;if(!s){i.font=t.font;i.textAlign=e;i.textBaseline=t.textBaseline;this.contextTextState_={font:t.font,textAlign:e,textBaseline:t.textBaseline}}else{if(s.font!=t.font){s.font=i.font=t.font}if(s.textAlign!=e){s.textAlign=e}if(s.textBaseline!=t.textBaseline){s.textBaseline=i.textBaseline=t.textBaseline}}};Yo.prototype.setFillStrokeStyle=function(t,i){if(!t){this.fillState_=null}else{var s=t.getColor();this.fillState_={fillStyle:qo.asColorLike(s?s:Vo.defaultFillStyle)}}if(!i){this.strokeState_=null}else{var e=i.getColor();var r=i.getLineCap();var n=i.getLineDash();var h=i.getLineDashOffset();var a=i.getLineJoin();var o=i.getWidth();var f=i.getMiterLimit();this.strokeState_={lineCap:r!==undefined?r:Vo.defaultLineCap,lineDash:n?n:Vo.defaultLineDash,lineDashOffset:h?h:Vo.defaultLineDashOffset,lineJoin:a!==undefined?a:Vo.defaultLineJoin,lineWidth:this.pixelRatio_*(o!==undefined?o:Vo.defaultLineWidth),miterLimit:f!==undefined?f:Vo.defaultMiterLimit,strokeStyle:qo.asColorLike(e?e:Vo.defaultStrokeStyle)}}};Yo.prototype.setImageStyle=function(t){if(!t){this.image_=null}else{var i=t.getAnchor();var s=t.getImage(1);var e=t.getOrigin();var r=t.getSize();this.imageAnchorX_=i[0];this.imageAnchorY_=i[1];this.imageHeight_=r[1];this.image_=s;this.imageOpacity_=t.getOpacity();this.imageOriginX_=e[0];this.imageOriginY_=e[1];this.imageRotateWithView_=t.getRotateWithView();this.imageRotation_=t.getRotation();this.imageScale_=t.getScale()*this.pixelRatio_;this.imageSnapToPixel_=t.getSnapToPixel();this.imageWidth_=r[0]}};Yo.prototype.setTextStyle=function(t){if(!t){this.text_=""}else{var i=t.getFill();if(!i){this.textFillState_=null}else{var s=i.getColor();this.textFillState_={fillStyle:qo.asColorLike(s?s:Vo.defaultFillStyle)}}var e=t.getStroke();if(!e){this.textStrokeState_=null}else{var r=e.getColor();var n=e.getLineCap();var h=e.getLineDash();var a=e.getLineDashOffset();var o=e.getLineJoin();var f=e.getWidth();var u=e.getMiterLimit();this.textStrokeState_={lineCap:n!==undefined?n:Vo.defaultLineCap,lineDash:h?h:Vo.defaultLineDash,lineDashOffset:a?a:Vo.defaultLineDashOffset,lineJoin:o!==undefined?o:Vo.defaultLineJoin,lineWidth:f!==undefined?f:Vo.defaultLineWidth,miterLimit:u!==undefined?u:Vo.defaultMiterLimit,strokeStyle:qo.asColorLike(r?r:Vo.defaultStrokeStyle)}}var v=t.getFont();var l=t.getOffsetX();var c=t.getOffsetY();var d=t.getRotateWithView();var m=t.getRotation();var p=t.getScale();var M=t.getText();var z=t.getTextAlign();var _=t.getTextBaseline();this.textState_={font:v!==undefined?v:Vo.defaultFont,textAlign:z!==undefined?z:Vo.defaultTextAlign,textBaseline:_!==undefined?_:Vo.defaultTextBaseline};this.text_=M!==undefined?M:"";this.textOffsetX_=l!==undefined?this.pixelRatio_*l:0;this.textOffsetY_=c!==undefined?this.pixelRatio_*c:0;this.textRotateWithView_=d!==undefined?d:false;this.textRotation_=m!==undefined?m:0;this.textScale_=this.pixelRatio_*(p!==undefined?p:1)}};var Bo=function(t){Rh.call(this);this.layer_=t};kh.inherits(Bo,Rh);Bo.prototype.forEachFeatureAtCoordinate=kh.nullFunction;Bo.prototype.hasFeatureAtCoordinate=Yh.FALSE;Bo.prototype.createLoadedTileFinder=function(t,i,s){return function(e,r){function n(t){if(!s[e]){s[e]={}}s[e][t.tileCoord.toString()]=t}return t.forEachLoadedTile(i,e,r,n)}};Bo.prototype.getLayer=function(){return this.layer_};Bo.prototype.handleImageChange_=function(t){var i=t.target;if(i.getState()===Lo.LOADED){this.renderIfReadyAndVisible()}};Bo.prototype.loadImage=function(t){var i=t.getState();if(i!=Lo.LOADED&&i!=Lo.ERROR){Ih.listen(t,Ah.CHANGE,this.handleImageChange_,this)}if(i==Lo.IDLE){t.load();i=t.getState()}return i==Lo.LOADED};Bo.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();if(t.getVisible()&&t.getSourceState()==io.READY){this.changed()}};Bo.prototype.scheduleExpireCache=function(t,i){if(i.canExpireCache()){var s=function(t,i,s){var e=kh.getUid(t).toString();if(e in s.usedTiles){t.expireCache(s.viewState.projection,s.usedTiles[e])}}.bind(null,i);t.postRenderFunctions.push(s)}};Bo.prototype.updateLogos=function(t,i){var s=i.getLogo();if(s!==undefined){if(typeof s==="string"){t.logos[s]=""}else if(s){Dh.assert(typeof s.href=="string",44);Dh.assert(typeof s.src=="string",45);t.logos[s.src]=s.href}}};Bo.prototype.updateUsedTiles=function(t,i,s,e){var r=kh.getUid(i).toString();var n=s.toString();if(r in t){if(n in t[r]){t[r][n].extend(e)}else{t[r][n]=e}}else{t[r]={};t[r][n]=e}};Bo.prototype.manageTilePyramid=function(t,i,s,e,r,n,h,a,o,f){var u=kh.getUid(i).toString();if(!(u in t.wantedTiles)){t.wantedTiles[u]={}}var v=t.wantedTiles[u];var l=t.tileQueue;var c=s.getMinZoom();var d,m,p,M,z,_;for(_=c;_<=h;++_){m=s.getTileRangeForExtentAndZ(n,_,m);p=s.getResolution(_);for(M=m.minX;M<=m.maxX;++M){for(z=m.minY;z<=m.maxY;++z){if(h-_<=a){d=i.getTile(_,M,z,e,r);if(d.getState()==Wa.IDLE){v[d.getKey()]=true;if(!l.isKeyQueued(d.getKey())){l.enqueue([d,u,s.getTileCoordCenter(d.tileCoord),p])}}if(o!==undefined){o.call(f,d)}}else{i.useTile(_,M,z,r)}}}}};var Ho=function(t){Bo.call(this,t);this.transform_=sa.create()};kh.inherits(Ho,Bo);Ho.prototype.clip=function(t,i,s){var e=i.pixelRatio;var r=i.size[0]*e;var n=i.size[1]*e;var h=i.viewState.rotation;var a=qh.getTopLeft(s);var o=qh.getTopRight(s);var f=qh.getBottomRight(s);var u=qh.getBottomLeft(s);sa.apply(i.coordinateToPixelTransform,a);sa.apply(i.coordinateToPixelTransform,o);sa.apply(i.coordinateToPixelTransform,f);sa.apply(i.coordinateToPixelTransform,u);t.save();Vo.rotateAtOffset(t,-h,r/2,n/2);t.beginPath();t.moveTo(a[0]*e,a[1]*e);t.lineTo(o[0]*e,o[1]*e);t.lineTo(f[0]*e,f[1]*e);t.lineTo(u[0]*e,u[1]*e);t.clip();Vo.rotateAtOffset(t,h,r/2,n/2)};Ho.prototype.dispatchComposeEvent_=function(t,i,s,e){var r=this.getLayer();if(r.hasListener(t)){var n=s.size[0]*s.pixelRatio;var h=s.size[1]*s.pixelRatio;var a=s.viewState.rotation;Vo.rotateAtOffset(i,-a,n/2,h/2);var o=e!==undefined?e:this.getTransform(s,0);var f=new Yo(i,s.pixelRatio,s.extent,o,s.viewState.rotation);var u=new Wo(t,f,s,i,null);r.dispatchEvent(u);Vo.rotateAtOffset(i,a,n/2,h/2)}};Ho.prototype.forEachLayerAtCoordinate=function(t,i,s,e){var r=this.forEachFeatureAtCoordinate(t,i,0,Yh.TRUE,this);if(r){return s.call(e,this.getLayer(),null)}else{return undefined}};Ho.prototype.postCompose=function(t,i,s,e){this.dispatchComposeEvent_(uo.POSTCOMPOSE,t,i,e)};Ho.prototype.preCompose=function(t,i,s){this.dispatchComposeEvent_(uo.PRECOMPOSE,t,i,s)};Ho.prototype.dispatchRenderEvent=function(t,i,s){this.dispatchComposeEvent_(uo.RENDER,t,i,s)};Ho.prototype.getTransform=function(t,i){var s=t.viewState;var e=t.pixelRatio;var r=e*t.size[0]/2;var n=e*t.size[1]/2;var h=e/s.resolution;var a=-h;var o=-s.rotation;var f=-s.center[0]+i;var u=-s.center[1];return sa.compose(this.transform_,r,n,h,a,o,f,u)};Ho.prototype.composeFrame=function(t,i,s){};Ho.prototype.prepareFrame=function(t,i){};var Jo=function(t){Ho.call(this,t);this.coordinateToCanvasPixelTransform=sa.create();this.hitCanvasContext_=null};kh.inherits(Jo,Ho);Jo.prototype.composeFrame=function(t,i,s){this.preCompose(s,t);var e=this.getImage();if(e){var r=i.extent;var n=r!==undefined&&!qh.containsExtent(r,t.extent)&&qh.intersects(r,t.extent);if(n){this.clip(s,t,r)}var h=this.getImageTransform();var a=s.globalAlpha;s.globalAlpha=i.opacity;var o=h[4];var f=h[5];var u=e.width*h[0];var v=e.height*h[3];s.drawImage(e,0,0,+e.width,+e.height,Math.round(o),Math.round(f),Math.round(u),Math.round(v));s.globalAlpha=a;if(n){s.restore()}}this.postCompose(s,t,i)};Jo.prototype.getImage=function(){};Jo.prototype.getImageTransform=function(){};Jo.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=this.getLayer();var h=n.getSource();var a=i.viewState.resolution;var o=i.viewState.rotation;var f=i.skippedFeatureUids;return h.forEachFeatureAtCoordinate(t,a,o,s,f,(function(t){return e.call(r,t,n)}))};Jo.prototype.forEachLayerAtCoordinate=function(t,i,s,e){if(!this.getImage()){return undefined}if(this.getLayer().getSource().forEachFeatureAtCoordinate!==kh.nullFunction){return Ho.prototype.forEachLayerAtCoordinate.apply(this,arguments)}else{var r=sa.apply(this.coordinateToCanvasPixelTransform,t.slice());Ja.scale(r,i.viewState.resolution/this.renderedResolution);if(!this.hitCanvasContext_){this.hitCanvasContext_=$a.createCanvasContext2D(1,1)}this.hitCanvasContext_.clearRect(0,0,1,1);this.hitCanvasContext_.drawImage(this.getImage(),r[0],r[1],1,1,0,0,1,1);var n=this.hitCanvasContext_.getImageData(0,0,1,1).data;if(n[3]>0){return s.call(e,this.getLayer(),n)}else{return undefined}}};var Zo=function(t){Jo.call(this,t);this.image_=null;this.imageTransform_=sa.create();this.skippedFeatures_=[];this.vectorRenderer_=null};kh.inherits(Zo,Jo);Zo["handles"]=function(t,i){return t===no.CANVAS&&(i.getType()===Fo.IMAGE||i.getType()===Fo.VECTOR&&i.getRenderMode()===Go.IMAGE)};Zo["create"]=function(t,i){var s=new Zo(i);if(i.getType()===Fo.VECTOR){var e=ro.getLayerRendererPlugins();for(var r=0,n=e.length;r<n;++r){var h=e[r];if(h!==Zo&&h["handles"](no.CANVAS,i)){s.setVectorRenderer(h["create"](t,i))}}}return s};Zo.prototype.getImage=function(){return!this.image_?null:this.image_.getImage()};Zo.prototype.getImageTransform=function(){return this.imageTransform_};Zo.prototype.prepareFrame=function(t,i){var s=t.pixelRatio;var e=t.size;var r=t.viewState;var n=r.center;var h=r.resolution;var a;var o=this.getLayer();var f=o.getSource();var u=t.viewHints;var v=t.extent;if(i.extent!==undefined){v=qh.getIntersection(v,i.extent)}if(!u[Ya.ANIMATING]&&!u[Ya.INTERACTING]&&!qh.isEmpty(v)){var l=r.projection;if(!kh.ENABLE_RASTER_REPROJECTION){var c=f.getProjection();if(c){l=c}}var d=this.vectorRenderer_;if(d){var m=d.context;var p=Ch.assign({},t,{size:[qh.getWidth(v)/h,qh.getHeight(v)/h],viewState:Ch.assign({},t.viewState,{rotation:0})});var M=Object.keys(p.skippedFeatureUids).sort();if(d.prepareFrame(p,i)&&(d.replayGroupChanged||!jh.equals(M,this.skippedFeatures_))){m.canvas.width=p.size[0]*s;m.canvas.height=p.size[1]*s;d.composeFrame(p,i,m);this.image_=new Do(v,h,s,m.canvas);this.skippedFeatures_=M}}else{a=f.getImage(v,h,s,l);if(a){var z=this.loadImage(a);if(z){this.image_=a}}}}if(this.image_){a=this.image_;var _=a.getExtent();var g=a.getResolution();var w=a.getPixelRatio();var y=s*g/(h*w);var b=sa.compose(this.imageTransform_,s*e[0]/2,s*e[1]/2,y,y,0,w*(_[0]-n[0])/g,w*(n[1]-_[3])/g);sa.compose(this.coordinateToCanvasPixelTransform,s*e[0]/2-b[4],s*e[1]/2-b[5],s/h,-s/h,0,-n[0],-n[1]);this.updateLogos(t,f);this.renderedResolution=g*s/w}return!!this.image_};Zo.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(this.vectorRenderer_){return this.vectorRenderer_.forEachFeatureAtCoordinate(t,i,s,e,r)}else{return Jo.prototype.forEachFeatureAtCoordinate.call(this,t,i,s,e,r)}};Zo.prototype.setVectorRenderer=function(t){this.vectorRenderer_=t};var Ko=function(){this.cache_={};this.cacheSize_=0;this.maxCacheSize_=32};Ko.getKey=function(t,i,s){var e=s?Uo.asString(s):"null";return i+":"+t+":"+e};Ko.prototype.clear=function(){this.cache_={};this.cacheSize_=0};Ko.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t=0;var i,s;for(i in this.cache_){s=this.cache_[i];if((t++&3)===0&&!s.hasListener()){delete this.cache_[i];--this.cacheSize_}}}};Ko.prototype.get=function(t,i,s){var e=Ko.getKey(t,i,s);return e in this.cache_?this.cache_[e]:null};Ko.prototype.set=function(t,i,s,e){var r=Ko.getKey(t,i,s);this.cache_[r]=e;++this.cacheSize_};Ko.prototype.setSize=function(t){this.maxCacheSize_=t;this.expire()};var $o={};$o.iconImageCache=new Ko;var Qo=function(t,i){Sh.call(this);this.map_=i;this.layerRenderers_={};this.layerRendererListeners_={}};kh.inherits(Qo,Sh);Qo.prototype.calculateMatrices2D=function(t){var i=t.viewState;var s=t.coordinateToPixelTransform;var e=t.pixelToCoordinateTransform;sa.compose(s,t.size[0]/2,t.size[1]/2,1/i.resolution,-1/i.resolution,-i.rotation,-i.center[0],-i.center[1]);sa.invert(sa.setFromArray(e,s))};Qo.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_){this.removeLayerRendererByKey_(t).dispose()}};Qo.expireIconCache_=function(t,i){var s=$o.iconImageCache;s.expire()};Qo.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){var a;var o=i.viewState;var f=o.resolution;function u(t,s){var n=kh.getUid(t).toString();var h=i.layerStates[kh.getUid(s)].managed;if(!(n in i.skippedFeatureUids&&!h)){return e.call(r,t,h?s:null)}}var v=o.projection;var l=t;if(v.canWrapX()){var c=v.getExtent();var d=qh.getWidth(c);var m=t[0];if(m<c[0]||m>c[2]){var p=Math.ceil((c[0]-m)/d);l=[m+d*p,t[1]]}}var M=i.layerStatesArray;var z=M.length;var _;for(_=z-1;_>=0;--_){var g=M[_];var w=g.layer;if(vo.visibleAtResolution(g,f)&&n.call(h,w)){var y=this.getLayerRenderer(w);if(w.getSource()){a=y.forEachFeatureAtCoordinate(w.getSource().getWrapX()?l:t,i,s,u,r)}if(a){return a}}}return undefined};Qo.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){};Qo.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r){var n=this.forEachFeatureAtCoordinate(t,i,s,Yh.TRUE,this,e,r);return n!==undefined};Qo.prototype.getLayerRenderer=function(t){var i=kh.getUid(t).toString();if(i in this.layerRenderers_){return this.layerRenderers_[i]}else{var s=ro.getLayerRendererPlugins();var e;var r=this.getType();for(var n=0,h=s.length;n<h;++n){var a=s[n];if(a["handles"](r,t)){e=a["create"](this,t);break}}if(e){this.layerRenderers_[i]=e;this.layerRendererListeners_[i]=Ih.listen(e,Ah.CHANGE,this.handleLayerRendererChange_,this)}else{throw new Error("Unable to create renderer for layer: "+t.getType())}return e}};Qo.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]};Qo.prototype.getLayerRenderers=function(){return this.layerRenderers_};Qo.prototype.getMap=function(){return this.map_};Qo.prototype.getType=function(){};Qo.prototype.handleLayerRendererChange_=function(){this.map_.render()};Qo.prototype.removeLayerRendererByKey_=function(t){var i=this.layerRenderers_[t];delete this.layerRenderers_[t];Ih.unlistenByKey(this.layerRendererListeners_[t]);delete this.layerRendererListeners_[t];return i};Qo.prototype.renderFrame=kh.nullFunction;Qo.prototype.removeUnusedLayerRenderers_=function(t,i){var s;for(s in this.layerRenderers_){if(!i||!(s in i.layerStates)){this.removeLayerRendererByKey_(s).dispose()}}};Qo.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(Qo.expireIconCache_)};Qo.prototype.scheduleRemoveUnusedLayerRenderers=function(t){var i;for(i in this.layerRenderers_){if(!(i in t.layerStates)){t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this));return}}};Qo.sortByZIndex=function(t,i){return t.zIndex-i.zIndex};var tf=function(t,i){Qo.call(this,t,i);this.context_=$a.createCanvasContext2D();this.canvas_=this.context_.canvas;this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=fo.CLASS_UNSELECTABLE;t.insertBefore(this.canvas_,t.childNodes[0]||null);this.renderedVisible_=true;this.transform_=sa.create()};kh.inherits(tf,Qo);tf["handles"]=function(t){return t===no.CANVAS};tf["create"]=function(t,i){return new tf(t,i)};tf.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();var e=this.context_;if(s.hasListener(t)){var r=i.extent;var n=i.pixelRatio;var h=i.viewState;var a=h.rotation;var o=this.getTransform(i);var f=new Yo(e,n,r,o,a);var u=new Wo(t,f,i,e,null);s.dispatchEvent(u)}};tf.prototype.getTransform=function(t){var i=t.viewState;var s=this.canvas_.width/2;var e=this.canvas_.height/2;var r=t.pixelRatio/i.resolution;var n=-r;var h=-i.rotation;var a=-i.center[0];var o=-i.center[1];return sa.compose(this.transform_,s,e,r,n,h,a,o)};tf.prototype.getType=function(){return no.CANVAS};tf.prototype.renderFrame=function(t){if(!t){if(this.renderedVisible_){this.canvas_.style.display="none";this.renderedVisible_=false}return}var i=this.context_;var s=t.pixelRatio;var e=Math.round(t.size[0]*s);var r=Math.round(t.size[1]*s);if(this.canvas_.width!=e||this.canvas_.height!=r){this.canvas_.width=e;this.canvas_.height=r}else{i.clearRect(0,0,e,r)}var n=t.viewState.rotation;this.calculateMatrices2D(t);this.dispatchComposeEvent_(uo.PRECOMPOSE,t);var h=t.layerStatesArray;jh.stableSort(h,Qo.sortByZIndex);if(n){i.save();Vo.rotateAtOffset(i,n,e/2,r/2)}var a=t.viewState.resolution;var o,f,u,v,l;for(o=0,f=h.length;o<f;++o){l=h[o];u=l.layer;v=this.getLayerRenderer(u);if(!vo.visibleAtResolution(l,a)||l.sourceState!=io.READY){continue}if(v.prepareFrame(t,l)){v.composeFrame(t,l,i)}}if(n){i.restore()}this.dispatchComposeEvent_(uo.POSTCOMPOSE,t);if(!this.renderedVisible_){this.canvas_.style.display="";this.renderedVisible_=true}this.scheduleRemoveUnusedLayerRenderers(t);this.scheduleExpireIconCache(t)};tf.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){var h;var a=i.viewState;var o=a.resolution;var f=i.layerStatesArray;var u=f.length;var v=sa.apply(i.pixelToCoordinateTransform,t.slice());var l;for(l=u-1;l>=0;--l){var c=f[l];var d=c.layer;if(vo.visibleAtResolution(c,o)&&r.call(n,d)){var m=this.getLayerRenderer(d);h=m.forEachLayerAtCoordinate(v,i,s,e);if(h){return h}}}return undefined};var sf=function(t,i,s,e){this.minX=t;this.maxX=i;this.minY=s;this.maxY=e};sf.createOrUpdate=function(t,i,s,e,r){if(r!==undefined){r.minX=t;r.maxX=i;r.minY=s;r.maxY=e;return r}else{return new sf(t,i,s,e)}};sf.prototype.contains=function(t){return this.containsXY(t[1],t[2])};sf.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY};sf.prototype.containsXY=function(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY};sf.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY};sf.prototype.extend=function(t){if(t.minX<this.minX){this.minX=t.minX}if(t.maxX>this.maxX){this.maxX=t.maxX}if(t.minY<this.minY){this.minY=t.minY}if(t.maxY>this.maxY){this.maxY=t.maxY}};sf.prototype.getHeight=function(){return this.maxY-this.minY+1};sf.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]};sf.prototype.getWidth=function(){return this.maxX-this.minX+1};sf.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var ef=function(t){Jo.call(this,t);this.context=this.context===null?null:$a.createCanvasContext2D();this.renderedExtent_=null;this.renderedTiles=[];this.tmpExtent=qh.createEmpty();this.tmpTileRange_=new sf(0,0,0,0);this.imageTransform_=sa.create();this.zDirection=0};kh.inherits(ef,Jo);ef["handles"]=function(t,i){return t===no.CANVAS&&i.getType()===Fo.TILE};ef["create"]=function(t,i){return new ef(i)};ef.prototype.isDrawableTile_=function(t){var i=t.getState();var s=this.getLayer().getUseInterimTilesOnError();return i==Wa.LOADED||i==Wa.EMPTY||i==Wa.ERROR&&!s};ef.prototype.prepareFrame=function(t,i){var s=t.pixelRatio;var e=t.size;var r=t.viewState;var n=r.projection;var h=r.resolution;var a=r.center;var o=this.getLayer();var f=o.getSource();var u=f.getRevision();var v=f.getTileGridForProjection(n);var l=v.getZForResolution(h,this.zDirection);var c=v.getResolution(l);var d=Math.round(h/c)||1;var m=t.extent;if(i.extent!==undefined){m=qh.getIntersection(m,i.extent)}if(qh.isEmpty(m)){return false}var p=v.getTileRangeForExtentAndZ(m,l);var M=v.getTileRangeExtent(l,p);var z=f.getTilePixelRatio(s);var _={};_[l]={};var g=this.createLoadedTileFinder(f,n,_);var w=this.tmpExtent;var y=this.tmpTileRange_;var b=false;var x,k,E;for(k=p.minX;k<=p.maxX;++k){for(E=p.minY;E<=p.maxY;++E){x=f.getTile(l,k,E,s,n);if(x.getState()==Wa.ERROR){if(!o.getUseInterimTilesOnError()){x.setState(Wa.LOADED)}else if(o.getPreload()>0){b=true}}if(!this.isDrawableTile_(x)){x=x.getInterimTile()}if(this.isDrawableTile_(x)){var N=kh.getUid(this);if(x.getState()==Wa.LOADED){_[l][x.tileCoord.toString()]=x;var C=x.inTransition(N);if(!b&&(C||this.renderedTiles.indexOf(x)===-1)){b=true}}if(x.getAlpha(N,t.time)===1){continue}}var I=v.getTileCoordChildTileRange(x.tileCoord,y,w);var S=false;if(I){S=g(l+1,I)}if(!S){v.forEachTileCoordParentTileRange(x.tileCoord,g,null,y,w)}}}var O=c*s/z*d;var T=t.viewHints;var A=T[Ya.ANIMATING]||T[Ya.INTERACTING];if(!(this.renderedResolution&&Date.now()-t.time>16&&A)&&(b||!(this.renderedExtent_&&qh.containsExtent(this.renderedExtent_,m))||this.renderedRevision!=u||d!=this.oversampling_||!A&&O!=this.renderedResolution)){var R=this.context;if(R){var P=f.getTilePixelSize(l,s,n);var L=Math.round(p.getWidth()*P[0]/d);var D=Math.round(p.getHeight()*P[1]/d);var F=R.canvas;if(F.width!=L||F.height!=D){this.oversampling_=d;F.width=L;F.height=D}else{if(this.renderedExtent_&&!qh.equals(M,this.renderedExtent_)){R.clearRect(0,0,L,D)}d=this.oversampling_}}this.renderedTiles.length=0;var G=Object.keys(_).map(Number);G.sort((function(t,i){if(t===l){return 1}else if(i===l){return-1}else{return t>i?1:t<i?-1:0}}));var W,j,V,U,q,X;var Y,B,H,J,Z;for(q=0,X=G.length;q<X;++q){U=G[q];V=f.getTilePixelSize(U,s,n);W=v.getResolution(U);j=W/c;B=z*f.getGutter(n);H=_[U];for(var K in H){x=H[K];Y=v.getTileCoordExtent(x.getTileCoord(),w);k=(Y[0]-M[0])/c*z/d;E=(M[3]-Y[3])/c*z/d;J=V[0]*j/d;Z=V[1]*j/d;this.drawTileImage(x,t,i,k,E,J,Z,B,l===U);this.renderedTiles.push(x)}}this.renderedRevision=u;this.renderedResolution=c*s/z*d;this.renderedExtent_=M}var $=this.renderedResolution/h;var Q=sa.compose(this.imageTransform_,s*e[0]/2,s*e[1]/2,$,$,0,(this.renderedExtent_[0]-a[0])/this.renderedResolution*s,(a[1]-this.renderedExtent_[3])/this.renderedResolution*s);sa.compose(this.coordinateToCanvasPixelTransform,s*e[0]/2-Q[4],s*e[1]/2-Q[5],s/h,-s/h,0,-a[0],-a[1]);this.updateUsedTiles(t.usedTiles,f,l,p);this.manageTilePyramid(t,f,v,s,n,m,l,o.getPreload());this.scheduleExpireCache(t,f);this.updateLogos(t,f);return this.renderedTiles.length>0};ef.prototype.drawTileImage=function(t,i,s,e,r,n,h,a,o){var f=t.getImage(this.getLayer());if(!f){return}var u=kh.getUid(this);var v=o?t.getAlpha(u,i.time):1;if(v===1&&!this.getLayer().getSource().getOpaque(i.viewState.projection)){this.context.clearRect(e,r,n,h)}var l=v!==this.context.globalAlpha;if(l){this.context.save();this.context.globalAlpha=v}this.context.drawImage(f,a,a,f.width-2*a,f.height-2*a,e,r,n,h);if(l){this.context.restore()}if(v!==1){i.animate=true}else if(o){t.endTransition(u)}};ef.prototype.getImage=function(){var t=this.context;return t?t.canvas:null};ef.prototype.getImageTransform=function(){return this.imageTransform_};var rf={exports:{}};(function(t,i){(function(i,s){t.exports=s()})(c,(function(){function t(t,s,r,n,h){i(t,s,r||0,n||t.length-1,h||e)}function i(t,e,r,n,h){while(n>r){if(n-r>600){var a=n-r+1;var o=e-r+1;var f=Math.log(a);var u=.5*Math.exp(2*f/3);var v=.5*Math.sqrt(f*u*(a-u)/a)*(o-a/2<0?-1:1);var l=Math.max(r,Math.floor(e-o*u/a+v));var c=Math.min(n,Math.floor(e+(a-o)*u/a+v));i(t,e,l,c,h)}var d=t[e];var m=r;var p=n;s(t,r,e);if(h(t[n],d)>0)s(t,r,n);while(m<p){s(t,m,p);m++;p--;while(h(t[m],d)<0)m++;while(h(t[p],d)>0)p--}if(h(t[r],d)===0)s(t,r,p);else{p++;s(t,p,n)}if(p<=e)r=p+1;if(e<=p)n=p-1}}function s(t,i,s){var e=t[i];t[i]=t[s];t[s]=e}function e(t,i){return t<i?-1:t>i?1:0}return t}))})(rf);var nf=af;var hf=rf.exports;function af(t,i){if(!(this instanceof af))return new af(t,i);this._maxEntries=Math.max(4,t||9);this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4));if(i){this._initFormat(i)}this.clear()}af.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,s=[],e=this.toBBox;if(!_f(t,i))return s;var r=[],n,h,a,o;while(i){for(n=0,h=i.children.length;n<h;n++){a=i.children[n];o=i.leaf?e(a):a;if(_f(t,o)){if(i.leaf)s.push(a);else if(zf(t,o))this._all(a,s);else r.push(a)}}i=r.pop()}return s},collides:function(t){var i=this.data,s=this.toBBox;if(!_f(t,i))return false;var e=[],r,n,h,a;while(i){for(r=0,n=i.children.length;r<n;r++){h=i.children[r];a=i.leaf?s(h):h;if(_f(t,a)){if(i.leaf||zf(t,a))return true;e.push(h)}}i=e.pop()}return false},load:function(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(var i=0,s=t.length;i<s;i++){this.insert(t[i])}return this}var e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length){this.data=e}else if(this.data.height===e.height){this._splitRoot(this.data,e)}else{if(this.data.height<e.height){var r=this.data;this.data=e;e=r}this._insert(e,this.data.height-e.height-1,true)}return this},insert:function(t){if(t)this._insert(t,this.data.height-1);return this},clear:function(){this.data=gf([]);return this},remove:function(t,i){if(!t)return this;var s=this.data,e=this.toBBox(t),r=[],n=[],h,a,o,f;while(s||r.length){if(!s){s=r.pop();a=r[r.length-1];h=n.pop();f=true}if(s.leaf){o=of(t,s.children,i);if(o!==-1){s.children.splice(o,1);r.push(s);this._condense(r);return this}}if(!f&&!s.leaf&&zf(s,e)){r.push(s);n.push(h);h=0;a=s;s=s.children[0]}else if(a){h++;s=a.children[h];f=false}else s=null}return this},toBBox:function(t){return t},compareMinX:lf,compareMinY:cf,toJSON:function(){return this.data},fromJSON:function(t){this.data=t;return this},_all:function(t,i){var s=[];while(t){if(t.leaf)i.push.apply(i,t.children);else s.push.apply(s,t.children);t=s.pop()}return i},_build:function(t,i,s,e){var r=s-i+1,n=this._maxEntries,h;if(r<=n){h=gf(t.slice(i,s+1));ff(h,this.toBBox);return h}if(!e){e=Math.ceil(Math.log(r)/Math.log(n));n=Math.ceil(r/Math.pow(n,e-1))}h=gf([]);h.leaf=false;h.height=e;var a=Math.ceil(r/n),o=a*Math.ceil(Math.sqrt(n)),f,u,v,l;wf(t,i,s,o,this.compareMinX);for(f=i;f<=s;f+=o){v=Math.min(f+o-1,s);wf(t,f,v,a,this.compareMinY);for(u=f;u<=v;u+=a){l=Math.min(u+a-1,v);h.children.push(this._build(t,u,l,e-1))}}ff(h,this.toBBox);return h},_chooseSubtree:function(t,i,s,e){var r,n,h,a,o,f,u,v;while(true){e.push(i);if(i.leaf||e.length-1===s)break;u=v=Infinity;for(r=0,n=i.children.length;r<n;r++){h=i.children[r];o=df(h);f=pf(t,h)-o;if(f<v){v=f;u=o<u?o:u;a=h}else if(f===v){if(o<u){u=o;a=h}}}i=a||i.children[0]}return i},_insert:function(t,i,s){var e=this.toBBox,r=s?t:e(t),n=[];var h=this._chooseSubtree(r,this.data,i,n);h.children.push(t);vf(h,r);while(i>=0){if(n[i].children.length>this._maxEntries){this._split(n,i);i--}else break}this._adjustParentBBoxes(r,n,i)},_split:function(t,i){var s=t[i],e=s.children.length,r=this._minEntries;this._chooseSplitAxis(s,r,e);var n=this._chooseSplitIndex(s,r,e);var h=gf(s.children.splice(n,s.children.length-n));h.height=s.height;h.leaf=s.leaf;ff(s,this.toBBox);ff(h,this.toBBox);if(i)t[i-1].children.push(h);else this._splitRoot(s,h)},_splitRoot:function(t,i){this.data=gf([t,i]);this.data.height=t.height+1;this.data.leaf=false;ff(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,s){var e,r,n,h,a,o,f,u;o=f=Infinity;for(e=i;e<=s-i;e++){r=uf(t,0,e,this.toBBox);n=uf(t,e,s,this.toBBox);h=Mf(r,n);a=df(r)+df(n);if(h<o){o=h;u=e;f=a<f?a:f}else if(h===o){if(a<f){f=a;u=e}}}return u},_chooseSplitAxis:function(t,i,s){var e=t.leaf?this.compareMinX:lf,r=t.leaf?this.compareMinY:cf,n=this._allDistMargin(t,i,s,e),h=this._allDistMargin(t,i,s,r);if(n<h)t.children.sort(e)},_allDistMargin:function(t,i,s,e){t.children.sort(e);var r=this.toBBox,n=uf(t,0,i,r),h=uf(t,s-i,s,r),a=mf(n)+mf(h),o,f;for(o=i;o<s-i;o++){f=t.children[o];vf(n,t.leaf?r(f):f);a+=mf(n)}for(o=s-i-1;o>=i;o--){f=t.children[o];vf(h,t.leaf?r(f):f);a+=mf(h)}return a},_adjustParentBBoxes:function(t,i,s){for(var e=s;e>=0;e--){vf(i[e],t)}},_condense:function(t){for(var i=t.length-1,s;i>=0;i--){if(t[i].children.length===0){if(i>0){s=t[i-1].children;s.splice(s.indexOf(t[i]),1)}else this.clear()}else ff(t[i],this.toBBox)}},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0]));this.compareMinY=new Function("a","b",i.join(t[1]));this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};function of(t,i,s){if(!s)return i.indexOf(t);for(var e=0;e<i.length;e++){if(s(t,i[e]))return e}return-1}function ff(t,i){uf(t,0,t.children.length,i,t)}function uf(t,i,s,e,r){if(!r)r=gf(null);r.minX=Infinity;r.minY=Infinity;r.maxX=-Infinity;r.maxY=-Infinity;for(var n=i,h;n<s;n++){h=t.children[n];vf(r,t.leaf?e(h):h)}return r}function vf(t,i){t.minX=Math.min(t.minX,i.minX);t.minY=Math.min(t.minY,i.minY);t.maxX=Math.max(t.maxX,i.maxX);t.maxY=Math.max(t.maxY,i.maxY);return t}function lf(t,i){return t.minX-i.minX}function cf(t,i){return t.minY-i.minY}function df(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function mf(t){return t.maxX-t.minX+(t.maxY-t.minY)}function pf(t,i){return(Math.max(i.maxX,t.maxX)-Math.min(i.minX,t.minX))*(Math.max(i.maxY,t.maxY)-Math.min(i.minY,t.minY))}function Mf(t,i){var s=Math.max(t.minX,i.minX),e=Math.max(t.minY,i.minY),r=Math.min(t.maxX,i.maxX),n=Math.min(t.maxY,i.maxY);return Math.max(0,r-s)*Math.max(0,n-e)}function zf(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function _f(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function gf(t){return{children:t,height:1,leaf:true,minX:Infinity,minY:Infinity,maxX:-Infinity,maxY:-Infinity}}function wf(t,i,s,e,r){var n=[i,s],h;while(n.length){s=n.pop();i=n.pop();if(s-i<=e)continue;h=i+Math.ceil((s-i)/e/2)*e;hf(t,h,i,s,r);n.push(i,h,h,s)}}var yf=function(){};yf.prototype.getReplay=function(t,i){};yf.prototype.isEmpty=function(){};var bf={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};var xf={};xf.lineString=function(t,i,s,e){var r=t[i];var n=t[i+1];var h=0;var a;for(a=i+e;a<s;a+=e){var o=t[a];var f=t[a+1];h+=Math.sqrt((o-r)*(o-r)+(f-n)*(f-n));r=o;n=f}return h};xf.linearRing=function(t,i,s,e){var r=xf.lineString(t,i,s,e);var n=t[s-e]-t[i];var h=t[s-e+1]-t[i+1];r+=Math.sqrt(n*n+h*h);return r};var kf={};kf.lineString=function(t,i,s,e,r,n,h,a){var o=[];var f=t[i]>t[s-e];var u=r.length;var v=t[i];var l=t[i+1];i+=e;var c=t[i];var d=t[i+1];var m=0;var p=Math.sqrt(Math.pow(c-v,2)+Math.pow(d-l,2));var M="";var z=0;var _,g,w;for(var y=0;y<u;++y){g=f?u-y-1:y;var b=r.charAt(g);M=f?b+M:M+b;var x=n(M)-z;z+=x;var k=h+x/2;while(i<s-e&&m+p<k){v=c;l=d;i+=e;c=t[i];d=t[i+1];m+=p;p=Math.sqrt(Math.pow(c-v,2)+Math.pow(d-l,2))}var E=k-m;var N=Math.atan2(d-l,c-v);if(f){N+=N>0?-Math.PI:Math.PI}if(w!==undefined){var C=N-w;C+=C>Math.PI?-2*Math.PI:C<-Math.PI?2*Math.PI:0;if(Math.abs(C)>a){return null}}var I=E/p;var S=Fh.lerp(v,c,I);var O=Fh.lerp(l,d,I);if(w==N){if(f){_[0]=S;_[1]=O;_[2]=x/2}_[4]=M}else{M=b;z=x;_=[S,O,x/2,N,M];if(f){o.unshift(_)}else{o.push(_)}w=N}h+=x}return o};var Ef={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12};var Nf={};Nf.ORDER=[bf.POLYGON,bf.CIRCLE,bf.LINE_STRING,bf.IMAGE,bf.TEXT,bf.DEFAULT];Nf.TEXT_ALIGN={};Nf.TEXT_ALIGN["left"]=0;Nf.TEXT_ALIGN["end"]=0;Nf.TEXT_ALIGN["center"]=.5;Nf.TEXT_ALIGN["right"]=1;Nf.TEXT_ALIGN["start"]=1;Nf.TEXT_ALIGN["top"]=0;Nf.TEXT_ALIGN["middle"]=.5;Nf.TEXT_ALIGN["hanging"]=.2;Nf.TEXT_ALIGN["alphabetic"]=.8;Nf.TEXT_ALIGN["ideographic"]=.8;Nf.TEXT_ALIGN["bottom"]=1;var Cf=function(t,i,s,e,r,n){Xo.call(this);this.declutterTree=n;this.tmpExtent_=qh.createEmpty();this.tolerance=t;this.maxExtent=i;this.overlaps=r;this.pixelRatio=e;this.maxLineWidth=0;this.resolution=s;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_=null;this.bufferedMaxExtent_=null;this.instructions=[];this.coordinates=[];this.coordinateCache_={};this.renderedTransform_=sa.create();this.hitDetectionInstructions=[];this.pixelCoordinates_=null;this.state={};this.viewRotation_=0;this.tmpLocalTransform_=sa.create();this.resetTransform_=sa.create()};kh.inherits(Cf,Xo);Cf.prototype.replayTextBackground_=function(t,i,s,e,r,n,h){t.beginPath();t.moveTo.apply(t,i);t.lineTo.apply(t,s);t.lineTo.apply(t,e);t.lineTo.apply(t,r);t.lineTo.apply(t,i);if(n){this.fillOrigin_=n[2];this.fill_(t)}if(h){this.setStrokeStyle_(t,h);t.stroke()}};Cf.prototype.replayImage_=function(t,i,s,e,r,n,h,a,o,f,u,v,l,c,d,m,p,M){var z=p||M;var _=this.tmpLocalTransform_;r*=l;n*=l;i-=r;s-=n;if(c){i=Math.round(i);s=Math.round(s)}var g=d+f>e.width?e.width-f:d;var w=a+u>e.height?e.height-u:a;var y=this.tmpExtent_;var b=m[3]+g*l+m[1];var x=m[0]+w*l+m[2];var k=i-m[3];var E=s-m[0];var N;var C;var I;var S;if(z||v!==0){N=[k,E];C=[k+b,E];I=[k+b,E+x];S=[k,E+x]}var O=null;if(v!==0){var T=i+r;var A=s+n;O=sa.compose(_,T,A,1,1,v,-T,-A);qh.createOrUpdateEmpty(y);qh.extendCoordinate(y,sa.apply(_,N));qh.extendCoordinate(y,sa.apply(_,C));qh.extendCoordinate(y,sa.apply(_,I));qh.extendCoordinate(y,sa.apply(_,S))}else{qh.createOrUpdate(k,E,k+b,E+x,y)}var R=t.canvas;var P=y[0]<=R.width&&y[2]>=0&&y[1]<=R.height&&y[3]>=0;if(h){if(!P&&h[4]==1){return}qh.extend(h,y);var L=P?[t,O?O.slice(0):null,o,e,f,u,g,w,i,s,l]:null;if(L&&z){L.push(p,M,N,C,I,S)}h.push(L)}else if(P){if(z){this.replayTextBackground_(t,N,C,I,S,p,M)}Vo.drawImage(t,O,o,e,f,u,g,w,i,s,l)}};Cf.prototype.applyPixelRatio=function(t){var i=this.pixelRatio;return i==1?t:t.map((function(t){return t*i}))};Cf.prototype.appendFlatCoordinates=function(t,i,s,e,r,n){var h=this.coordinates.length;var a=this.getBufferedMaxExtent();if(n){i+=e}var o=[t[i],t[i+1]];var f=[NaN,NaN];var u=true;var v,l,c;for(v=i+e;v<s;v+=e){f[0]=t[v];f[1]=t[v+1];c=qh.coordinateRelationship(a,f);if(c!==l){if(u){this.coordinates[h++]=o[0];this.coordinates[h++]=o[1]}this.coordinates[h++]=f[0];this.coordinates[h++]=f[1];u=false}else if(c===Uh.INTERSECTING){this.coordinates[h++]=f[0];this.coordinates[h++]=f[1];u=false}else{u=true}o[0]=f[0];o[1]=f[1];l=c}if(r&&u||v===i+e){this.coordinates[h++]=o[0];this.coordinates[h++]=o[1]}return h};Cf.prototype.drawCustomCoordinates_=function(t,i,s,e,r){for(var n=0,h=s.length;n<h;++n){var a=s[n];var o=this.appendFlatCoordinates(t,i,a,e,false,false);r.push(o);i=a}return i};Cf.prototype.drawCustom=function(t,i,s){this.beginGeometry(t,i);var e=t.getType();var r=t.getStride();var n=this.coordinates.length;var h,a,o,f;var u;if(e==Gh.MULTI_POLYGON){t=t;h=t.getOrientedFlatCoordinates();f=[];var v=t.getEndss();u=0;for(var l=0,c=v.length;l<c;++l){var d=[];u=this.drawCustomCoordinates_(h,u,v[l],r,d);f.push(d)}this.instructions.push([Ef.CUSTOM,n,f,t,s,oa.coordinatesss])}else if(e==Gh.POLYGON||e==Gh.MULTI_LINE_STRING){o=[];h=e==Gh.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates();u=this.drawCustomCoordinates_(h,0,t.getEnds(),r,o);this.instructions.push([Ef.CUSTOM,n,o,t,s,oa.coordinatess])}else if(e==Gh.LINE_STRING||e==Gh.MULTI_POINT){h=t.getFlatCoordinates();a=this.appendFlatCoordinates(h,0,h.length,r,false,false);this.instructions.push([Ef.CUSTOM,n,a,t,s,oa.coordinates])}else if(e==Gh.POINT){h=t.getFlatCoordinates();this.coordinates.push(h[0],h[1]);a=this.coordinates.length;this.instructions.push([Ef.CUSTOM,n,a,t,s])}this.endGeometry(t,i)};Cf.prototype.beginGeometry=function(t,i){this.beginGeometryInstruction1_=[Ef.BEGIN_GEOMETRY,i,0];this.instructions.push(this.beginGeometryInstruction1_);this.beginGeometryInstruction2_=[Ef.BEGIN_GEOMETRY,i,0];this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)};Cf.prototype.fill_=function(t){if(this.fillOrigin_){var i=sa.apply(this.renderedTransform_,this.fillOrigin_.slice());t.translate(i[0],i[1]);t.rotate(this.viewRotation_)}t.fill();if(this.fillOrigin_){t.setTransform.apply(t,Vo.resetTransform_)}};Cf.prototype.setStrokeStyle_=function(t,i){t.strokeStyle=i[1];t.lineWidth=i[2];t.lineCap=i[3];t.lineJoin=i[4];t.miterLimit=i[5];if(ga.CANVAS_LINE_DASH){t.lineDashOffset=i[7];t.setLineDash(i[6])}};Cf.prototype.renderDeclutter_=function(t,i){if(t&&t.length>5){var s=t[4];if(s==1||s==t.length-5){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};if(!this.declutterTree.collides(e)){this.declutterTree.insert(e);var r=Vo.drawImage;for(var n=5,h=t.length;n<h;++n){var a=t[n];if(a){if(a.length>11){this.replayTextBackground_(a[0],a[13],a[14],a[15],a[16],a[11],a[12])}r.apply(undefined,a)}}}t.length=5;qh.createOrUpdateEmpty(t)}}};Cf.prototype.replay_=function(t,i,s,e,r,n){var h;if(this.pixelCoordinates_&&jh.equals(i,this.renderedTransform_)){h=this.pixelCoordinates_}else{if(!this.pixelCoordinates_){this.pixelCoordinates_=[]}h=Bh.transform2D(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_);sa.setFromArray(this.renderedTransform_,i)}var a=!Ch.isEmpty(s);var o=0;var f=e.length;var u=0;var v;var l,c,d,m,p,M,z,_;var g=0;var w=0;var y=null;var b=null;var x=this.coordinateCache_;var k=this.viewRotation_;var E={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k};var N=this.instructions!=e||this.overlaps?0:200;while(o<f){var C=e[o];var I=C[0];var S,O,T;switch(I){case Ef.BEGIN_GEOMETRY:S=C[1];if(a&&s[kh.getUid(S).toString()]||!S.getGeometry()){o=C[2]}else if(n!==undefined&&!qh.intersects(n,S.getGeometry().getExtent())){o=C[2]+1}else{++o}break;case Ef.BEGIN_PATH:if(g>N){this.fill_(t);g=0}if(w>N){t.stroke();w=0}if(!g&&!w){t.beginPath();d=m=NaN}++o;break;case Ef.CIRCLE:u=C[1];var A=h[u];var R=h[u+1];var P=h[u+2];var L=h[u+3];var D=P-A;var F=L-R;var G=Math.sqrt(D*D+F*F);t.moveTo(A+G,R);t.arc(A,R,G,0,2*Math.PI,true);++o;break;case Ef.CLOSE_PATH:t.closePath();++o;break;case Ef.CUSTOM:u=C[1];v=C[2];var W=C[3];var j=C[4];var V=C.length==6?C[5]:undefined;E.geometry=W;E.feature=S;if(!(o in x)){x[o]=[]}var U=x[o];if(V){V(h,u,v,2,U)}else{U[0]=h[u];U[1]=h[u+1];U.length=2}j(U,E);++o;break;case Ef.DRAW_IMAGE:u=C[1];v=C[2];_=C[3];l=C[4];c=C[5];z=r?null:C[6];var q=C[7];var X=C[8];var Y=C[9];var B=C[10];var H=C[11];var J=C[12];var Z=C[13];var K=C[14];var $=C[15];var Q,tt,it;if(C.length>16){Q=C[16];tt=C[17];it=C[18]}else{Q=Vo.defaultPadding;tt=it=false}if(H){J+=k}for(;u<v;u+=2){this.replayImage_(t,h[u],h[u+1],_,l,c,z,q,X,Y,B,J,Z,K,$,Q,tt?y:null,it?b:null)}this.renderDeclutter_(z,S);++o;break;case Ef.DRAW_CHARS:var st=C[1];var et=C[2];var rt=C[3];z=r?null:C[4];var nt=C[5];var ht=C[6];var at=C[7];var ot=C[8];var ft=C[9];var ut=C[10];var vt=C[11];var lt=C[12];var ct=C[13];var dt=C[14];var mt=xf.lineString(h,st,et,2);var pt=ot(lt);if(nt||pt<=mt){var Mt=this.textStates[ct].textAlign;var zt=(mt-pt)*Nf.TEXT_ALIGN[Mt];var _t=kf.lineString(h,st,et,2,lt,ot,zt,at);if(_t){var gt,wt,yt,bt,xt;if(ut){for(gt=0,wt=_t.length;gt<wt;++gt){xt=_t[gt];yt=xt[4];bt=this.getImage(yt,ct,"",ut);l=xt[2]+vt;c=rt*bt.height+(.5-rt)*2*vt-ft;this.replayImage_(t,xt[0],xt[1],bt,l,c,z,bt.height,1,0,0,xt[3],dt,false,bt.width,Vo.defaultPadding,null,null)}}if(ht){for(gt=0,wt=_t.length;gt<wt;++gt){xt=_t[gt];yt=xt[4];bt=this.getImage(yt,ct,ht,"");l=xt[2];c=rt*bt.height-ft;this.replayImage_(t,xt[0],xt[1],bt,l,c,z,bt.height,1,0,0,xt[3],dt,false,bt.width,Vo.defaultPadding,null,null)}}}}this.renderDeclutter_(z,S);++o;break;case Ef.END_GEOMETRY:if(r!==undefined){S=C[1];var kt=r(S);if(kt){return kt}}++o;break;case Ef.FILL:if(N){g++}else{this.fill_(t)}++o;break;case Ef.MOVE_TO_LINE_TO:u=C[1];v=C[2];O=h[u];T=h[u+1];p=O+.5|0;M=T+.5|0;if(p!==d||M!==m){t.moveTo(O,T);d=p;m=M}for(u+=2;u<v;u+=2){O=h[u];T=h[u+1];p=O+.5|0;M=T+.5|0;if(u==v-2||p!==d||M!==m){t.lineTo(O,T);d=p;m=M}}++o;break;case Ef.SET_FILL_STYLE:y=C;this.fillOrigin_=C[2];if(g){this.fill_(t);g=0;if(w){t.stroke();w=0}}t.fillStyle=C[1];++o;break;case Ef.SET_STROKE_STYLE:b=C;if(w){t.stroke();w=0}this.setStrokeStyle_(t,C);++o;break;case Ef.STROKE:if(N){w++}else{t.stroke()}++o;break;default:++o;break}}if(g){this.fill_(t)}if(w){t.stroke()}return undefined};Cf.prototype.replay=function(t,i,s,e){this.viewRotation_=s;this.replay_(t,i,e,this.instructions,undefined,undefined)};Cf.prototype.replayHitDetection=function(t,i,s,e,r,n){this.viewRotation_=s;return this.replay_(t,i,e,this.hitDetectionInstructions,r,n)};Cf.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var i;var s=t.length;var e;var r;var n=-1;for(i=0;i<s;++i){e=t[i];r=e[0];if(r==Ef.END_GEOMETRY){n=i}else if(r==Ef.BEGIN_GEOMETRY){e[2]=i;jh.reverseSubArray(this.hitDetectionInstructions,n,i);n=-1}}};Cf.prototype.setFillStrokeStyle=function(t,i){var s=this.state;if(t){var e=t.getColor();s.fillStyle=qo.asColorLike(e?e:Vo.defaultFillStyle)}else{s.fillStyle=undefined}if(i){var r=i.getColor();s.strokeStyle=qo.asColorLike(r?r:Vo.defaultStrokeStyle);var n=i.getLineCap();s.lineCap=n!==undefined?n:Vo.defaultLineCap;var h=i.getLineDash();s.lineDash=h?h.slice():Vo.defaultLineDash;var a=i.getLineDashOffset();s.lineDashOffset=a?a:Vo.defaultLineDashOffset;var o=i.getLineJoin();s.lineJoin=o!==undefined?o:Vo.defaultLineJoin;var f=i.getWidth();s.lineWidth=f!==undefined?f:Vo.defaultLineWidth;var u=i.getMiterLimit();s.miterLimit=u!==undefined?u:Vo.defaultMiterLimit;if(s.lineWidth>this.maxLineWidth){this.maxLineWidth=s.lineWidth;this.bufferedMaxExtent_=null}}else{s.strokeStyle=undefined;s.lineCap=undefined;s.lineDash=null;s.lineDashOffset=undefined;s.lineJoin=undefined;s.lineWidth=undefined;s.miterLimit=undefined}};Cf.prototype.applyFill=function(t,i){var s=t.fillStyle;var e=[Ef.SET_FILL_STYLE,s];if(typeof s!=="string"){var r=i.getExtent();e.push([r[0],r[3]])}this.instructions.push(e)};Cf.prototype.applyStroke=function(t){this.instructions.push([Ef.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio])};Cf.prototype.updateFillStyle=function(t,i,s){var e=t.fillStyle;if(typeof e!=="string"||t.currentFillStyle!=e){i.call(this,t,s);t.currentFillStyle=e}};Cf.prototype.updateStrokeStyle=function(t,i){var s=t.strokeStyle;var e=t.lineCap;var r=t.lineDash;var n=t.lineDashOffset;var h=t.lineJoin;var a=t.lineWidth;var o=t.miterLimit;if(t.currentStrokeStyle!=s||t.currentLineCap!=e||r!=t.currentLineDash&&!jh.equals(t.currentLineDash,r)||t.currentLineDashOffset!=n||t.currentLineJoin!=h||t.currentLineWidth!=a||t.currentMiterLimit!=o){i.call(this,t);t.currentStrokeStyle=s;t.currentLineCap=e;t.currentLineDash=r;t.currentLineDashOffset=n;t.currentLineJoin=h;t.currentLineWidth=a;t.currentMiterLimit=o}};Cf.prototype.endGeometry=function(t,i){this.beginGeometryInstruction1_[2]=this.instructions.length;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length;this.beginGeometryInstruction2_=null;var s=[Ef.END_GEOMETRY,i];this.instructions.push(s);this.hitDetectionInstructions.push(s)};Cf.prototype.finish=kh.nullFunction;Cf.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_){this.bufferedMaxExtent_=qh.clone(this.maxExtent);if(this.maxLineWidth>0){var t=this.resolution*(this.maxLineWidth+1)/2;qh.buffer(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}}return this.bufferedMaxExtent_};var If=function(t,i,s,e,r,n){Cf.call(this,t,i,s,e,r,n);this.declutterGroup_=null;this.hitDetectionImage_=null;this.image_=null;this.anchorX_=undefined;this.anchorY_=undefined;this.height_=undefined;this.opacity_=undefined;this.originX_=undefined;this.originY_=undefined;this.rotateWithView_=undefined;this.rotation_=undefined;this.scale_=undefined;this.snapToPixel_=undefined;this.width_=undefined};kh.inherits(If,Cf);If.prototype.drawCoordinates_=function(t,i,s,e){return this.appendFlatCoordinates(t,i,s,e,false,false)};If.prototype.drawPoint=function(t,i){if(!this.image_){return}this.beginGeometry(t,i);var s=t.getFlatCoordinates();var e=t.getStride();var r=this.coordinates.length;var n=this.drawCoordinates_(s,0,s.length,e);this.instructions.push([Ef.DRAW_IMAGE,r,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([Ef.DRAW_IMAGE,r,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(t,i)};If.prototype.drawMultiPoint=function(t,i){if(!this.image_){return}this.beginGeometry(t,i);var s=t.getFlatCoordinates();var e=t.getStride();var r=this.coordinates.length;var n=this.drawCoordinates_(s,0,s.length,e);this.instructions.push([Ef.DRAW_IMAGE,r,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([Ef.DRAW_IMAGE,r,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(t,i)};If.prototype.finish=function(){this.reverseHitDetectionInstructions();this.anchorX_=undefined;this.anchorY_=undefined;this.hitDetectionImage_=null;this.image_=null;this.height_=undefined;this.scale_=undefined;this.opacity_=undefined;this.originX_=undefined;this.originY_=undefined;this.rotateWithView_=undefined;this.rotation_=undefined;this.snapToPixel_=undefined;this.width_=undefined};If.prototype.setImageStyle=function(t,i){var s=t.getAnchor();var e=t.getSize();var r=t.getHitDetectionImage(1);var n=t.getImage(1);var h=t.getOrigin();this.anchorX_=s[0];this.anchorY_=s[1];this.declutterGroup_=i;this.hitDetectionImage_=r;this.image_=n;this.height_=e[1];this.opacity_=t.getOpacity();this.originX_=h[0];this.originY_=h[1];this.rotateWithView_=t.getRotateWithView();this.rotation_=t.getRotation();this.scale_=t.getScale();this.snapToPixel_=t.getSnapToPixel();this.width_=e[0]};var Sf=function(t,i,s,e,r,n){Cf.call(this,t,i,s,e,r,n)};kh.inherits(Sf,Cf);Sf.prototype.drawFlatCoordinates_=function(t,i,s,e){var r=this.coordinates.length;var n=this.appendFlatCoordinates(t,i,s,e,false,false);var h=[Ef.MOVE_TO_LINE_TO,r,n];this.instructions.push(h);this.hitDetectionInstructions.push(h);return s};Sf.prototype.drawLineString=function(t,i){var s=this.state;var e=s.strokeStyle;var r=s.lineWidth;if(e===undefined||r===undefined){return}this.updateStrokeStyle(s,this.applyStroke);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Ef.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[Ef.BEGIN_PATH]);var n=t.getFlatCoordinates();var h=t.getStride();this.drawFlatCoordinates_(n,0,n.length,h);this.hitDetectionInstructions.push([Ef.STROKE]);this.endGeometry(t,i)};Sf.prototype.drawMultiLineString=function(t,i){var s=this.state;var e=s.strokeStyle;var r=s.lineWidth;if(e===undefined||r===undefined){return}this.updateStrokeStyle(s,this.applyStroke);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Ef.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[Ef.BEGIN_PATH]);var n=t.getEnds();var h=t.getFlatCoordinates();var a=t.getStride();var o=0;var f,u;for(f=0,u=n.length;f<u;++f){o=this.drawFlatCoordinates_(h,o,n[f],a)}this.hitDetectionInstructions.push([Ef.STROKE]);this.endGeometry(t,i)};Sf.prototype.finish=function(){var t=this.state;if(t.lastStroke!=undefined&&t.lastStroke!=this.coordinates.length){this.instructions.push([Ef.STROKE])}this.reverseHitDetectionInstructions();this.state=null};Sf.prototype.applyStroke=function(t){if(t.lastStroke!=undefined&&t.lastStroke!=this.coordinates.length){this.instructions.push([Ef.STROKE]);t.lastStroke=this.coordinates.length}t.lastStroke=0;Cf.prototype.applyStroke.call(this,t);this.instructions.push([Ef.BEGIN_PATH])};var Of=function(t,i,s,e,r,n){Cf.call(this,t,i,s,e,r,n)};kh.inherits(Of,Cf);Of.prototype.drawFlatCoordinatess_=function(t,i,s,e){var r=this.state;var n=r.fillStyle!==undefined;var h=r.strokeStyle!=undefined;var a=s.length;var o=[Ef.BEGIN_PATH];this.instructions.push(o);this.hitDetectionInstructions.push(o);for(var f=0;f<a;++f){var u=s[f];var v=this.coordinates.length;var l=this.appendFlatCoordinates(t,i,u,e,true,!h);var c=[Ef.MOVE_TO_LINE_TO,v,l];this.instructions.push(c);this.hitDetectionInstructions.push(c);if(h){var d=[Ef.CLOSE_PATH];this.instructions.push(d);this.hitDetectionInstructions.push(d)}i=u}var m=[Ef.FILL];this.hitDetectionInstructions.push(m);if(n){this.instructions.push(m)}if(h){var p=[Ef.STROKE];this.instructions.push(p);this.hitDetectionInstructions.push(p)}return i};Of.prototype.drawCircle=function(t,i){var s=this.state;var e=s.fillStyle;var r=s.strokeStyle;if(e===undefined&&r===undefined){return}this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Ef.SET_FILL_STYLE,Uo.asString(Vo.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([Ef.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var n=t.getFlatCoordinates();var h=t.getStride();var a=this.coordinates.length;this.appendFlatCoordinates(n,0,n.length,h,false,false);var o=[Ef.BEGIN_PATH];var f=[Ef.CIRCLE,a];this.instructions.push(o,f);this.hitDetectionInstructions.push(o,f);var u=[Ef.FILL];this.hitDetectionInstructions.push(u);if(s.fillStyle!==undefined){this.instructions.push(u)}if(s.strokeStyle!==undefined){var v=[Ef.STROKE];this.instructions.push(v);this.hitDetectionInstructions.push(v)}this.endGeometry(t,i)};Of.prototype.drawPolygon=function(t,i){var s=this.state;this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Ef.SET_FILL_STYLE,Uo.asString(Vo.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([Ef.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var e=t.getEnds();var r=t.getOrientedFlatCoordinates();var n=t.getStride();this.drawFlatCoordinatess_(r,0,e,n);this.endGeometry(t,i)};Of.prototype.drawMultiPolygon=function(t,i){var s=this.state;var e=s.fillStyle;var r=s.strokeStyle;if(e===undefined&&r===undefined){return}this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Ef.SET_FILL_STYLE,Uo.asString(Vo.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([Ef.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var n=t.getEndss();var h=t.getOrientedFlatCoordinates();var a=t.getStride();var o=0;var f,u;for(f=0,u=n.length;f<u;++f){o=this.drawFlatCoordinatess_(h,o,n[f],a)}this.endGeometry(t,i)};Of.prototype.finish=function(){this.reverseHitDetectionInstructions();this.state=null;var t=this.tolerance;if(t!==0){var i=this.coordinates;var s,e;for(s=0,e=i.length;s<e;++s){i[s]=fa.snap(i[s],t)}}};Of.prototype.setFillStrokeStyles_=function(t){var i=this.state;var s=i.fillStyle;if(s!==undefined){this.updateFillStyle(i,this.applyFill,t)}if(i.strokeStyle!==undefined){this.updateStrokeStyle(i,this.applyStroke)}};var Tf={};Tf.lineString=function(t,i,s,e,r){var n=s;var h=s;var a=0;var o=0;var f=s;var u,v,l,c,d,m,p,M,z,_;for(v=s;v<e;v+=r){var g=i[v];var w=i[v+1];if(d!==undefined){z=g-d;_=w-m;c=Math.sqrt(z*z+_*_);if(p!==undefined){o+=l;u=Math.acos((p*z+M*_)/(l*c));if(u>t){if(o>a){a=o;n=f;h=v}o=0;f=v-r}}l=c;p=z;M=_}d=g;m=w}o+=c;return o>a?[f,v]:[n,h]};var Af={POINT:"point",LINE:"line"};var Rf=function(t,i,s,e,r,n){Cf.call(this,t,i,s,e,r,n);this.labels_=null;this.text_="";this.textOffsetX_=0;this.textOffsetY_=0;this.textRotateWithView_=undefined;this.textRotation_=0;this.textFillState_=null;this.fillStates={};this.textStrokeState_=null;this.strokeStates={};this.textState_={};this.textStates={};this.textKey_="";this.fillKey_="";this.strokeKey_="";this.widths_={};var h=Vo.labelCache;h.prune()};kh.inherits(Rf,Cf);Rf.measureTextWidths=function(t,i,s){var e=i.length;var r=0;var n,h;for(h=0;h<e;++h){n=Vo.measureTextWidth(t,i[h]);r=Math.max(r,n);s.push(n)}return r};Rf.prototype.drawText=function(t,i){var s=this.textFillState_;var e=this.textStrokeState_;var r=this.textState_;if(this.text_===""||!r||!s&&!e){return}var n=this.coordinates.length;var h=t.getType();var a=null;var o=2;var f=2;var u,v;if(r.placement===Af.LINE){if(!qh.intersects(this.getBufferedMaxExtent(),t.getExtent())){return}var l;a=t.getFlatCoordinates();f=t.getStride();if(h==Gh.LINE_STRING){l=[a.length]}else if(h==Gh.MULTI_LINE_STRING){l=t.getEnds()}else if(h==Gh.POLYGON){l=t.getEnds().slice(0,1)}else if(h==Gh.MULTI_POLYGON){var c=t.getEndss();l=[];for(u=0,v=c.length;u<v;++u){l.push(c[u][0])}}this.beginGeometry(t,i);var d=r.textAlign;var m=0;var p;for(var M=0,z=l.length;M<z;++M){if(d==undefined){var _=Tf.lineString(r.maxAngle,a,m,l[M],f);m=_[0];p=_[1]}else{p=l[M]}for(u=m;u<p;u+=f){this.coordinates.push(a[u],a[u+1])}o=this.coordinates.length;m=l[M];this.drawChars_(n,o,this.declutterGroup_);n=o}this.endGeometry(t,i)}else{var g=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_);var w=g.width/this.pixelRatio;switch(h){case Gh.POINT:case Gh.MULTI_POINT:a=t.getFlatCoordinates();o=a.length;break;case Gh.LINE_STRING:a=t.getFlatMidpoint();break;case Gh.CIRCLE:a=t.getCenter();break;case Gh.MULTI_LINE_STRING:a=t.getFlatMidpoints();o=a.length;break;case Gh.POLYGON:a=t.getFlatInteriorPoint();if(!r.overflow&&a[2]/this.resolution<w){return}f=3;break;case Gh.MULTI_POLYGON:var y=t.getFlatInteriorPoints();a=[];for(u=0,v=y.length;u<v;u+=3){if(r.overflow||y[u+2]/this.resolution>=w){a.push(y[u],y[u+1])}}o=a.length;if(o==0){return}break}o=this.appendFlatCoordinates(a,0,o,f,false,false);this.beginGeometry(t,i);if(r.backgroundFill||r.backgroundStroke){this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke);this.updateFillStyle(this.state,this.applyFill,t);this.updateStrokeStyle(this.state,this.applyStroke)}this.drawTextImage_(g,n,o);this.endGeometry(t,i)}};Rf.prototype.getImage=function(t,i,s,e){var r;var n=e+i+t+s+this.pixelRatio;var h=Vo.labelCache;if(!h.containsKey(n)){var a=e?this.strokeStates[e]||this.textStrokeState_:null;var o=s?this.fillStates[s]||this.textFillState_:null;var f=this.textStates[i]||this.textState_;var u=this.pixelRatio;var v=f.scale*u;var l=Nf.TEXT_ALIGN[f.textAlign||Vo.defaultTextAlign];var c=e&&a.lineWidth?a.lineWidth:0;var d=t.split("\n");var m=d.length;var p=[];var M=Rf.measureTextWidths(f.font,d,p);var z=Vo.measureTextHeight(f.font);var _=z*m;var g=M+c;var w=$a.createCanvasContext2D(Math.ceil(g*v),Math.ceil((_+c)*v));r=w.canvas;h.set(n,r);if(v!=1){w.scale(v,v)}w.font=f.font;if(e){w.strokeStyle=a.strokeStyle;w.lineWidth=c*(ga.SAFARI?v:1);w.lineCap=a.lineCap;w.lineJoin=a.lineJoin;w.miterLimit=a.miterLimit;if(ga.CANVAS_LINE_DASH&&a.lineDash.length){w.setLineDash(a.lineDash);w.lineDashOffset=a.lineDashOffset}}if(s){w.fillStyle=o.fillStyle}w.textBaseline="middle";w.textAlign="center";var y=.5-l;var b=l*r.width/v+y*c;var x;if(e){for(x=0;x<m;++x){w.strokeText(d[x],b+y*p[x],.5*(c+z)+x*z)}}if(s){for(x=0;x<m;++x){w.fillText(d[x],b+y*p[x],.5*(c+z)+x*z)}}}return h.get(n)};Rf.prototype.drawTextImage_=function(t,i,s){var e=this.textState_;var r=this.textStrokeState_;var n=this.pixelRatio;var h=Nf.TEXT_ALIGN[e.textAlign||Vo.defaultTextAlign];var a=Nf.TEXT_ALIGN[e.textBaseline];var o=r&&r.lineWidth?r.lineWidth:0;var f=h*t.width/n+2*(.5-h)*o;var u=a*t.height/n+2*(.5-a)*o;this.instructions.push([Ef.DRAW_IMAGE,i,s,t,(f-this.textOffsetX_)*n,(u-this.textOffsetY_)*n,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,true,t.width,e.padding==Vo.defaultPadding?Vo.defaultPadding:e.padding.map((function(t){return t*n})),!!e.backgroundFill,!!e.backgroundStroke]);this.hitDetectionInstructions.push([Ef.DRAW_IMAGE,i,s,t,(f-this.textOffsetX_)*n,(u-this.textOffsetY_)*n,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/n,true,t.width,e.padding,!!e.backgroundFill,!!e.backgroundStroke])};Rf.prototype.drawChars_=function(t,i,s){var e=this.textStrokeState_;var r=this.textState_;var n=this.textFillState_;var h=this.strokeKey_;if(e){if(!(h in this.strokeStates)){this.strokeStates[h]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}}}var a=this.textKey_;if(!(this.textKey_ in this.textStates)){this.textStates[this.textKey_]={font:r.font,textAlign:r.textAlign||Vo.defaultTextAlign,scale:r.scale}}var o=this.fillKey_;if(n){if(!(o in this.fillStates)){this.fillStates[o]={fillStyle:n.fillStyle}}}var f=this.pixelRatio;var u=Nf.TEXT_ALIGN[r.textBaseline];var v=this.textOffsetY_*f;var l=this.text_;var c=r.font;var d=r.scale;var m=e?e.lineWidth*d/2:0;var p=this.widths_[c];if(!p){this.widths_[c]=p={}}this.instructions.push([Ef.DRAW_CHARS,t,i,u,s,r.overflow,o,r.maxAngle,function(t){var i=p[t];if(!i){i=p[t]=Vo.measureTextWidth(c,t)}return i*d*f},v,h,m*f,l,a,1]);this.hitDetectionInstructions.push([Ef.DRAW_CHARS,t,i,u,s,r.overflow,o,r.maxAngle,function(t){var i=p[t];if(!i){i=p[t]=Vo.measureTextWidth(c,t)}return i*d},v,h,m,l,a,1/f])};Rf.prototype.setTextStyle=function(t,i){var s,e,r;if(!t){this.text_=""}else{this.declutterGroup_=i;var n=t.getFill();if(!n){e=this.textFillState_=null}else{e=this.textFillState_;if(!e){e=this.textFillState_={}}e.fillStyle=qo.asColorLike(n.getColor()||Vo.defaultFillStyle)}var h=t.getStroke();if(!h){r=this.textStrokeState_=null}else{r=this.textStrokeState_;if(!r){r=this.textStrokeState_={}}var a=h.getLineDash();var o=h.getLineDashOffset();var f=h.getWidth();var u=h.getMiterLimit();r.lineCap=h.getLineCap()||Vo.defaultLineCap;r.lineDash=a?a.slice():Vo.defaultLineDash;r.lineDashOffset=o===undefined?Vo.defaultLineDashOffset:o;r.lineJoin=h.getLineJoin()||Vo.defaultLineJoin;r.lineWidth=f===undefined?Vo.defaultLineWidth:f;r.miterLimit=u===undefined?Vo.defaultMiterLimit:u;r.strokeStyle=qo.asColorLike(h.getColor()||Vo.defaultStrokeStyle)}s=this.textState_;var v=t.getFont()||Vo.defaultFont;Vo.checkFont(v);var l=t.getScale();s.overflow=t.getOverflow();s.font=v;s.maxAngle=t.getMaxAngle();s.placement=t.getPlacement();s.textAlign=t.getTextAlign();s.textBaseline=t.getTextBaseline()||Vo.defaultTextBaseline;s.backgroundFill=t.getBackgroundFill();s.backgroundStroke=t.getBackgroundStroke();s.padding=t.getPadding()||Vo.defaultPadding;s.scale=l===undefined?1:l;var c=t.getOffsetX();var d=t.getOffsetY();var m=t.getRotateWithView();var p=t.getRotation();this.text_=t.getText()||"";this.textOffsetX_=c===undefined?0:c;this.textOffsetY_=d===undefined?0:d;this.textRotateWithView_=m===undefined?false:m;this.textRotation_=p===undefined?0:p;this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:kh.getUid(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"";this.textKey_=s.font+s.scale+(s.textAlign||"?");this.fillKey_=e?typeof e.fillStyle=="string"?e.fillStyle:"|"+kh.getUid(e.fillStyle):""}};var Pf=function(t,i,s,e,r,n,h){yf.call(this);this.declutterTree_=n;this.declutterGroup_=null;this.tolerance_=t;this.maxExtent_=i;this.overlaps_=r;this.pixelRatio_=e;this.resolution_=s;this.renderBuffer_=h;this.replaysByZIndex_={};this.hitDetectionContext_=$a.createCanvasContext2D(1,1);this.hitDetectionTransform_=sa.create()};kh.inherits(Pf,yf);Pf.circleArrayCache_={0:[[true]]};Pf.fillCircleArrayRowToMiddle_=function(t,i,s){var e;var r=Math.floor(t.length/2);if(i>=r){for(e=r;e<i;e++){t[e][s]=true}}else if(i<r){for(e=i+1;e<r;e++){t[e][s]=true}}};Pf.getCircleArray_=function(t){if(Pf.circleArrayCache_[t]!==undefined){return Pf.circleArrayCache_[t]}var i=t*2+1;var s=new Array(i);for(var e=0;e<i;e++){s[e]=new Array(i)}var r=t;var n=0;var h=0;while(r>=n){Pf.fillCircleArrayRowToMiddle_(s,t+r,t+n);Pf.fillCircleArrayRowToMiddle_(s,t+n,t+r);Pf.fillCircleArrayRowToMiddle_(s,t-n,t+r);Pf.fillCircleArrayRowToMiddle_(s,t-r,t+n);Pf.fillCircleArrayRowToMiddle_(s,t-r,t-n);Pf.fillCircleArrayRowToMiddle_(s,t-n,t-r);Pf.fillCircleArrayRowToMiddle_(s,t+n,t-r);Pf.fillCircleArrayRowToMiddle_(s,t+r,t-n);n++;h+=1+2*n;if(2*(h-r)+1>0){r-=1;h+=1-2*r}}Pf.circleArrayCache_[t]=s;return s};Pf.replayDeclutter=function(t,i,s){var e=Object.keys(t).map(Number).sort(jh.numberSafeCompareFunction);var r={};for(var n=0,h=e.length;n<h;++n){var a=t[e[n].toString()];for(var o=0,f=a.length;o<f;){var u=a[o++];var v=a[o++];u.replay(i,v,s,r)}}};Pf.prototype.addDeclutter=function(t){var i=null;if(this.declutterTree_){if(t){i=this.declutterGroup_;i[4]++}else{i=this.declutterGroup_=qh.createEmpty();i.push(1)}}return i};Pf.prototype.clip=function(t,i){var s=this.getClipCoords(i);t.beginPath();t.moveTo(s[0],s[1]);t.lineTo(s[2],s[3]);t.lineTo(s[4],s[5]);t.lineTo(s[6],s[7]);t.clip()};Pf.prototype.hasReplays=function(t){for(var i in this.replaysByZIndex_){var s=this.replaysByZIndex_[i];for(var e=0,r=t.length;e<r;++e){if(t[e]in s){return true}}}return false};Pf.prototype.finish=function(){var t;for(t in this.replaysByZIndex_){var i=this.replaysByZIndex_[t];var s;for(s in i){i[s].finish()}}};Pf.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){e=Math.round(e);var a=e*2+1;var o=sa.compose(this.hitDetectionTransform_,e+.5,e+.5,1/i,-1/i,-s,-t[0],-t[1]);var f=this.hitDetectionContext_;if(f.canvas.width!==a||f.canvas.height!==a){f.canvas.width=a;f.canvas.height=a}else{f.clearRect(0,0,a,a)}var u;if(this.renderBuffer_!==undefined){u=qh.createEmpty();qh.extendCoordinate(u,t);qh.buffer(u,i*(this.renderBuffer_+e),u)}var v=Pf.getCircleArray_(e);var l;if(this.declutterTree_){l=this.declutterTree_.all().map((function(t){return t.value}))}var c;function d(t){var i=f.getImageData(0,0,a,a).data;for(var s=0;s<a;s++){for(var e=0;e<a;e++){if(v[s][e]){if(i[(e*a+s)*4+3]>0){var r;if(!(l&&(c==bf.IMAGE||c==bf.TEXT))||l.indexOf(t)!==-1){r=n(t)}if(r){return r}else{f.clearRect(0,0,a,a);return undefined}}}}}}var m=Object.keys(this.replaysByZIndex_).map(Number);m.sort(jh.numberSafeCompareFunction);var p,M,z,_,g;for(p=m.length-1;p>=0;--p){var w=m[p].toString();z=this.replaysByZIndex_[w];for(M=Nf.ORDER.length-1;M>=0;--M){c=Nf.ORDER[M];_=z[c];if(_!==undefined){if(h&&(c==bf.IMAGE||c==bf.TEXT)){var y=h[w];if(!y){h[w]=[_,o.slice(0)]}else{y.push(_,o.slice(0))}}else{g=_.replayHitDetection(f,o,s,r,d,u);if(g){return g}}}}}return undefined};Pf.prototype.getClipCoords=function(t){var i=this.maxExtent_;var s=i[0];var e=i[1];var r=i[2];var n=i[3];var h=[s,e,s,n,r,n,r,e];Bh.transform2D(h,0,8,2,t,h);return h};Pf.prototype.getReplay=function(t,i){var s=t!==undefined?t.toString():"0";var e=this.replaysByZIndex_[s];if(e===undefined){e={};this.replaysByZIndex_[s]=e}var r=e[i];if(r===undefined){var n=Pf.BATCH_CONSTRUCTORS_[i];r=new n(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_);e[i]=r}return r};Pf.prototype.getReplays=function(){return this.replaysByZIndex_};Pf.prototype.isEmpty=function(){return Ch.isEmpty(this.replaysByZIndex_)};Pf.prototype.replay=function(t,i,s,e,r,n){var h=Object.keys(this.replaysByZIndex_).map(Number);h.sort(jh.numberSafeCompareFunction);t.save();this.clip(t,i);var a=r?r:Nf.ORDER;var o,f,u,v,l,c;for(o=0,f=h.length;o<f;++o){var d=h[o].toString();l=this.replaysByZIndex_[d];for(u=0,v=a.length;u<v;++u){var m=a[u];c=l[m];if(c!==undefined){if(n&&(m==bf.IMAGE||m==bf.TEXT)){var p=n[d];if(!p){n[d]=[c,i.slice(0)]}else{p.push(c,i.slice(0))}}else{c.replay(t,i,s,e)}}}}t.restore()};Pf.BATCH_CONSTRUCTORS_={Circle:Of,Default:Cf,Image:If,LineString:Sf,Polygon:Of,Text:Rf};var Lf={};Lf.defaultOrder=function(t,i){return kh.getUid(t)-kh.getUid(i)};Lf.getSquaredTolerance=function(t,i){var s=Lf.getTolerance(t,i);return s*s};Lf.getTolerance=function(t,i){return kh.SIMPLIFY_TOLERANCE*t/i};Lf.renderCircleGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(r||n){var h=t.getReplay(s.getZIndex(),bf.CIRCLE);h.setFillStrokeStyle(r,n);h.drawCircle(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),bf.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Lf.renderFeature=function(t,i,s,e,r,n){var h=false;var a,o;a=s.getImage();if(a){o=a.getImageState();if(o==Lo.LOADED||o==Lo.ERROR){a.unlistenImageChange(r,n)}else{if(o==Lo.IDLE){a.load()}o=a.getImageState();a.listenImageChange(r,n);h=true}}Lf.renderFeature_(t,i,s,e);return h};Lf.renderFeature_=function(t,i,s,e){var r=s.getGeometryFunction()(i);if(!r){return}var n=r.getSimplifiedGeometry(e);var h=s.getRenderer();if(h){Lf.renderGeometry_(t,n,s,i)}else{var a=Lf.GEOMETRY_RENDERERS_[n.getType()];a(t,n,s,i)}};Lf.renderGeometry_=function(t,i,s,e){if(i.getType()==Gh.GEOMETRY_COLLECTION){var r=i.getGeometries();for(var n=0,h=r.length;n<h;++n){Lf.renderGeometry_(t,r[n],s,e)}return}var a=t.getReplay(s.getZIndex(),bf.DEFAULT);a.drawCustom(i,e,s.getRenderer())};Lf.renderGeometryCollectionGeometry_=function(t,i,s,e){var r=i.getGeometriesArray();var n,h;for(n=0,h=r.length;n<h;++n){var a=Lf.GEOMETRY_RENDERERS_[r[n].getType()];a(t,r[n],s,e)}};Lf.renderLineStringGeometry_=function(t,i,s,e){var r=s.getStroke();if(r){var n=t.getReplay(s.getZIndex(),bf.LINE_STRING);n.setFillStrokeStyle(null,r);n.drawLineString(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),bf.TEXT);a.setTextStyle(h,t.addDeclutter(false));a.drawText(i,e)}};Lf.renderMultiLineStringGeometry_=function(t,i,s,e){var r=s.getStroke();if(r){var n=t.getReplay(s.getZIndex(),bf.LINE_STRING);n.setFillStrokeStyle(null,r);n.drawMultiLineString(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),bf.TEXT);a.setTextStyle(h,t.addDeclutter(false));a.drawText(i,e)}};Lf.renderMultiPolygonGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(n||r){var h=t.getReplay(s.getZIndex(),bf.POLYGON);h.setFillStrokeStyle(r,n);h.drawMultiPolygon(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),bf.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Lf.renderPointGeometry_=function(t,i,s,e){var r=s.getImage();if(r){if(r.getImageState()!=Lo.LOADED){return}var n=t.getReplay(s.getZIndex(),bf.IMAGE);n.setImageStyle(r,t.addDeclutter(false));n.drawPoint(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),bf.TEXT);a.setTextStyle(h,t.addDeclutter(!!r));a.drawText(i,e)}};Lf.renderMultiPointGeometry_=function(t,i,s,e){var r=s.getImage();if(r){if(r.getImageState()!=Lo.LOADED){return}var n=t.getReplay(s.getZIndex(),bf.IMAGE);n.setImageStyle(r,t.addDeclutter(false));n.drawMultiPoint(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),bf.TEXT);a.setTextStyle(h,t.addDeclutter(!!r));a.drawText(i,e)}};Lf.renderPolygonGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(r||n){var h=t.getReplay(s.getZIndex(),bf.POLYGON);h.setFillStrokeStyle(r,n);h.drawPolygon(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),bf.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Lf.GEOMETRY_RENDERERS_={Point:Lf.renderPointGeometry_,LineString:Lf.renderLineStringGeometry_,Polygon:Lf.renderPolygonGeometry_,MultiPoint:Lf.renderMultiPointGeometry_,MultiLineString:Lf.renderMultiLineStringGeometry_,MultiPolygon:Lf.renderMultiPolygonGeometry_,GeometryCollection:Lf.renderGeometryCollectionGeometry_,Circle:Lf.renderCircleGeometry_};var Df=function(t){Ho.call(this,t);this.declutterTree_=t.getDeclutter()?nf(9):null;this.dirty_=false;this.renderedRevision_=-1;this.renderedResolution_=NaN;this.renderedExtent_=qh.createEmpty();this.renderedRenderOrder_=null;this.replayGroup_=null;this.replayGroupChanged=true;this.context=$a.createCanvasContext2D();Ih.listen(Vo.labelCache,Ah.CLEAR,this.handleFontsChanged_,this)};kh.inherits(Df,Ho);Df["handles"]=function(t,i){return t===no.CANVAS&&i.getType()===Fo.VECTOR};Df["create"]=function(t,i){return new Df(i)};Df.prototype.disposeInternal=function(){Ih.unlisten(Vo.labelCache,Ah.CLEAR,this.handleFontsChanged_,this);Ho.prototype.disposeInternal.call(this)};Df.prototype.composeFrame=function(t,i,s){var e=t.extent;var r=t.pixelRatio;var n=i.managed?t.skippedFeatureUids:{};var h=t.viewState;var a=h.projection;var o=h.rotation;var f=a.getExtent();var u=this.getLayer().getSource();var v=this.getTransform(t,0);this.preCompose(s,t,v);var l=i.extent;var c=l!==undefined;if(c){this.clip(s,t,l)}var d=this.replayGroup_;if(d&&!d.isEmpty()){if(this.declutterTree_){this.declutterTree_.clear()}var m=this.getLayer();var p=0;var M=0;var z;var _=i.opacity!==1;var g=m.hasListener(uo.RENDER);if(_||g){var w=s.canvas.width;var y=s.canvas.height;if(o){var b=Math.round(Math.sqrt(w*w+y*y));p=(b-w)/2;M=(b-y)/2;w=y=b}this.context.canvas.width=w;this.context.canvas.height=y;z=this.context}else{z=s}var x=z.globalAlpha;if(!_){z.globalAlpha=i.opacity}if(z!=s){z.translate(p,M)}var k=t.size[0]*r;var E=t.size[1]*r;Vo.rotateAtOffset(z,-o,k/2,E/2);d.replay(z,v,o,n);if(u.getWrapX()&&a.canWrapX()&&!qh.containsExtent(f,e)){var N=e[0];var C=qh.getWidth(f);var I=0;var S;while(N<f[0]){--I;S=C*I;v=this.getTransform(t,S);d.replay(z,v,o,n);N+=C}I=0;N=e[2];while(N>f[2]){++I;S=C*I;v=this.getTransform(t,S);d.replay(z,v,o,n);N-=C}v=this.getTransform(t,0)}Vo.rotateAtOffset(z,o,k/2,E/2);if(z!=s){if(g){this.dispatchRenderEvent(z,t,v)}if(_){var O=s.globalAlpha;s.globalAlpha=i.opacity;s.drawImage(z.canvas,-p,-M);s.globalAlpha=O}else{s.drawImage(z.canvas,-p,-M)}z.translate(-p,-M)}if(!_){z.globalAlpha=x}}if(c){s.restore()}this.postCompose(s,t,i,v)};Df.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(!this.replayGroup_){return undefined}else{var n=i.viewState.resolution;var h=i.viewState.rotation;var a=this.getLayer();var o={};var f=this.replayGroup_.forEachFeatureAtCoordinate(t,n,h,s,{},(function(t){var i=kh.getUid(t).toString();if(!(i in o)){o[i]=true;return e.call(r,t,a)}}),null);return f}};Df.prototype.handleFontsChanged_=function(t){var i=this.getLayer();if(i.getVisible()&&this.replayGroup_){i.changed()}};Df.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};Df.prototype.prepareFrame=function(t,i){var s=this.getLayer();var e=s.getSource();this.updateLogos(t,e);var r=t.viewHints[Ya.ANIMATING];var n=t.viewHints[Ya.INTERACTING];var h=s.getUpdateWhileAnimating();var a=s.getUpdateWhileInteracting();if(!this.dirty_&&(!h&&r)||!a&&n){return true}var o=t.extent;var f=t.viewState;var u=f.projection;var v=f.resolution;var l=t.pixelRatio;var c=s.getRevision();var d=s.getRenderBuffer();var m=s.getRenderOrder();if(m===undefined){m=Lf.defaultOrder}var p=qh.buffer(o,d*v);var M=f.projection.getExtent();if(e.getWrapX()&&f.projection.canWrapX()&&!qh.containsExtent(M,t.extent)){var z=qh.getWidth(M);var _=Math.max(qh.getWidth(p)/2,z);p[0]=M[0]-_;p[2]=M[2]+_}if(!this.dirty_&&this.renderedResolution_==v&&this.renderedRevision_==c&&this.renderedRenderOrder_==m&&qh.containsExtent(this.renderedExtent_,p)){this.replayGroupChanged=false;return true}this.replayGroup_=null;this.dirty_=false;var g=new Pf(Lf.getTolerance(v,l),p,v,l,e.getOverlaps(),this.declutterTree_,s.getRenderBuffer());e.loadFeatures(p,v,u);var w=function(t){var i;var e=t.getStyleFunction();if(e){i=e.call(t,v)}else{e=s.getStyleFunction();if(e){i=e(t,v)}}if(i){var r=this.renderFeature(t,v,l,i,g);this.dirty_=this.dirty_||r}}.bind(this);if(m){var y=[];e.forEachFeatureInExtent(p,(function(t){y.push(t)}),this);y.sort(m);for(var b=0,x=y.length;b<x;++b){w(y[b])}}else{e.forEachFeatureInExtent(p,w,this)}g.finish();this.renderedResolution_=v;this.renderedRevision_=c;this.renderedRenderOrder_=m;this.renderedExtent_=p;this.replayGroup_=g;this.replayGroupChanged=true;return true};Df.prototype.renderFeature=function(t,i,s,e,r){if(!e){return false}var n=false;if(Array.isArray(e)){for(var h=0,a=e.length;h<a;++h){n=Lf.renderFeature(r,t,e[h],Lf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}}else{n=Lf.renderFeature(r,t,e,Lf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)}return n};var Ff={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"};var Gf=function(t){this.context=null;ef.call(this,t);this.declutterTree_=t.getDeclutter()?nf(9):null;this.dirty_=false;this.tmpTransform_=sa.create();this.zDirection=t.getRenderMode()==Ff.VECTOR?1:0;Ih.listen(Vo.labelCache,Ah.CLEAR,this.handleFontsChanged_,this)};kh.inherits(Gf,ef);Gf["handles"]=function(t,i){return t===no.CANVAS&&i.getType()===Fo.VECTOR_TILE};Gf["create"]=function(t,i){return new Gf(i)};Gf.IMAGE_REPLAYS={image:[bf.POLYGON,bf.CIRCLE,bf.LINE_STRING,bf.IMAGE,bf.TEXT],hybrid:[bf.POLYGON,bf.LINE_STRING]};Gf.VECTOR_REPLAYS={image:[bf.DEFAULT],hybrid:[bf.IMAGE,bf.TEXT,bf.DEFAULT],vector:Nf.ORDER};Gf.prototype.disposeInternal=function(){Ih.unlisten(Vo.labelCache,Ah.CLEAR,this.handleFontsChanged_,this);ef.prototype.disposeInternal.call(this)};Gf.prototype.prepareFrame=function(t,i){var s=this.getLayer();var e=s.getRevision();if(this.renderedLayerRevision_!=e){this.renderedTiles.length=0;var r=s.getRenderMode();if(!this.context&&r!=Ff.VECTOR){this.context=$a.createCanvasContext2D()}if(this.context&&r==Ff.VECTOR){this.context=null}}this.renderedLayerRevision_=e;return ef.prototype.prepareFrame.apply(this,arguments)};Gf.prototype.createReplayGroup_=function(t,i){var s=this.getLayer();var e=i.pixelRatio;var r=i.viewState.projection;var n=s.getRevision();var h=s.getRenderOrder()||null;var a=t.getReplayState(s);if(!a.dirty&&a.renderedRevision==n&&a.renderedRenderOrder==h){return}var o=s.getSource();var f=o.getTileGrid();var u=o.getTileGridForProjection(r);var v=u.getResolution(t.tileCoord[0]);var l=u.getTileCoordExtent(t.wrappedTileCoord);var c={};for(var d=0,m=t.tileKeys.length;d<m;++d){var p=t.getTile(t.tileKeys[d]);if(p.getState()==Wa.ERROR){continue}var M=p.tileCoord;var z=f.getTileCoordExtent(M);var _=qh.getIntersection(l,z);var g=qh.equals(z,_)?null:qh.buffer(_,s.getRenderBuffer()*v);var w=p.getProjection();var y=false;if(!ia.equivalent(r,w)){y=true;p.setProjection(r)}a.dirty=false;var b=new Pf(0,_,v,e,o.getOverlaps(),this.declutterTree_,s.getRenderBuffer());var x=Lf.getSquaredTolerance(v,e);var k=function(t){var i;var e=t.getStyleFunction();if(e){i=e.call(t,v)}else{e=s.getStyleFunction();if(e){i=e(t,v)}}if(i){var r=this.renderFeature(t,x,i,b);this.dirty_=this.dirty_||r;a.dirty=a.dirty||r}};var E=p.getFeatures();if(h&&h!==a.renderedRenderOrder){E.sort(h)}var N;for(var C=0,I=E.length;C<I;++C){N=E[C];if(y){if(w.getUnits()==Hh.TILE_PIXELS){w.setWorldExtent(z);w.setExtent(p.getExtent())}N.getGeometry().transform(w,r)}if(!g||qh.intersects(g,N.getGeometry().getExtent())){k.call(this,N)}}b.finish();for(var S in b.getReplays()){c[S]=true}p.setReplayGroup(s,t.tileCoord.toString(),b)}a.renderedRevision=n;a.renderedRenderOrder=h};Gf.prototype.drawTileImage=function(t,i,s,e,r,n,h,a,o){var f=t;this.createReplayGroup_(f,i);if(this.context){this.renderTileImage_(f,i,s);ef.prototype.drawTileImage.apply(this,arguments)}};Gf.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=i.viewState.resolution;var h=i.viewState.rotation;s=s==undefined?0:s;var a=this.getLayer();var o={};var f=this.renderedTiles;var u=a.getSource();var v=u.getTileGridForProjection(i.viewState.projection);var l,c;var d,m,p;var M,z,_;for(d=0,m=f.length;d<m;++d){M=f[d];z=M.wrappedTileCoord;_=v.getTileCoordExtent(z,this.tmpExtent);l=qh.buffer(_,s*n,l);if(!qh.containsCoordinate(l,t)){continue}for(var g=0,w=M.tileKeys.length;g<w;++g){var y=M.getTile(M.tileKeys[g]);if(y.getState()==Wa.ERROR){continue}p=y.getReplayGroup(a,M.tileCoord.toString());c=c||p.forEachFeatureAtCoordinate(t,n,h,s,{},(function(t){var i=kh.getUid(t).toString();if(!(i in o)){o[i]=true;return e.call(r,t,a)}}),null)}}return c};Gf.prototype.getReplayTransform_=function(t,i){var s=this.getLayer();var e=s.getSource();var r=e.getTileGrid();var n=t.tileCoord;var h=r.getResolution(n[0]);var a=i.viewState;var o=i.pixelRatio;var f=a.resolution/o;var u=r.getTileCoordExtent(n,this.tmpExtent);var v=a.center;var l=qh.getTopLeft(u);var c=i.size;var d=Math.round(o*c[0]/2);var m=Math.round(o*c[1]/2);return sa.compose(this.tmpTransform_,d,m,h/f,h/f,a.rotation,(l[0]-v[0])/h,(v[1]-l[1])/h)};Gf.prototype.handleFontsChanged_=function(t){var i=this.getLayer();if(i.getVisible()&&this.renderedLayerRevision_!==undefined){i.changed()}};Gf.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};Gf.prototype.postCompose=function(t,i,s){var e=this.getLayer();var r=e.getDeclutter()?{}:null;var n=e.getSource();var h=e.getRenderMode();var a=Gf.VECTOR_REPLAYS[h];var o=i.pixelRatio;var f=i.viewState.rotation;var u=i.size;var v,l;if(f){v=Math.round(o*u[0]/2);l=Math.round(o*u[1]/2);Vo.rotateAtOffset(t,-f,v,l)}if(r){this.declutterTree_.clear()}var c=this.renderedTiles;var d=n.getTileGridForProjection(i.viewState.projection);var m=[];var p=[];for(var M=c.length-1;M>=0;--M){var z=c[M];if(z.getState()==Wa.ABORT){continue}var _=z.tileCoord;var g=d.getTileCoordExtent(_)[0]-d.getTileCoordExtent(z.wrappedTileCoord)[0];var w=undefined;for(var y=0,b=z.tileKeys.length;y<b;++y){var x=z.getTile(z.tileKeys[y]);if(x.getState()==Wa.ERROR){continue}var k=x.getReplayGroup(e,_.toString());if(h!=Ff.VECTOR&&!k.hasReplays(a)){continue}if(!w){w=this.getTransform(i,g)}var E=x.tileCoord[0];var N=k.getClipCoords(w);t.save();t.globalAlpha=s.opacity;for(var C=0,I=m.length;C<I;++C){var S=m[C];if(E<p[C]){t.beginPath();t.moveTo(N[0],N[1]);t.lineTo(N[2],N[3]);t.lineTo(N[4],N[5]);t.lineTo(N[6],N[7]);t.moveTo(S[6],S[7]);t.lineTo(S[4],S[5]);t.lineTo(S[2],S[3]);t.lineTo(S[0],S[1]);t.clip()}}k.replay(t,w,f,{},a,r);t.restore();m.push(N);p.push(E)}}if(r){Pf.replayDeclutter(r,t,f)}if(f){Vo.rotateAtOffset(t,f,v,l)}ef.prototype.postCompose.apply(this,arguments)};Gf.prototype.renderFeature=function(t,i,s,e){if(!s){return false}var r=false;if(Array.isArray(s)){for(var n=0,h=s.length;n<h;++n){r=Lf.renderFeature(e,t,s[n],i,this.handleStyleImageChange_,this)||r}}else{r=Lf.renderFeature(e,t,s,i,this.handleStyleImageChange_,this)}return r};Gf.prototype.renderTileImage_=function(t,i,s){var e=this.getLayer();var r=t.getReplayState(e);var n=e.getRevision();var h=Gf.IMAGE_REPLAYS[e.getRenderMode()];if(h&&r.renderedTileRevision!==n){r.renderedTileRevision=n;var a=t.wrappedTileCoord;var o=a[0];var f=i.pixelRatio;var u=e.getSource();var v=u.getTileGridForProjection(i.viewState.projection);var l=v.getResolution(o);var c=t.getContext(e);var d=u.getTilePixelSize(o,f,i.viewState.projection);c.canvas.width=d[0];c.canvas.height=d[1];var m=v.getTileCoordExtent(a);for(var p=0,M=t.tileKeys.length;p<M;++p){var z=t.getTile(t.tileKeys[p]);if(z.getState()==Wa.ERROR){continue}var _=f/l;var g=sa.reset(this.tmpTransform_);sa.scale(g,_,-_);sa.translate(g,-m[0],-m[3]);var w=z.getReplayGroup(e,t.tileCoord.toString());w.replay(c,g,0,{},h)}}};var Wf=function(t){this.source_=t};Wf.prototype.getType=function(){};Wf.prototype.getSource=function(){return this.source_};Wf.prototype.isAnimated=Yh.FALSE;var jf=function(t){Wf.call(this,t)};kh.inherits(jf,Wf);jf.prototype.getType=function(){return _a.FRAGMENT_SHADER};var Vf=function(t){Wf.call(this,t)};kh.inherits(Vf,Wf);Vf.prototype.getType=function(){return _a.VERTEX_SHADER};var Uf={};Uf.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n":"precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(dist<radius-c){gl_FragColor.a=gl_FragColor.a-(radius-c-dist);}} else{gl_FragColor=n;float strokeDist=radius-c;float antialias=2.0*d;if(dist>strokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}");Uf.vertex=new Vf(kh.DEBUG_WEBGL?"varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n":"varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;//Until we get gl_VertexID in WebGL,we store an instruction.if(f==0.0){//Offsetting the edges of the triangle by lineWidth/2 is necessary,however//we should also leave some space for the antialiasing,thus we offset by lineWidth.offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}");var qf=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_lineWidth=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_lineWidth":"k");this.u_pixelRatio=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_pixelRatio":"l");this.u_opacity=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_opacity":"m");this.u_fillColor=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_fillColor":"n");this.u_strokeColor=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_strokeColor":"o");this.u_size=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_size":"p");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"e");this.a_instruction=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_instruction":"f");this.a_radius=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_radius":"g")};var Xf={};Xf.create=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]};Xf.fromTransform=function(t,i){t[0]=i[0];t[1]=i[1];t[4]=i[2];t[5]=i[3];t[12]=i[4];t[13]=i[5];return t};var Yf=function(t,i){Xo.call(this);this.tolerance=t;this.maxExtent=i;this.origin=qh.getCenter(i);this.projectionMatrix_=sa.create();this.offsetRotateMatrix_=sa.create();this.offsetScaleMatrix_=sa.create();this.tmpMat4_=Xf.create();this.indices=[];this.indicesBuffer=null;this.startIndices=[];this.startIndicesFeature=[];this.vertices=[];this.verticesBuffer=null;this.lineStringReplay=undefined};kh.inherits(Yf,Xo);Yf.prototype.getDeleteResourcesFunction=function(t){};Yf.prototype.finish=function(t){};Yf.prototype.setUpProgram=function(t,i,s,e){};Yf.prototype.shutDownProgram=function(t,i){};Yf.prototype.drawReplay=function(t,i,s,e){};Yf.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){};Yf.prototype.drawHitDetectionReplay=function(t,i,s,e,r,n){if(!r){return this.drawHitDetectionReplayAll(t,i,s,e)}else{return this.drawHitDetectionReplayOneByOne(t,i,s,e,n)}};Yf.prototype.drawHitDetectionReplayAll=function(t,i,s,e){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawReplay(t,i,s,true);var r=e(null);if(r){return r}else{return undefined}};Yf.prototype.replay=function(t,i,s,e,r,n,h,a,o,f,u){var v=t.getGL();var l,c,d,m,p,M,z,_;if(this.lineStringReplay){l=v.isEnabled(v.STENCIL_TEST);c=v.getParameter(v.STENCIL_FUNC);d=v.getParameter(v.STENCIL_VALUE_MASK);m=v.getParameter(v.STENCIL_REF);p=v.getParameter(v.STENCIL_WRITEMASK);M=v.getParameter(v.STENCIL_FAIL);z=v.getParameter(v.STENCIL_PASS_DEPTH_PASS);_=v.getParameter(v.STENCIL_PASS_DEPTH_FAIL);v.enable(v.STENCIL_TEST);v.clear(v.STENCIL_BUFFER_BIT);v.stencilMask(255);v.stencilFunc(v.ALWAYS,1,255);v.stencilOp(v.KEEP,v.KEEP,v.REPLACE);this.lineStringReplay.replay(t,i,s,e,r,n,h,a,o,f,u);v.stencilMask(0);v.stencilFunc(v.NOTEQUAL,1,255)}t.bindBuffer(_a.ARRAY_BUFFER,this.verticesBuffer);t.bindBuffer(_a.ELEMENT_ARRAY_BUFFER,this.indicesBuffer);var g=this.setUpProgram(v,t,r,n);var w=sa.reset(this.projectionMatrix_);sa.scale(w,2/(s*r[0]),2/(s*r[1]));sa.rotate(w,-e);sa.translate(w,-(i[0]-this.origin[0]),-(i[1]-this.origin[1]));var y=sa.reset(this.offsetScaleMatrix_);sa.scale(y,2/r[0],2/r[1]);var b=sa.reset(this.offsetRotateMatrix_);if(e!==0){sa.rotate(b,-e)}v.uniformMatrix4fv(g.u_projectionMatrix,false,Xf.fromTransform(this.tmpMat4_,w));v.uniformMatrix4fv(g.u_offsetScaleMatrix,false,Xf.fromTransform(this.tmpMat4_,y));v.uniformMatrix4fv(g.u_offsetRotateMatrix,false,Xf.fromTransform(this.tmpMat4_,b));v.uniform1f(g.u_opacity,h);var x;if(o===undefined){this.drawReplay(v,t,a,false)}else{x=this.drawHitDetectionReplay(v,t,a,o,f,u)}this.shutDownProgram(v,g);if(this.lineStringReplay){if(!l){v.disable(v.STENCIL_TEST)}v.clear(v.STENCIL_BUFFER_BIT);v.stencilFunc(c,m,d);v.stencilMask(p);v.stencilOp(M,_,z)}return x};Yf.prototype.drawElements=function(t,i,s,e){var r=i.hasOESElementIndexUint?_a.UNSIGNED_INT:_a.UNSIGNED_SHORT;var n=i.hasOESElementIndexUint?4:2;var h=e-s;var a=s*n;t.drawElements(_a.TRIANGLES,h,r,a)};var Bf={};Bf.defaultFont="10px sans-serif";Bf.defaultFillStyle=[0,0,0,1];Bf.defaultLineCap="round";Bf.defaultLineDash=[];Bf.defaultLineDashOffset=0;Bf.defaultLineJoin="round";Bf.defaultMiterLimit=10;Bf.defaultStrokeStyle=[0,0,0,1];Bf.defaultTextAlign=.5;Bf.defaultTextBaseline=.5;Bf.defaultLineWidth=1;Bf.triangleIsCounterClockwise=function(t,i,s,e,r,n){var h=(s-t)*(n-i)-(r-t)*(e-i);return h<=Bf.EPSILON&&h>=-Bf.EPSILON?undefined:h>0};Bf.EPSILON=Number.EPSILON||2220446049250313e-31;var Hf=function(t,i){this.arr_=t!==undefined?t:[];this.usage_=i!==undefined?i:Hf.Usage_.STATIC_DRAW};Hf.prototype.getArray=function(){return this.arr_};Hf.prototype.getUsage=function(){return this.usage_};Hf.Usage_={STATIC_DRAW:_a.STATIC_DRAW,STREAM_DRAW:_a.STREAM_DRAW,DYNAMIC_DRAW:_a.DYNAMIC_DRAW};var Jf=function(t,i){Yf.call(this,t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.radius_=0;this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:undefined,lineWidth:undefined,changed:false}};kh.inherits(Jf,Yf);Jf.prototype.drawCoordinates_=function(t,i,s,e){var r=this.vertices.length;var n=this.indices.length;var h=r/4;var a,o;for(a=i,o=s;a<o;a+=e){this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=0;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=1;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=2;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=3;this.vertices[r++]=this.radius_;this.indices[n++]=h;this.indices[n++]=h+1;this.indices[n++]=h+2;this.indices[n++]=h+2;this.indices[n++]=h+3;this.indices[n++]=h;h+=4}};Jf.prototype.drawCircle=function(t,i){var s=t.getRadius();var e=t.getStride();if(s){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.radius_=s;var r=t.getFlatCoordinates();r=Bh.translate(r,0,2,e,-this.origin[0],-this.origin[1]);this.drawCoordinates_(r,0,2,e)}else{if(this.state_.changed){this.styles_.pop();if(this.styles_.length){var n=this.styles_[this.styles_.length-1];this.state_.fillColor=n[0];this.state_.strokeColor=n[1];this.state_.lineWidth=n[2];this.state_.changed=false}}}};Jf.prototype.finish=function(t){this.verticesBuffer=new Hf(this.vertices);this.indicesBuffer=new Hf(this.indices);this.startIndices.push(this.indices.length);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};Jf.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;return function(){t.deleteBuffer(i);t.deleteBuffer(s)}};Jf.prototype.setUpProgram=function(t,i,s,e){var r,n;r=Uf.fragment;n=Uf.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new qf(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,_a.FLOAT,false,16,0);t.enableVertexAttribArray(a.a_instruction);t.vertexAttribPointer(a.a_instruction,1,_a.FLOAT,false,16,8);t.enableVertexAttribArray(a.a_radius);t.vertexAttribPointer(a.a_radius,1,_a.FLOAT,false,16,12);t.uniform2fv(a.u_size,s);t.uniform1f(a.u_pixelRatio,e);return a};Jf.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_instruction);t.disableVertexAttribArray(i.a_radius)};Jf.prototype.drawReplay=function(t,i,s,e){if(!Ch.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var r,n,h,a;h=this.startIndices[this.startIndices.length-1];for(r=this.styleIndices_.length-1;r>=0;--r){n=this.styleIndices_[r];a=this.styles_[r];this.setFillStyle_(t,a[0]);this.setStrokeStyle_(t,a[1],a[2]);this.drawElements(t,i,n,h);h=n}}};Jf.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,v,l;l=this.startIndices.length-2;a=this.startIndices[l+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setFillStyle_(t,o[0]);this.setStrokeStyle_(t,o[1],o[2]);f=this.styleIndices_[n];while(l>=0&&this.startIndices[l]>=f){h=this.startIndices[l];u=this.startIndicesFeature[l];v=kh.getUid(u).toString();if(s[v]===undefined&&u.getGeometry()&&(r===undefined||qh.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}l--;a=h}}return undefined};Jf.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,v;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setFillStyle_(t,h[0]);this.setStrokeStyle_(t,h[1],h[2]);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){v=this.startIndices[u];o=this.startIndicesFeature[u];f=kh.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n)}n=v}u--;r=v}if(r!==n){this.drawElements(t,i,r,n)}r=n=a}};Jf.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_fillColor,i)};Jf.prototype.setStrokeStyle_=function(t,i,s){t.uniform4fv(this.defaultLocations_.u_strokeColor,i);t.uniform1f(this.defaultLocations_.u_lineWidth,s)};Jf.prototype.setFillStrokeStyle=function(t,i){var s,e;if(i){var r=i.getLineDash();this.state_.lineDash=r?r:Bf.defaultLineDash;var n=i.getLineDashOffset();this.state_.lineDashOffset=n?n:Bf.defaultLineDashOffset;s=i.getColor();if(!(s instanceof CanvasGradient)&&!(s instanceof CanvasPattern)){s=Uo.asArray(s).map((function(t,i){return i!=3?t/255:t}))||Bf.defaultStrokeStyle}else{s=Bf.defaultStrokeStyle}e=i.getWidth();e=e!==undefined?e:Bf.defaultLineWidth}else{s=[0,0,0,0];e=0}var h=t?t.getColor():[0,0,0,0];if(!(h instanceof CanvasGradient)&&!(h instanceof CanvasPattern)){h=Uo.asArray(h).map((function(t,i){return i!=3?t/255:t}))||Bf.defaultFillStyle}else{h=Bf.defaultFillStyle}if(!this.state_.strokeColor||!jh.equals(this.state_.strokeColor,s)||!this.state_.fillColor||!jh.equals(this.state_.fillColor,h)||this.state_.lineWidth!==e){this.state_.changed=true;this.state_.fillColor=h;this.state_.strokeColor=s;this.state_.lineWidth=e;this.styles_.push([h,s,e])}};var Zf={};Zf.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");Zf.vertex=new Vf(kh.DEBUG_WEBGL?"varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n":"varying vec2 a;varying float b;attribute vec2 c;attribute vec2 d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;void main(void){mat4 offsetMatrix=i;if(g==1.0){offsetMatrix=i*j;}vec4 offsets=offsetMatrix*vec4(e,0.0,0.0);gl_Position=h*vec4(c,0.0,1.0)+offsets;a=d;b=f;}");var Kf=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_opacity=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_opacity":"k");this.u_image=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_image":"l");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"c");this.a_texCoord=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_texCoord":"d");this.a_offsets=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_offsets":"e");this.a_opacity=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_opacity":"f");this.a_rotateWithView=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_rotateWithView":"g")};var $f={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};var Qf=function(t,i){this.canvas_=t;this.gl_=i;this.bufferCache_={};this.shaderCache_={};this.programCache_={};this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null;this.hasOESElementIndexUint=jh.includes(kh.WEBGL_EXTENSIONS,"OES_element_index_uint");if(this.hasOESElementIndexUint){i.getExtension("OES_element_index_uint")}Ih.listen(this.canvas_,$f.LOST,this.handleWebGLContextLost,this);Ih.listen(this.canvas_,$f.RESTORED,this.handleWebGLContextRestored,this)};kh.inherits(Qf,Sh);Qf.prototype.bindBuffer=function(t,i){var s=this.getGL();var e=i.getArray();var r=String(kh.getUid(i));if(r in this.bufferCache_){var n=this.bufferCache_[r];s.bindBuffer(t,n.buffer)}else{var h=s.createBuffer();s.bindBuffer(t,h);var a;if(t==_a.ARRAY_BUFFER){a=new Float32Array(e)}else if(t==_a.ELEMENT_ARRAY_BUFFER){a=this.hasOESElementIndexUint?new Uint32Array(e):new Uint16Array(e)}s.bufferData(t,a,i.getUsage());this.bufferCache_[r]={buf:i,buffer:h}}};Qf.prototype.deleteBuffer=function(t){var i=this.getGL();var s=String(kh.getUid(t));var e=this.bufferCache_[s];if(!i.isContextLost()){i.deleteBuffer(e.buffer)}delete this.bufferCache_[s]};Qf.prototype.disposeInternal=function(){Ih.unlistenAll(this.canvas_);var t=this.getGL();if(!t.isContextLost()){var i;for(i in this.bufferCache_){t.deleteBuffer(this.bufferCache_[i].buffer)}for(i in this.programCache_){t.deleteProgram(this.programCache_[i])}for(i in this.shaderCache_){t.deleteShader(this.shaderCache_[i])}t.deleteFramebuffer(this.hitDetectionFramebuffer_);t.deleteRenderbuffer(this.hitDetectionRenderbuffer_);t.deleteTexture(this.hitDetectionTexture_)}};Qf.prototype.getCanvas=function(){return this.canvas_};Qf.prototype.getGL=function(){return this.gl_};Qf.prototype.getHitDetectionFramebuffer=function(){if(!this.hitDetectionFramebuffer_){this.initHitDetectionFramebuffer_()}return this.hitDetectionFramebuffer_};Qf.prototype.getShader=function(t){var i=String(kh.getUid(t));if(i in this.shaderCache_){return this.shaderCache_[i]}else{var s=this.getGL();var e=s.createShader(t.getType());s.shaderSource(e,t.getSource());s.compileShader(e);this.shaderCache_[i]=e;return e}};Qf.prototype.getProgram=function(t,i){var s=kh.getUid(t)+"/"+kh.getUid(i);if(s in this.programCache_){return this.programCache_[s]}else{var e=this.getGL();var r=e.createProgram();e.attachShader(r,this.getShader(t));e.attachShader(r,this.getShader(i));e.linkProgram(r);this.programCache_[s]=r;return r}};Qf.prototype.handleWebGLContextLost=function(){Ch.clear(this.bufferCache_);Ch.clear(this.shaderCache_);Ch.clear(this.programCache_);this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null};Qf.prototype.handleWebGLContextRestored=function(){};Qf.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_;var i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i);var s=Qf.createEmptyTexture(t,1,1);var e=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,e);t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1);t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e);t.bindTexture(t.TEXTURE_2D,null);t.bindRenderbuffer(t.RENDERBUFFER,null);t.bindFramebuffer(t.FRAMEBUFFER,null);this.hitDetectionFramebuffer_=i;this.hitDetectionTexture_=s;this.hitDetectionRenderbuffer_=e};Qf.prototype.useProgram=function(t){if(t==this.currentProgram_){return false}else{var i=this.getGL();i.useProgram(t);this.currentProgram_=t;return true}};Qf.createTexture_=function(t,i,s){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR);if(i!==undefined){t.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_WRAP_S,i)}if(s!==undefined){t.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_WRAP_T,s)}return e};Qf.createEmptyTexture=function(t,i,s,e,r){var n=Qf.createTexture_(t,e,r);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,i,s,0,t.RGBA,t.UNSIGNED_BYTE,null);return n};Qf.createTexture=function(t,i,s,e){var r=Qf.createTexture_(t,s,e);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i);return r};var tu=function(t,i){Yf.call(this,t,i);this.anchorX=undefined;this.anchorY=undefined;this.groupIndices=[];this.hitDetectionGroupIndices=[];this.height=undefined;this.imageHeight=undefined;this.imageWidth=undefined;this.defaultLocations=null;this.opacity=undefined;this.originX=undefined;this.originY=undefined;this.rotateWithView=undefined;this.rotation=undefined;this.scale=undefined;this.width=undefined};kh.inherits(tu,Yf);tu.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;var e=this.getTextures(true);var r=t.getGL();return function(){if(!r.isContextLost()){var n,h;for(n=0,h=e.length;n<h;++n){r.deleteTexture(e[n])}}t.deleteBuffer(i);t.deleteBuffer(s)}};tu.prototype.drawCoordinates=function(t,i,s,e){var r=this.anchorX;var n=this.anchorY;var h=this.height;var a=this.imageHeight;var o=this.imageWidth;var f=this.opacity;var u=this.originX;var v=this.originY;var l=this.rotateWithView?1:0;var c=-this.rotation;var d=this.scale;var m=this.width;var p=Math.cos(c);var M=Math.sin(c);var z=this.indices.length;var _=this.vertices.length;var g,w,y,b,x,k;for(g=i;g<s;g+=e){x=t[g]-this.origin[0];k=t[g+1]-this.origin[1];w=_/8;y=-d*r;b=-d*(h-n);this.vertices[_++]=x;this.vertices[_++]=k;this.vertices[_++]=y*p-b*M;this.vertices[_++]=y*M+b*p;this.vertices[_++]=u/o;this.vertices[_++]=(v+h)/a;this.vertices[_++]=f;this.vertices[_++]=l;y=d*(m-r);b=-d*(h-n);this.vertices[_++]=x;this.vertices[_++]=k;this.vertices[_++]=y*p-b*M;this.vertices[_++]=y*M+b*p;this.vertices[_++]=(u+m)/o;this.vertices[_++]=(v+h)/a;this.vertices[_++]=f;this.vertices[_++]=l;y=d*(m-r);b=d*n;this.vertices[_++]=x;this.vertices[_++]=k;this.vertices[_++]=y*p-b*M;this.vertices[_++]=y*M+b*p;this.vertices[_++]=(u+m)/o;this.vertices[_++]=v/a;this.vertices[_++]=f;this.vertices[_++]=l;y=-d*r;b=d*n;this.vertices[_++]=x;this.vertices[_++]=k;this.vertices[_++]=y*p-b*M;this.vertices[_++]=y*M+b*p;this.vertices[_++]=u/o;this.vertices[_++]=v/a;this.vertices[_++]=f;this.vertices[_++]=l;this.indices[z++]=w;this.indices[z++]=w+1;this.indices[z++]=w+2;this.indices[z++]=w;this.indices[z++]=w+2;this.indices[z++]=w+3}return _};tu.prototype.createTextures=function(t,i,s,e){var r,n,h,a;var o=i.length;for(a=0;a<o;++a){n=i[a];h=kh.getUid(n).toString();if(h in s){r=s[h]}else{r=Qf.createTexture(e,n,_a.CLAMP_TO_EDGE,_a.CLAMP_TO_EDGE);s[h]=r}t[a]=r}};tu.prototype.setUpProgram=function(t,i,s,e){var r=Zf.fragment;var n=Zf.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations){a=new Kf(t,h);this.defaultLocations=a}else{a=this.defaultLocations}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,_a.FLOAT,false,32,0);t.enableVertexAttribArray(a.a_offsets);t.vertexAttribPointer(a.a_offsets,2,_a.FLOAT,false,32,8);t.enableVertexAttribArray(a.a_texCoord);t.vertexAttribPointer(a.a_texCoord,2,_a.FLOAT,false,32,16);t.enableVertexAttribArray(a.a_opacity);t.vertexAttribPointer(a.a_opacity,1,_a.FLOAT,false,32,24);t.enableVertexAttribArray(a.a_rotateWithView);t.vertexAttribPointer(a.a_rotateWithView,1,_a.FLOAT,false,32,28);return a};tu.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_offsets);t.disableVertexAttribArray(i.a_texCoord);t.disableVertexAttribArray(i.a_opacity);t.disableVertexAttribArray(i.a_rotateWithView)};tu.prototype.drawReplay=function(t,i,s,e){var r=e?this.getHitDetectionTextures():this.getTextures();var n=e?this.hitDetectionGroupIndices:this.groupIndices;if(!Ch.isEmpty(s)){this.drawReplaySkipping(t,i,s,r,n)}else{var h,a,o;for(h=0,a=r.length,o=0;h<a;++h){t.bindTexture(_a.TEXTURE_2D,r[h]);var f=n[h];this.drawElements(t,i,o,f);o=f}}};tu.prototype.drawReplaySkipping=function(t,i,s,e,r){var n=0;var h,a;for(h=0,a=e.length;h<a;++h){t.bindTexture(_a.TEXTURE_2D,e[h]);var o=h>0?r[h-1]:0;var f=r[h];var u=o;var v=o;while(n<this.startIndices.length&&this.startIndices[n]<=f){var l=this.startIndicesFeature[n];var c=kh.getUid(l).toString();if(s[c]!==undefined){if(u!==v){this.drawElements(t,i,u,v)}u=n===this.startIndices.length-1?f:this.startIndices[n+1];v=u}else{v=n===this.startIndices.length-1?f:this.startIndices[n+1]}n++}if(u!==v){this.drawElements(t,i,u,v)}}};tu.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u;var v=this.startIndices.length-1;var l=this.getHitDetectionTextures();for(n=l.length-1;n>=0;--n){t.bindTexture(_a.TEXTURE_2D,l[n]);h=n>0?this.hitDetectionGroupIndices[n-1]:0;o=this.hitDetectionGroupIndices[n];while(v>=0&&this.startIndices[v]>=h){a=this.startIndices[v];f=this.startIndicesFeature[v];u=kh.getUid(f).toString();if(s[u]===undefined&&f.getGeometry()&&(r===undefined||qh.intersects(r,f.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,a,o);var c=e(f);if(c){return c}}o=a;v--}}return undefined};tu.prototype.finish=function(t){this.anchorX=undefined;this.anchorY=undefined;this.height=undefined;this.imageHeight=undefined;this.imageWidth=undefined;this.indices=null;this.opacity=undefined;this.originX=undefined;this.originY=undefined;this.rotateWithView=undefined;this.rotation=undefined;this.scale=undefined;this.vertices=null;this.width=undefined};tu.prototype.getTextures=function(t){};tu.prototype.getHitDetectionTextures=function(){};var iu=function(t,i){tu.call(this,t,i);this.images_=[];this.hitDetectionImages_=[];this.textures_=[];this.hitDetectionTextures_=[]};kh.inherits(iu,tu);iu.prototype.drawMultiPoint=function(t,i){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var s=t.getFlatCoordinates();var e=t.getStride();this.drawCoordinates(s,0,s.length,e)};iu.prototype.drawPoint=function(t,i){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var s=t.getFlatCoordinates();var e=t.getStride();this.drawCoordinates(s,0,s.length,e)};iu.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices.push(this.indices.length);this.verticesBuffer=new Hf(this.vertices);var s=this.indices;this.indicesBuffer=new Hf(s);var e={};this.createTextures(this.textures_,this.images_,e,i);this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,e,i);this.images_=null;this.hitDetectionImages_=null;tu.prototype.finish.call(this,t)};iu.prototype.setImageStyle=function(t){var i=t.getAnchor();var s=t.getImage(1);var e=t.getImageSize();var r=t.getHitDetectionImage(1);var n=t.getOpacity();var h=t.getOrigin();var a=t.getRotateWithView();var o=t.getRotation();var f=t.getSize();var u=t.getScale();var v;if(this.images_.length===0){this.images_.push(s)}else{v=this.images_[this.images_.length-1];if(kh.getUid(v)!=kh.getUid(s)){this.groupIndices.push(this.indices.length);this.images_.push(s)}}if(this.hitDetectionImages_.length===0){this.hitDetectionImages_.push(r)}else{v=this.hitDetectionImages_[this.hitDetectionImages_.length-1];if(kh.getUid(v)!=kh.getUid(r)){this.hitDetectionGroupIndices.push(this.indices.length);this.hitDetectionImages_.push(r)}}this.anchorX=i[0];this.anchorY=i[1];this.height=f[1];this.imageHeight=e[1];this.imageWidth=e[0];this.opacity=n;this.originX=h[0];this.originY=h[1];this.rotation=o;this.rotateWithView=a;this.scale=u;this.width=f[0]};iu.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_};iu.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_};var su={};su.lineStringIsClosed=function(t,i,s,e){var r=s-e;if(t[i]===t[r]&&t[i+1]===t[r+1]&&(s-i)/e>3){return!!na.linearRing(t,i,s,e)}return false};var eu={};eu.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying float a;varying vec2 aVertex;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((aVertex.x+1.0)/2.0*o.x*p,(aVertex.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");eu.vertex=new Vf(kh.DEBUG_WEBGL?"varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n":"varying float a;varying vec2 aVertex;varying float c;attribute vec2 d;attribute vec2 e;attribute vec2 f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;bool nearlyEquals(in float value,in float ref){float epsilon=0.000000000001;return value>=ref-epsilon&&value<=ref+epsilon;}void alongNormal(out vec2 offset,in vec2 nextP,in float turnDir,in float direction){vec2 dirVect=nextP-e;vec2 normal=normalize(vec2(-turnDir*dirVect.y,turnDir*dirVect.x));offset=k/2.0*normal*direction;}void miterUp(out vec2 offset,out float round,in bool isRound,in float direction){float halfWidth=k/2.0;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=f-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;round=0.0;if(isRound){round=1.0;}else if(miterLength>l+k){offset=halfWidth*tmpNormal*direction;}} bool miterDown(out vec2 offset,in vec4 projPos,in mat4 offsetMatrix,in float direction){bool degenerate=false;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=d-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));vec2 longOffset,shortOffset,longVertex;vec4 shortProjVertex;float halfWidth=k/2.0;if(length(f-e)>length(d-e)){longOffset=tmpNormal*direction*halfWidth;shortOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=f;shortProjVertex=h*vec4(d,0.0,1.0);}else{shortOffset=tmpNormal*direction*halfWidth;longOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=d;shortProjVertex=h*vec4(f,0.0,1.0);}vec4 p1=h*vec4(longVertex,0.0,1.0)+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p2=projPos+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p3=shortProjVertex+offsetMatrix*vec4(-shortOffset,0.0,0.0);vec4 p4=shortProjVertex+offsetMatrix*vec4(shortOffset,0.0,0.0);float denom=(p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y);float firstU=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/denom;float secondU=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/denom;float epsilon=0.000000000001;if(firstU>epsilon&&firstU<1.0-epsilon&&secondU>epsilon&&secondU<1.0-epsilon){shortProjVertex.x=p1.x+firstU*(p2.x-p1.x);shortProjVertex.y=p1.y+firstU*(p2.y-p1.y);offset=shortProjVertex.xy;degenerate=true;}else{float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;}return degenerate;}void squareCap(out vec2 offset,out float round,in bool isRound,in vec2 nextP,in float turnDir,in float direction){round=0.0;vec2 dirVect=e-nextP;vec2 firstNormal=normalize(dirVect);vec2 secondNormal=vec2(turnDir*firstNormal.y*direction,-turnDir*firstNormal.x*direction);vec2 hypotenuse=normalize(firstNormal-secondNormal);vec2 normal=vec2(turnDir*hypotenuse.y*direction,-turnDir*hypotenuse.x*direction);float length=sqrt(c*c*2.0);offset=normal*length;if(isRound){round=1.0;}} void main(void){bool degenerate=false;float direction=float(sign(g));mat4 offsetMatrix=i*j;vec2 offset;vec4 projPos=h*vec4(e,0.0,1.0);bool round=nearlyEquals(mod(g,2.0),0.0);a=0.0;c=k/2.0;aVertex=projPos.xy;if(nearlyEquals(mod(g,3.0),0.0)||nearlyEquals(mod(g,17.0),0.0)){alongNormal(offset,f,1.0,direction);}else if(nearlyEquals(mod(g,5.0),0.0)||nearlyEquals(mod(g,13.0),0.0)){alongNormal(offset,d,-1.0,direction);}else if(nearlyEquals(mod(g,23.0),0.0)){miterUp(offset,a,round,direction);}else if(nearlyEquals(mod(g,19.0),0.0)){degenerate=miterDown(offset,projPos,offsetMatrix,direction);}else if(nearlyEquals(mod(g,7.0),0.0)){squareCap(offset,a,round,f,1.0,direction);}else if(nearlyEquals(mod(g,11.0),0.0)){squareCap(offset,a,round,d,-1.0,direction);}if(!degenerate){vec4 offsets=offsetMatrix*vec4(offset,0.0,0.0);gl_Position=projPos+offsets;}else{gl_Position=vec4(offset,0.0,1.0);}}");var ru=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_lineWidth=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_lineWidth":"k");this.u_miterLimit=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_miterLimit":"l");this.u_opacity=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_opacity":"m");this.u_color=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_color":"n");this.u_size=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_size":"o");this.u_pixelRatio=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_pixelRatio":"p");this.a_lastPos=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_lastPos":"d");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"e");this.a_nextPos=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_nextPos":"f");this.a_direction=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_direction":"g")};var nu=function(t,i){Yf.call(this,t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:undefined,miterLimit:undefined,changed:false}};kh.inherits(nu,Yf);nu.prototype.drawCoordinates_=function(t,i,s,e){var r,n;var h=this.vertices.length;var a=this.indices.length;var o=this.state_.lineJoin==="bevel"?0:this.state_.lineJoin==="miter"?1:2;var f=this.state_.lineCap==="butt"?0:this.state_.lineCap==="square"?1:2;var u=su.lineStringIsClosed(t,i,s,e);var v,l,c;var d=a;var m=1;var p,M,z;for(r=i,n=s;r<n;r+=e){c=h/7;p=M;M=z||[t[r],t[r+1]];if(r===i){z=[t[r+e],t[r+e+1]];if(s-i===e*2&&jh.equals(M,z)){break}if(u){p=[t[s-e*2],t[s-e*2+1]];v=z}else{if(f){h=this.addVertices_([0,0],M,z,m*nu.Instruction_.BEGIN_LINE_CAP*f,h);h=this.addVertices_([0,0],M,z,-m*nu.Instruction_.BEGIN_LINE_CAP*f,h);this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=c+1;this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c+2}h=this.addVertices_([0,0],M,z,m*nu.Instruction_.BEGIN_LINE*(f||1),h);h=this.addVertices_([0,0],M,z,-m*nu.Instruction_.BEGIN_LINE*(f||1),h);d=h/7-1;continue}}else if(r===s-e){if(u){z=v;break}else{p=p||[0,0];h=this.addVertices_(p,M,[0,0],m*nu.Instruction_.END_LINE*(f||1),h);h=this.addVertices_(p,M,[0,0],-m*nu.Instruction_.END_LINE*(f||1),h);this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=d;this.indices[a++]=c+1;this.indices[a++]=c;if(f){h=this.addVertices_(p,M,[0,0],m*nu.Instruction_.END_LINE_CAP*f,h);h=this.addVertices_(p,M,[0,0],-m*nu.Instruction_.END_LINE_CAP*f,h);this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=c+1;this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c+2}break}}else{z=[t[r+e],t[r+e+1]]}l=Bf.triangleIsCounterClockwise(p[0],p[1],M[0],M[1],z[0],z[1])?-1:1;h=this.addVertices_(p,M,z,l*nu.Instruction_.BEVEL_FIRST*(o||1),h);h=this.addVertices_(p,M,z,l*nu.Instruction_.BEVEL_SECOND*(o||1),h);h=this.addVertices_(p,M,z,-l*nu.Instruction_.MITER_BOTTOM*(o||1),h);if(r>i){this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=m*l>0?d:d-1}this.indices[a++]=c;this.indices[a++]=c+2;this.indices[a++]=c+1;d=c+2;m=l;if(o){h=this.addVertices_(p,M,z,l*nu.Instruction_.MITER_TOP*o,h);this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c}}if(u){c=c||h/7;l=Ma.linearRingIsClockwise([p[0],p[1],M[0],M[1],z[0],z[1]],0,6,2)?1:-1;h=this.addVertices_(p,M,z,l*nu.Instruction_.BEVEL_FIRST*(o||1),h);h=this.addVertices_(p,M,z,-l*nu.Instruction_.MITER_BOTTOM*(o||1),h);this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=c+1;this.indices[a++]=c;this.indices[a++]=m*l>0?d:d-1}};nu.prototype.addVertices_=function(t,i,s,e,r){this.vertices[r++]=t[0];this.vertices[r++]=t[1];this.vertices[r++]=i[0];this.vertices[r++]=i[1];this.vertices[r++]=s[0];this.vertices[r++]=s[1];this.vertices[r++]=e;return r};nu.prototype.isValid_=function(t,i,s,e){var r=s-i;if(r<e*2){return false}else if(r===e*2){var n=[t[i],t[i+1]];var h=[t[i+e],t[i+e+1]];return!jh.equals(n,h)}return true};nu.prototype.drawLineString=function(t,i){var s=t.getFlatCoordinates();var e=t.getStride();if(this.isValid_(s,0,s.length,e)){s=Bh.translate(s,0,s.length,e,-this.origin[0],-this.origin[1]);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);this.drawCoordinates_(s,0,s.length,e)}};nu.prototype.drawMultiLineString=function(t,i){var s=this.indices.length;var e=t.getEnds();e.unshift(0);var r=t.getFlatCoordinates();var n=t.getStride();var h,a;if(e.length>1){for(h=1,a=e.length;h<a;++h){if(this.isValid_(r,e[h-1],e[h],n)){var o=Bh.translate(r,e[h-1],e[h],n,-this.origin[0],-this.origin[1]);this.drawCoordinates_(o,0,o.length,n)}}}if(this.indices.length>s){this.startIndices.push(s);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(s);this.state_.changed=false}}};nu.prototype.drawPolygonCoordinates=function(t,i,s){if(!su.lineStringIsClosed(t,0,t.length,s)){t.push(t[0]);t.push(t[1])}this.drawCoordinates_(t,0,t.length,s);if(i.length){var e,r;for(e=0,r=i.length;e<r;++e){if(!su.lineStringIsClosed(i[e],0,i[e].length,s)){i[e].push(i[e][0]);i[e].push(i[e][1])}this.drawCoordinates_(i[e],0,i[e].length,s)}}};nu.prototype.setPolygonStyle=function(t,i){var s=i===undefined?this.indices.length:i;this.startIndices.push(s);this.startIndicesFeature.push(t);if(this.state_.changed){this.styleIndices_.push(s);this.state_.changed=false}};nu.prototype.getCurrentIndex=function(){return this.indices.length};nu.prototype.finish=function(t){this.verticesBuffer=new Hf(this.vertices);this.indicesBuffer=new Hf(this.indices);this.startIndices.push(this.indices.length);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};nu.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;return function(){t.deleteBuffer(i);t.deleteBuffer(s)}};nu.prototype.setUpProgram=function(t,i,s,e){var r,n;r=eu.fragment;n=eu.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new ru(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_lastPos);t.vertexAttribPointer(a.a_lastPos,2,_a.FLOAT,false,28,0);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,_a.FLOAT,false,28,8);t.enableVertexAttribArray(a.a_nextPos);t.vertexAttribPointer(a.a_nextPos,2,_a.FLOAT,false,28,16);t.enableVertexAttribArray(a.a_direction);t.vertexAttribPointer(a.a_direction,1,_a.FLOAT,false,28,24);t.uniform2fv(a.u_size,s);t.uniform1f(a.u_pixelRatio,e);return a};nu.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_lastPos);t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_nextPos);t.disableVertexAttribArray(i.a_direction)};nu.prototype.drawReplay=function(t,i,s,e){var r=t.getParameter(t.DEPTH_FUNC);var n=t.getParameter(t.DEPTH_WRITEMASK);if(!e){t.enable(t.DEPTH_TEST);t.depthMask(true);t.depthFunc(t.NOTEQUAL)}if(!Ch.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var h,a,o,f;o=this.startIndices[this.startIndices.length-1];for(h=this.styleIndices_.length-1;h>=0;--h){a=this.styleIndices_[h];f=this.styles_[h];this.setStrokeStyle_(t,f[0],f[1],f[2]);this.drawElements(t,i,a,o);t.clear(t.DEPTH_BUFFER_BIT);o=a}}if(!e){t.disable(t.DEPTH_TEST);t.clear(t.DEPTH_BUFFER_BIT);t.depthMask(n);t.depthFunc(r)}};nu.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,v;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setStrokeStyle_(t,h[0],h[1],h[2]);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){v=this.startIndices[u];o=this.startIndicesFeature[u];f=kh.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}n=v}u--;r=v}if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}r=n=a}};nu.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,v,l;l=this.startIndices.length-2;a=this.startIndices[l+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setStrokeStyle_(t,o[0],o[1],o[2]);f=this.styleIndices_[n];while(l>=0&&this.startIndices[l]>=f){h=this.startIndices[l];u=this.startIndicesFeature[l];v=kh.getUid(u).toString();if(s[v]===undefined&&u.getGeometry()&&(r===undefined||qh.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}l--;a=h}}return undefined};nu.prototype.setStrokeStyle_=function(t,i,s,e){t.uniform4fv(this.defaultLocations_.u_color,i);t.uniform1f(this.defaultLocations_.u_lineWidth,s);t.uniform1f(this.defaultLocations_.u_miterLimit,e)};nu.prototype.setFillStrokeStyle=function(t,i){var s=i.getLineCap();this.state_.lineCap=s!==undefined?s:Bf.defaultLineCap;var e=i.getLineDash();this.state_.lineDash=e?e:Bf.defaultLineDash;var r=i.getLineDashOffset();this.state_.lineDashOffset=r?r:Bf.defaultLineDashOffset;var n=i.getLineJoin();this.state_.lineJoin=n!==undefined?n:Bf.defaultLineJoin;var h=i.getColor();if(!(h instanceof CanvasGradient)&&!(h instanceof CanvasPattern)){h=Uo.asArray(h).map((function(t,i){return i!=3?t/255:t}))||Bf.defaultStrokeStyle}else{h=Bf.defaultStrokeStyle}var a=i.getWidth();a=a!==undefined?a:Bf.defaultLineWidth;var o=i.getMiterLimit();o=o!==undefined?o:Bf.defaultMiterLimit;if(!this.state_.strokeColor||!jh.equals(this.state_.strokeColor,h)||this.state_.lineWidth!==a||this.state_.miterLimit!==o){this.state_.changed=true;this.state_.strokeColor=h;this.state_.lineWidth=a;this.state_.miterLimit=o;this.styles_.push([h,a,o])}};nu.Instruction_={ROUND:2,BEGIN_LINE:3,END_LINE:5,BEGIN_LINE_CAP:7,END_LINE_CAP:11,BEVEL_FIRST:13,BEVEL_SECOND:17,MITER_BOTTOM:19,MITER_TOP:23};var hu={};hu.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;uniform vec4 e;uniform float f;void main(void){gl_FragColor=e;float alpha=e.a*f;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");hu.vertex=new Vf(kh.DEBUG_WEBGL?"\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n":"attribute vec2 a;uniform mat4 b;uniform mat4 c;uniform mat4 d;void main(void){gl_Position=b*vec4(a,0.0,1.0);}");var au=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_projectionMatrix":"b");this.u_offsetScaleMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetScaleMatrix":"c");this.u_offsetRotateMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_offsetRotateMatrix":"d");this.u_color=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_color":"e");this.u_opacity=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_opacity":"f");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"a")};var ou=function(t){var i=t||{};this.color_=i.color!==undefined?i.color:null;this.lineCap_=i.lineCap;this.lineDash_=i.lineDash!==undefined?i.lineDash:null;this.lineDashOffset_=i.lineDashOffset;this.lineJoin_=i.lineJoin;this.miterLimit_=i.miterLimit;this.width_=i.width;this.checksum_=undefined};ou.prototype.clone=function(){var t=this.getColor();return new ou({color:t&&t.slice?t.slice():t||undefined,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():undefined,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})};ou.prototype.getColor=function(){return this.color_};ou.prototype.getLineCap=function(){return this.lineCap_};ou.prototype.getLineDash=function(){return this.lineDash_};ou.prototype.getLineDashOffset=function(){return this.lineDashOffset_};ou.prototype.getLineJoin=function(){return this.lineJoin_};ou.prototype.getMiterLimit=function(){return this.miterLimit_};ou.prototype.getWidth=function(){return this.width_};ou.prototype.setColor=function(t){this.color_=t;this.checksum_=undefined};ou.prototype.setLineCap=function(t){this.lineCap_=t;this.checksum_=undefined};ou.prototype.setLineDash=function(t){this.lineDash_=t;this.checksum_=undefined};ou.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t;this.checksum_=undefined};ou.prototype.setLineJoin=function(t){this.lineJoin_=t;this.checksum_=undefined};ou.prototype.setMiterLimit=function(t){this.miterLimit_=t;this.checksum_=undefined};ou.prototype.setWidth=function(t){this.width_=t;this.checksum_=undefined};ou.prototype.getChecksum=function(){if(this.checksum_===undefined){this.checksum_="s";if(this.color_){if(typeof this.color_==="string"){this.checksum_+=this.color_}else{this.checksum_+=kh.getUid(this.color_).toString()}}else{this.checksum_+="-"}this.checksum_+=","+(this.lineCap_!==undefined?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(this.lineDashOffset_!==undefined?this.lineDashOffset_:"-")+","+(this.lineJoin_!==undefined?this.lineJoin_:"-")+","+(this.miterLimit_!==undefined?this.miterLimit_.toString():"-")+","+(this.width_!==undefined?this.width_.toString():"-")}return this.checksum_};var fu=function(t){this.first_=undefined;this.last_=undefined;this.head_=undefined;this.circular_=t===undefined?true:t;this.length_=0};fu.prototype.insertItem=function(t){var i={prev:undefined,next:undefined,data:t};var s=this.head_;if(!s){this.first_=i;this.last_=i;if(this.circular_){i.next=i;i.prev=i}}else{var e=s.next;i.prev=s;i.next=e;s.next=i;if(e){e.prev=i}if(s===this.last_){this.last_=i}}this.head_=i;this.length_++};fu.prototype.removeItem=function(){var t=this.head_;if(t){var i=t.next;var s=t.prev;if(i){i.prev=s}if(s){s.next=i}this.head_=i||s;if(this.first_===this.last_){this.head_=undefined;this.first_=undefined;this.last_=undefined}else if(this.first_===t){this.first_=this.head_}else if(this.last_===t){this.last_=s?this.head_.prev:this.head_}this.length_--}};fu.prototype.firstItem=function(){this.head_=this.first_;if(this.head_){return this.head_.data}return undefined};fu.prototype.lastItem=function(){this.head_=this.last_;if(this.head_){return this.head_.data}return undefined};fu.prototype.nextItem=function(){if(this.head_&&this.head_.next){this.head_=this.head_.next;return this.head_.data}return undefined};fu.prototype.getNextItem=function(){if(this.head_&&this.head_.next){return this.head_.next.data}return undefined};fu.prototype.prevItem=function(){if(this.head_&&this.head_.prev){this.head_=this.head_.prev;return this.head_.data}return undefined};fu.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev){return this.head_.prev.data}return undefined};fu.prototype.getCurrItem=function(){if(this.head_){return this.head_.data}return undefined};fu.prototype.setFirstItem=function(){if(this.circular_&&this.head_){this.first_=this.head_;this.last_=this.head_.prev}};fu.prototype.concat=function(t){if(t.head_){if(this.head_){var i=this.head_.next;this.head_.next=t.first_;t.first_.prev=this.head_;i.prev=t.last_;t.last_.next=i;this.length_+=t.length_}else{this.head_=t.head_;this.first_=t.first_;this.last_=t.last_;this.length_=t.length_}t.head_=undefined;t.first_=undefined;t.last_=undefined;t.length_=0}};fu.prototype.getLength=function(){return this.length_};var uu=function(t){this.rbush_=nf(t);this.items_={}};uu.prototype.insert=function(t,i){var s={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};this.rbush_.insert(s);this.items_[kh.getUid(i)]=s};uu.prototype.load=function(t,i){var s=new Array(i.length);for(var e=0,r=i.length;e<r;e++){var n=t[e];var h=i[e];var a={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],value:h};s[e]=a;this.items_[kh.getUid(h)]=a}this.rbush_.load(s)};uu.prototype.remove=function(t){var i=kh.getUid(t);var s=this.items_[i];delete this.items_[i];return this.rbush_.remove(s)!==null};uu.prototype.update=function(t,i){var s=this.items_[kh.getUid(i)];var e=[s.minX,s.minY,s.maxX,s.maxY];if(!qh.equals(e,t)){this.remove(i);this.insert(t,i)}};uu.prototype.getAll=function(){var t=this.rbush_.all();return t.map((function(t){return t.value}))};uu.prototype.getInExtent=function(t){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};var s=this.rbush_.search(i);return s.map((function(t){return t.value}))};uu.prototype.forEach=function(t,i){return this.forEach_(this.getAll(),t,i)};uu.prototype.forEachInExtent=function(t,i,s){return this.forEach_(this.getInExtent(t),i,s)};uu.prototype.forEach_=function(t,i,s){var e;for(var r=0,n=t.length;r<n;r++){e=i.call(s,t[r]);if(e){return e}}return e};uu.prototype.isEmpty=function(){return Ch.isEmpty(this.items_)};uu.prototype.clear=function(){this.rbush_.clear();this.items_={}};uu.prototype.getExtent=function(t){var i=this.rbush_.data;return qh.createOrUpdate(i.minX,i.minY,i.maxX,i.maxY,t)};uu.prototype.concat=function(t){this.rbush_.load(t.rbush_.all());for(var i in t.items_){this.items_[i|0]=t.items_[i|0]}};var vu=function(t,i){Yf.call(this,t,i);this.lineStringReplay=new nu(t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.state_={fillColor:null,changed:false}};kh.inherits(vu,Yf);vu.prototype.drawCoordinates_=function(t,i,s){var e=new fu;var r=new uu;this.processFlatCoordinates_(t,s,e,r,true);var n=this.getMaxCoords_(e);if(i.length){var h,a;var o=[];for(h=0,a=i.length;h<a;++h){var f={list:new fu,maxCoords:undefined,rtree:new uu};o.push(f);this.processFlatCoordinates_(i[h],s,f.list,f.rtree,false);this.classifyPoints_(f.list,f.rtree,true);f.maxCoords=this.getMaxCoords_(f.list)}o.sort((function(t,i){return i.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-i.maxCoords[1]:i.maxCoords[0]-t.maxCoords[0]}));for(h=0;h<o.length;++h){var u=o[h].list;var v=u.firstItem();var l=v;var c;do{if(this.getIntersections_(l,r).length){c=true;break}l=u.nextItem()}while(v!==l);if(!c){if(this.bridgeHole_(u,o[h].maxCoords[0],e,n[0],r)){r.concat(o[h].rtree);this.classifyPoints_(e,r,false)}}}}else{this.classifyPoints_(e,r,false)}this.triangulate_(e,r)};vu.prototype.processFlatCoordinates_=function(t,i,s,e,r){var n=Ma.linearRingIsClockwise(t,0,t.length,i);var h,a;var o=this.vertices.length/2;var f;var u;var v;var l=[];var c=[];if(r===n){f=this.createPoint_(t[0],t[1],o++);u=f;for(h=i,a=t.length;h<a;h+=i){v=this.createPoint_(t[h],t[h+1],o++);c.push(this.insertItem_(u,v,s));l.push([Math.min(u.x,v.x),Math.min(u.y,v.y),Math.max(u.x,v.x),Math.max(u.y,v.y)]);u=v}c.push(this.insertItem_(v,f,s));l.push([Math.min(u.x,v.x),Math.min(u.y,v.y),Math.max(u.x,v.x),Math.max(u.y,v.y)])}else{var d=t.length-i;f=this.createPoint_(t[d],t[d+1],o++);u=f;for(h=d-i,a=0;h>=a;h-=i){v=this.createPoint_(t[h],t[h+1],o++);c.push(this.insertItem_(u,v,s));l.push([Math.min(u.x,v.x),Math.min(u.y,v.y),Math.max(u.x,v.x),Math.max(u.y,v.y)]);u=v}c.push(this.insertItem_(v,f,s));l.push([Math.min(u.x,v.x),Math.min(u.y,v.y),Math.max(u.x,v.x),Math.max(u.y,v.y)])}e.load(l,c)};vu.prototype.getMaxCoords_=function(t){var i=t.firstItem();var s=i;var e=[s.p0.x,s.p0.y];do{s=t.nextItem();if(s.p0.x>e[0]){e=[s.p0.x,s.p0.y]}}while(s!==i);return e};vu.prototype.classifyPoints_=function(t,i,s){var e=t.firstItem();var r=e;var n=t.nextItem();var h=false;do{var a=s?Bf.triangleIsCounterClockwise(n.p1.x,n.p1.y,r.p1.x,r.p1.y,r.p0.x,r.p0.y):Bf.triangleIsCounterClockwise(r.p0.x,r.p0.y,r.p1.x,r.p1.y,n.p1.x,n.p1.y);if(a===undefined){this.removeItem_(r,n,t,i);h=true;if(n===e){e=t.getNextItem()}n=r;t.prevItem()}else if(r.p1.reflex!==a){r.p1.reflex=a;h=true}r=n;n=t.nextItem()}while(r!==e);return h};vu.prototype.bridgeHole_=function(t,i,s,e,r){var n=t.firstItem();while(n.p1.x!==i){n=t.nextItem()}var h=n.p1;var a={x:e,y:h.y,i:-1};var o=Infinity;var f,u,v;var l;var c=this.getIntersections_({p0:h,p1:a},r,true);for(f=0,u=c.length;f<u;++f){var d=c[f];var m=this.calculateIntersection_(h,a,d.p0,d.p1,true);var p=Math.abs(h.x-m[0]);if(p<o&&Bf.triangleIsCounterClockwise(h.x,h.y,d.p0.x,d.p0.y,d.p1.x,d.p1.y)!==undefined){o=p;l={x:m[0],y:m[1],i:-1};n=d}}if(o===Infinity){return false}v=n.p1;if(o>0){var M=this.getPointsInTriangle_(h,l,n.p1,r);if(M.length){var z=Infinity;for(f=0,u=M.length;f<u;++f){var _=M[f];var g=Math.atan2(h.y-_.y,a.x-_.x);if(g<z||g===z&&_.x<v.x){z=g;v=_}}}}n=s.firstItem();while(n.p1.x!==v.x||n.p1.y!==v.y){n=s.nextItem()}var w={x:h.x,y:h.y,i:h.i,reflex:undefined};var y={x:n.p1.x,y:n.p1.y,i:n.p1.i,reflex:undefined};t.getNextItem().p0=w;this.insertItem_(h,n.p1,t,r);this.insertItem_(y,w,t,r);n.p1=y;t.setFirstItem();s.concat(t);return true};vu.prototype.triangulate_=function(t,i){var s=false;var e=this.isSimple_(t,i);while(t.getLength()>3){if(e){if(!this.clipEars_(t,i,e,s)){if(!this.classifyPoints_(t,i,s)){if(!this.resolveSelfIntersections_(t,i,true)){break}}}}else{if(!this.clipEars_(t,i,e,s)){if(!this.classifyPoints_(t,i,s)){if(!this.resolveSelfIntersections_(t,i)){e=this.isSimple_(t,i);if(!e){this.splitPolygon_(t,i);break}else{s=!this.isClockwise_(t);this.classifyPoints_(t,i,s)}}}}}}if(t.getLength()===3){var r=this.indices.length;this.indices[r++]=t.getPrevItem().p0.i;this.indices[r++]=t.getCurrItem().p0.i;this.indices[r++]=t.getNextItem().p0.i}};vu.prototype.clipEars_=function(t,i,s,e){var r=this.indices.length;var n=t.firstItem();var h=t.getPrevItem();var a=n;var o=t.nextItem();var f=t.getNextItem();var u,v,l;var c=false;do{u=a.p0;v=a.p1;l=o.p1;if(v.reflex===false){var d;if(s){d=this.getPointsInTriangle_(u,v,l,i,true).length===0}else{d=e?this.diagonalIsInside_(f.p1,l,v,u,h.p0):this.diagonalIsInside_(h.p0,u,v,l,f.p1)}if((s||this.getIntersections_({p0:u,p1:l},i).length===0)&&d){if(s||u.reflex===false||l.reflex===false||Ma.linearRingIsClockwise([h.p0.x,h.p0.y,u.x,u.y,v.x,v.y,l.x,l.y,f.p1.x,f.p1.y],0,10,2)===!e){this.indices[r++]=u.i;this.indices[r++]=v.i;this.indices[r++]=l.i;this.removeItem_(a,o,t,i);if(o===n){n=f}c=true}}}h=t.getPrevItem();a=t.getCurrItem();o=t.nextItem();f=t.getNextItem()}while(a!==n&&t.getLength()>3);return c};vu.prototype.resolveSelfIntersections_=function(t,i,s){var e=t.firstItem();t.nextItem();var r=e;var n=t.nextItem();var h=false;do{var a=this.calculateIntersection_(r.p0,r.p1,n.p0,n.p1,s);if(a){var o=false;var f=this.vertices.length;var u=this.indices.length;var v=f/2;var l=t.prevItem();t.removeItem();i.remove(l);o=l===e;var c;if(s){if(a[0]===r.p0.x&&a[1]===r.p0.y){t.prevItem();c=r.p0;n.p0=c;i.remove(r);o=o||r===e}else{c=n.p1;r.p1=c;i.remove(n);o=o||n===e}t.removeItem()}else{c=this.createPoint_(a[0],a[1],v);r.p1=c;n.p0=c;i.update([Math.min(r.p0.x,r.p1.x),Math.min(r.p0.y,r.p1.y),Math.max(r.p0.x,r.p1.x),Math.max(r.p0.y,r.p1.y)],r);i.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n)}this.indices[u++]=l.p0.i;this.indices[u++]=l.p1.i;this.indices[u++]=c.i;h=true;if(o){break}}r=t.getPrevItem();n=t.nextItem()}while(r!==e);return h};vu.prototype.isSimple_=function(t,i){var s=t.firstItem();var e=s;do{if(this.getIntersections_(e,i).length){return false}e=t.nextItem()}while(e!==s);return true};vu.prototype.isClockwise_=function(t){var i=t.getLength()*2;var s=new Array(i);var e=t.firstItem();var r=e;var n=0;do{s[n++]=r.p0.x;s[n++]=r.p0.y;r=t.nextItem()}while(r!==e);return Ma.linearRingIsClockwise(s,0,i,2)};vu.prototype.splitPolygon_=function(t,i){var s=t.firstItem();var e=s;do{var r=this.getIntersections_(e,i);if(r.length){var n=r[0];var h=this.vertices.length/2;var a=this.calculateIntersection_(e.p0,e.p1,n.p0,n.p1);var o=this.createPoint_(a[0],a[1],h);var f=new fu;var u=new uu;this.insertItem_(o,e.p1,f,u);e.p1=o;i.update([Math.min(e.p0.x,o.x),Math.min(e.p0.y,o.y),Math.max(e.p0.x,o.x),Math.max(e.p0.y,o.y)],e);var v=t.nextItem();while(v!==n){this.insertItem_(v.p0,v.p1,f,u);i.remove(v);t.removeItem();v=t.getCurrItem()}this.insertItem_(n.p0,o,f,u);n.p0=o;i.update([Math.min(n.p1.x,o.x),Math.min(n.p1.y,o.y),Math.max(n.p1.x,o.x),Math.max(n.p1.y,o.y)],n);this.classifyPoints_(t,i,false);this.triangulate_(t,i);this.classifyPoints_(f,u,false);this.triangulate_(f,u);break}e=t.nextItem()}while(e!==s)};vu.prototype.createPoint_=function(t,i,s){var e=this.vertices.length;this.vertices[e++]=t;this.vertices[e++]=i;var r={x:t,y:i,i:s,reflex:undefined};return r};vu.prototype.insertItem_=function(t,i,s,e){var r={p0:t,p1:i};s.insertItem(r);if(e){e.insert([Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x,i.x),Math.max(t.y,i.y)],r)}return r};vu.prototype.removeItem_=function(t,i,s,e){if(s.getCurrItem()===i){s.removeItem();t.p1=i.p1;e.remove(i);e.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t)}};vu.prototype.getPointsInTriangle_=function(t,i,s,e,r){var n,h,a,o;var f=[];var u=e.getInExtent([Math.min(t.x,i.x,s.x),Math.min(t.y,i.y,s.y),Math.max(t.x,i.x,s.x),Math.max(t.y,i.y,s.y)]);for(n=0,h=u.length;n<h;++n){for(a in u[n]){o=u[n][a];if(typeof o==="object"&&(!r||o.reflex)){if((o.x!==t.x||o.y!==t.y)&&(o.x!==i.x||o.y!==i.y)&&(o.x!==s.x||o.y!==s.y)&&f.indexOf(o)===-1&&la.linearRingContainsXY([t.x,t.y,i.x,i.y,s.x,s.y],0,6,2,o.x,o.y)){f.push(o)}}}}return f};vu.prototype.getIntersections_=function(t,i,s){var e=t.p0;var r=t.p1;var n=i.getInExtent([Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x,r.x),Math.max(e.y,r.y)]);var h=[];var a,o;for(a=0,o=n.length;a<o;++a){var f=n[a];if(t!==f&&(s||f.p0!==r||f.p1!==e)&&this.calculateIntersection_(e,r,f.p0,f.p1,s)){h.push(f)}}return h};vu.prototype.calculateIntersection_=function(t,i,s,e,r){var n=(e.y-s.y)*(i.x-t.x)-(e.x-s.x)*(i.y-t.y);if(n!==0){var h=((e.x-s.x)*(t.y-s.y)-(e.y-s.y)*(t.x-s.x))/n;var a=((i.x-t.x)*(t.y-s.y)-(i.y-t.y)*(t.x-s.x))/n;if(!r&&h>Bf.EPSILON&&h<1-Bf.EPSILON&&a>Bf.EPSILON&&a<1-Bf.EPSILON||r&&h>=0&&h<=1&&a>=0&&a<=1){return[t.x+h*(i.x-t.x),t.y+h*(i.y-t.y)]}}return undefined};vu.prototype.diagonalIsInside_=function(t,i,s,e,r){if(i.reflex===undefined||e.reflex===undefined){return false}var n=(s.x-e.x)*(i.y-e.y)>(s.y-e.y)*(i.x-e.x);var h=(r.x-e.x)*(i.y-e.y)<(r.y-e.y)*(i.x-e.x);var a=(t.x-i.x)*(e.y-i.y)>(t.y-i.y)*(e.x-i.x);var o=(s.x-i.x)*(e.y-i.y)<(s.y-i.y)*(e.x-i.x);var f=e.reflex?h||n:h&&n;var u=i.reflex?o||a:o&&a;return f&&u};vu.prototype.drawMultiPolygon=function(t,i){var s=t.getEndss();var e=t.getStride();var r=this.indices.length;var n=this.lineStringReplay.getCurrentIndex();var h=t.getFlatCoordinates();var a,o,f,u;var v=0;for(a=0,o=s.length;a<o;++a){var l=s[a];if(l.length>0){var c=Bh.translate(h,v,l[0],e,-this.origin[0],-this.origin[1]);if(c.length){var d=[];var m;for(f=1,u=l.length;f<u;++f){if(l[f]!==l[f-1]){m=Bh.translate(h,l[f-1],l[f],e,-this.origin[0],-this.origin[1]);d.push(m)}}this.lineStringReplay.drawPolygonCoordinates(c,d,e);this.drawCoordinates_(c,d,e)}}v=l[l.length-1]}if(this.indices.length>r){this.startIndices.push(r);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(r);this.state_.changed=false}}if(this.lineStringReplay.getCurrentIndex()>n){this.lineStringReplay.setPolygonStyle(i,n)}};vu.prototype.drawPolygon=function(t,i){var s=t.getEnds();var e=t.getStride();if(s.length>0){var r=t.getFlatCoordinates().map(Number);var n=Bh.translate(r,0,s[0],e,-this.origin[0],-this.origin[1]);if(n.length){var h=[];var a,o,f;for(a=1,o=s.length;a<o;++a){if(s[a]!==s[a-1]){f=Bh.translate(r,s[a-1],s[a],e,-this.origin[0],-this.origin[1]);h.push(f)}}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.lineStringReplay.setPolygonStyle(i);this.lineStringReplay.drawPolygonCoordinates(n,h,e);this.drawCoordinates_(n,h,e)}}};vu.prototype.finish=function(t){this.verticesBuffer=new Hf(this.vertices);this.indicesBuffer=new Hf(this.indices);this.startIndices.push(this.indices.length);this.lineStringReplay.finish(t);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};vu.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;var e=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(i);t.deleteBuffer(s);e()}};vu.prototype.setUpProgram=function(t,i,s,e){var r,n;r=hu.fragment;n=hu.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new au(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,_a.FLOAT,false,8,0);return a};vu.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position)};vu.prototype.drawReplay=function(t,i,s,e){var r=t.getParameter(t.DEPTH_FUNC);var n=t.getParameter(t.DEPTH_WRITEMASK);if(!e){t.enable(t.DEPTH_TEST);t.depthMask(true);t.depthFunc(t.NOTEQUAL)}if(!Ch.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var h,a,o,f;o=this.startIndices[this.startIndices.length-1];for(h=this.styleIndices_.length-1;h>=0;--h){a=this.styleIndices_[h];f=this.styles_[h];this.setFillStyle_(t,f);this.drawElements(t,i,a,o);o=a}}if(!e){t.disable(t.DEPTH_TEST);t.clear(t.DEPTH_BUFFER_BIT);t.depthMask(n);t.depthFunc(r)}};vu.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,v,l;l=this.startIndices.length-2;a=this.startIndices[l+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setFillStyle_(t,o);f=this.styleIndices_[n];while(l>=0&&this.startIndices[l]>=f){h=this.startIndices[l];u=this.startIndicesFeature[l];v=kh.getUid(u).toString();if(s[v]===undefined&&u.getGeometry()&&(r===undefined||qh.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}l--;a=h}}return undefined};vu.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,v;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setFillStyle_(t,h);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){v=this.startIndices[u];o=this.startIndicesFeature[u];f=kh.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}n=v}u--;r=v}if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}r=n=a}};vu.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_color,i)};vu.prototype.setFillStrokeStyle=function(t,i){var s=t?t.getColor():[0,0,0,0];if(!(s instanceof CanvasGradient)&&!(s instanceof CanvasPattern)){s=Uo.asArray(s).map((function(t,i){return i!=3?t/255:t}))||Bf.defaultFillStyle}else{s=Bf.defaultFillStyle}if(!this.state_.fillColor||!jh.equals(s,this.state_.fillColor)){this.state_.fillColor=s;this.state_.changed=true;this.styles_.push(s)}if(i){this.lineStringReplay.setFillStrokeStyle(null,i)}else{var e=new ou({color:[0,0,0,0],lineWidth:0});this.lineStringReplay.setFillStrokeStyle(null,e)}};var lu=function(t,i){this.space_=i;this.emptyBlocks_=[{x:0,y:0,width:t,height:t}];this.entries_={};this.context_=$a.createCanvasContext2D(t,t);this.canvas_=this.context_.canvas};lu.prototype.get=function(t){return this.entries_[t]||null};lu.prototype.add=function(t,i,s,e,r){var n,h,a;for(h=0,a=this.emptyBlocks_.length;h<a;++h){n=this.emptyBlocks_[h];if(n.width>=i+this.space_&&n.height>=s+this.space_){var o={offsetX:n.x+this.space_,offsetY:n.y+this.space_,image:this.canvas_};this.entries_[t]=o;e.call(r,this.context_,n.x+this.space_,n.y+this.space_);this.split_(h,n,i+this.space_,s+this.space_);return o}}return null};lu.prototype.split_=function(t,i,s,e){var r=i.width-s;var n=i.height-e;var h;var a;if(r>n){h={x:i.x+s,y:i.y,width:i.width-s,height:i.height};a={x:i.x,y:i.y+e,width:s,height:i.height-e};this.updateBlocks_(t,h,a)}else{h={x:i.x+s,y:i.y,width:i.width-s,height:e};a={x:i.x,y:i.y+e,width:i.width,height:i.height-e};this.updateBlocks_(t,h,a)}};lu.prototype.updateBlocks_=function(t,i,s){var e=[t,1];if(i.width>0&&i.height>0){e.push(i)}if(s.width>0&&s.height>0){e.push(s)}this.emptyBlocks_.splice.apply(this.emptyBlocks_,e)};var cu=function(t){var i=t||{};this.currentSize_=i.initialSize!==undefined?i.initialSize:kh.INITIAL_ATLAS_SIZE;this.maxSize_=i.maxSize!==undefined?i.maxSize:kh.MAX_ATLAS_SIZE!=-1?kh.MAX_ATLAS_SIZE:kh.WEBGL_MAX_TEXTURE_SIZE!==undefined?kh.WEBGL_MAX_TEXTURE_SIZE:2048;this.space_=i.space!==undefined?i.space:1;this.atlases_=[new lu(this.currentSize_,this.space_)];this.currentHitSize_=this.currentSize_;this.hitAtlases_=[new lu(this.currentHitSize_,this.space_)]};cu.prototype.getInfo=function(t){var i=this.getInfo_(this.atlases_,t);if(!i){return null}var s=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(i,s)};cu.prototype.getInfo_=function(t,i){var s,e,r,n;for(r=0,n=t.length;r<n;++r){s=t[r];e=s.get(i);if(e){return e}}return null};cu.prototype.mergeInfos_=function(t,i){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:i.image}};cu.prototype.add=function(t,i,s,e,r,n){if(i+this.space_>this.maxSize_||s+this.space_>this.maxSize_){return null}var h=this.add_(false,t,i,s,e,n);if(!h){return null}var a=r!==undefined?r:kh.nullFunction;var o=this.add_(true,t,i,s,a,n);return this.mergeInfos_(h,o)};cu.prototype.add_=function(t,i,s,e,r,n){var h=t?this.hitAtlases_:this.atlases_;var a,o,f,u;for(f=0,u=h.length;f<u;++f){a=h[f];o=a.add(i,s,e,r,n);if(o){return o}else if(!o&&f===u-1){var v;if(t){v=Math.min(this.currentHitSize_*2,this.maxSize_);this.currentHitSize_=v}else{v=Math.min(this.currentSize_*2,this.maxSize_);this.currentSize_=v}a=new lu(v,this.space_);h.push(a);++u}}return null};var du=function(t,i){tu.call(this,t,i);this.images_=[];this.textures_=[];this.measureCanvas_=$a.createCanvasContext2D(0,0).canvas;this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:0,miterLimit:undefined,fillColor:null,font:undefined,scale:undefined};this.text_="";this.textAlign_=undefined;this.textBaseline_=undefined;this.offsetX_=undefined;this.offsetY_=undefined;this.atlases_={};this.currAtlas_=undefined;this.scale=1;this.opacity=1};kh.inherits(du,tu);du.prototype.drawText=function(t,i){if(this.text_){var s=null;var e=0;var r=2;var n=2;switch(t.getType()){case Gh.POINT:case Gh.MULTI_POINT:s=t.getFlatCoordinates();r=s.length;n=t.getStride();break;case Gh.CIRCLE:s=t.getCenter();break;case Gh.LINE_STRING:s=t.getFlatMidpoint();break;case Gh.MULTI_LINE_STRING:s=t.getFlatMidpoints();r=s.length;break;case Gh.POLYGON:s=t.getFlatInteriorPoint();break;case Gh.MULTI_POLYGON:s=t.getFlatInteriorPoints();r=s.length;break}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var h=this.currAtlas_;var a=this.text_.split("\n");var o=this.getTextSize_(a);var f,u,v,l,c,d,m,p;var M=Math.round(o[0]*this.textAlign_-this.offsetX_);var z=Math.round(o[1]*this.textBaseline_-this.offsetY_);var _=this.state_.lineWidth/2*this.state_.scale;for(f=0,u=a.length;f<u;++f){c=0;d=h.height*f;m=a[f].split("");for(v=0,l=m.length;v<l;++v){p=h.atlas.getInfo(m[v]);if(p){var g=p.image;this.anchorX=M-c;this.anchorY=z-d;this.originX=v===0?p.offsetX-_:p.offsetX;this.originY=p.offsetY;this.height=h.height;this.width=v===0||v===m.length-1?h.width[m[v]]+_:h.width[m[v]];this.imageHeight=g.height;this.imageWidth=g.width;var w;if(this.images_.length===0){this.images_.push(g)}else{w=this.images_[this.images_.length-1];if(kh.getUid(w)!=kh.getUid(g)){this.groupIndices.push(this.indices.length);this.images_.push(g)}}this.drawText_(s,e,r,n)}c+=this.width}}}};du.prototype.getTextSize_=function(t){var i=this;var s=this.currAtlas_;var e=t.length*s.height;var r=t.map((function(t){var e=0;var r,n;for(r=0,n=t.length;r<n;++r){var h=t[r];if(!s.width[h]){i.addCharToAtlas_(h)}e+=s.width[h]?s.width[h]:0}return e})).reduce((function(t,i){return Math.max(t,i)}));return[r,e]};du.prototype.drawText_=function(t,i,s,e){var r,n;for(r=i,n=s;r<n;r+=e){this.drawCoordinates(t,i,s,e)}};du.prototype.addCharToAtlas_=function(t){if(t.length===1){var i=this.currAtlas_;var s=this.state_;var e=this.measureCanvas_.getContext("2d");e.font=s.font;var r=Math.ceil(e.measureText(t).width*s.scale);var n=i.atlas.add(t,r,i.height,(function(i,e,r){i.font=s.font;i.fillStyle=s.fillColor;i.strokeStyle=s.strokeColor;i.lineWidth=s.lineWidth;i.lineCap=s.lineCap;i.lineJoin=s.lineJoin;i.miterLimit=s.miterLimit;i.textAlign="left";i.textBaseline="top";if(ga.CANVAS_LINE_DASH&&s.lineDash){i.setLineDash(s.lineDash);i.lineDashOffset=s.lineDashOffset}if(s.scale!==1){i.setTransform(s.scale,0,0,s.scale,0,0)}if(s.strokeColor){i.strokeText(t,e,r)}if(s.fillColor){i.fillText(t,e,r)}}));if(n){i.width[t]=r}}};du.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices=this.groupIndices;this.verticesBuffer=new Hf(this.vertices);this.indicesBuffer=new Hf(this.indices);var s={};this.createTextures(this.textures_,this.images_,s,i);this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:0,miterLimit:undefined,fillColor:null,font:undefined,scale:undefined};this.text_="";this.textAlign_=undefined;this.textBaseline_=undefined;this.offsetX_=undefined;this.offsetY_=undefined;this.images_=null;this.atlases_={};this.currAtlas_=undefined;tu.prototype.finish.call(this,t)};du.prototype.setTextStyle=function(t){var i=this.state_;var s=t.getFill();var e=t.getStroke();if(!t||!t.getText()||!s&&!e){this.text_=""}else{if(!s){i.fillColor=null}else{var r=s.getColor();i.fillColor=qo.asColorLike(r?r:Bf.defaultFillStyle)}if(!e){i.strokeColor=null;i.lineWidth=0}else{var n=e.getColor();i.strokeColor=qo.asColorLike(n?n:Bf.defaultStrokeStyle);i.lineWidth=e.getWidth()||Bf.defaultLineWidth;i.lineCap=e.getLineCap()||Bf.defaultLineCap;i.lineDashOffset=e.getLineDashOffset()||Bf.defaultLineDashOffset;i.lineJoin=e.getLineJoin()||Bf.defaultLineJoin;i.miterLimit=e.getMiterLimit()||Bf.defaultMiterLimit;var h=e.getLineDash();i.lineDash=h?h.slice():Bf.defaultLineDash}i.font=t.getFont()||Bf.defaultFont;i.scale=t.getScale()||1;this.text_=t.getText();var a=Nf.TEXT_ALIGN[t.getTextAlign()];var o=Nf.TEXT_ALIGN[t.getTextBaseline()];this.textAlign_=a===undefined?Bf.defaultTextAlign:a;this.textBaseline_=o===undefined?Bf.defaultTextBaseline:o;this.offsetX_=t.getOffsetX()||0;this.offsetY_=t.getOffsetY()||0;this.rotateWithView=!!t.getRotateWithView();this.rotation=t.getRotation()||0;this.currAtlas_=this.getAtlas_(i)}};du.prototype.getAtlas_=function(t){var i=[];var s;for(s in t){if(t[s]||t[s]===0){if(Array.isArray(t[s])){i=i.concat(t[s])}else{i.push(t[s])}}}var e=this.calculateHash_(i);if(!this.atlases_[e]){var r=this.measureCanvas_.getContext("2d");r.font=t.font;var n=Math.ceil((r.measureText("M").width*1.5+t.lineWidth/2)*t.scale);this.atlases_[e]={atlas:new cu({space:t.lineWidth+1}),width:{},height:n}}return this.atlases_[e]};du.prototype.calculateHash_=function(t){var i,s;var e="";for(i=0,s=t.length;i<s;++i){e+=t[i]}return e};du.prototype.getTextures=function(t){return this.textures_};du.prototype.getHitDetectionTextures=function(){return this.textures_};var mu=function(t,i,s){yf.call(this);this.maxExtent_=i;this.tolerance_=t;this.renderBuffer_=s;this.replaysByZIndex_={}};kh.inherits(mu,yf);mu.prototype.addDeclutter=function(t,i){};mu.prototype.getDeleteResourcesFunction=function(t){var i=[];var s;for(s in this.replaysByZIndex_){var e=this.replaysByZIndex_[s];var r;for(r in e){i.push(e[r].getDeleteResourcesFunction(t))}}return function(){var t=i.length;var s;for(var e=0;e<t;e++){s=i[e].apply(this,arguments)}return s}};mu.prototype.finish=function(t){var i;for(i in this.replaysByZIndex_){var s=this.replaysByZIndex_[i];var e;for(e in s){s[e].finish(t)}}};mu.prototype.getReplay=function(t,i){var s=t!==undefined?t.toString():"0";var e=this.replaysByZIndex_[s];if(e===undefined){e={};this.replaysByZIndex_[s]=e}var r=e[i];if(r===undefined){var n=mu.BATCH_CONSTRUCTORS_[i];r=new n(this.tolerance_,this.maxExtent_);e[i]=r}return r};mu.prototype.isEmpty=function(){return Ch.isEmpty(this.replaysByZIndex_)};mu.prototype.replay=function(t,i,s,e,r,n,h,a){var o=Object.keys(this.replaysByZIndex_).map(Number);o.sort(jh.numberSafeCompareFunction);var f,u,v,l,c,d;for(f=0,u=o.length;f<u;++f){c=this.replaysByZIndex_[o[f].toString()];for(v=0,l=Nf.ORDER.length;v<l;++v){d=c[Nf.ORDER[v]];if(d!==undefined){d.replay(t,i,s,e,r,n,h,a,undefined,false)}}}};mu.prototype.replayHitDetection_=function(t,i,s,e,r,n,h,a,o,f,u){var v=Object.keys(this.replaysByZIndex_).map(Number);v.sort((function(t,i){return i-t}));var l,c,d,m,p,M;for(l=0,c=v.length;l<c;++l){m=this.replaysByZIndex_[v[l].toString()];for(d=Nf.ORDER.length-1;d>=0;--d){p=m[Nf.ORDER[d]];if(p!==undefined){M=p.replay(t,i,s,e,r,n,h,a,o,f,u);if(M){return M}}}}return undefined};mu.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h,a,o,f){var u=i.getGL();u.bindFramebuffer(u.FRAMEBUFFER,i.getHitDetectionFramebuffer());var v;if(this.renderBuffer_!==undefined){v=qh.buffer(qh.createOrUpdateFromCoordinate(t),e*this.renderBuffer_)}return this.replayHitDetection_(i,t,e,r,mu.HIT_DETECTION_SIZE_,h,a,o,(function(t){var i=new Uint8Array(4);u.readPixels(0,0,1,1,u.RGBA,u.UNSIGNED_BYTE,i);if(i[3]>0){var s=f(t);if(s){return s}}}),true,v)};mu.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r,n,h,a,o){var f=i.getGL();f.bindFramebuffer(f.FRAMEBUFFER,i.getHitDetectionFramebuffer());var u=this.replayHitDetection_(i,t,e,r,mu.HIT_DETECTION_SIZE_,h,a,o,(function(t){var i=new Uint8Array(4);f.readPixels(0,0,1,1,f.RGBA,f.UNSIGNED_BYTE,i);return i[3]>0}),false);return u!==undefined};mu.HIT_DETECTION_SIZE_=[1,1];mu.BATCH_CONSTRUCTORS_={Circle:Jf,Image:iu,LineString:nu,Polygon:vu,Text:du};var pu=function(t,i,s,e,r,n,h){Xo.call(this);this.context_=t;this.center_=i;this.extent_=n;this.pixelRatio_=h;this.size_=r;this.rotation_=e;this.resolution_=s;this.imageStyle_=null;this.fillStyle_=null;this.strokeStyle_=null;this.textStyle_=null};kh.inherits(pu,Xo);pu.prototype.drawText_=function(t,i){var s=this.context_;var e=t.getReplay(0,bf.TEXT);e.setTextStyle(this.textStyle_);e.drawText(i,null);e.finish(s);var r=1;var n={};var h;var a=false;e.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,r,n,h,a);e.getDeleteResourcesFunction(s)()};pu.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke());this.setImageStyle(t.getImage());this.setTextStyle(t.getText())};pu.prototype.drawGeometry=function(t){var i=t.getType();switch(i){case Gh.POINT:this.drawPoint(t,null);break;case Gh.LINE_STRING:this.drawLineString(t,null);break;case Gh.POLYGON:this.drawPolygon(t,null);break;case Gh.MULTI_POINT:this.drawMultiPoint(t,null);break;case Gh.MULTI_LINE_STRING:this.drawMultiLineString(t,null);break;case Gh.MULTI_POLYGON:this.drawMultiPolygon(t,null);break;case Gh.GEOMETRY_COLLECTION:this.drawGeometryCollection(t,null);break;case Gh.CIRCLE:this.drawCircle(t,null);break}};pu.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);if(!s||!qh.intersects(this.extent_,s.getExtent())){return}this.setStyle(i);this.drawGeometry(s)};pu.prototype.drawGeometryCollection=function(t,i){var s=t.getGeometriesArray();var e,r;for(e=0,r=s.length;e<r;++e){this.drawGeometry(s[e])}};pu.prototype.drawPoint=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.IMAGE);r.setImageStyle(this.imageStyle_);r.drawPoint(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawMultiPoint=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.IMAGE);r.setImageStyle(this.imageStyle_);r.drawMultiPoint(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawLineString=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.LINE_STRING);r.setFillStrokeStyle(null,this.strokeStyle_);r.drawLineString(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawMultiLineString=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.LINE_STRING);r.setFillStrokeStyle(null,this.strokeStyle_);r.drawMultiLineString(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawPolygon=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.POLYGON);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawPolygon(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawMultiPolygon=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.POLYGON);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawMultiPolygon(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.drawCircle=function(t,i){var s=this.context_;var e=new mu(1,this.extent_);var r=e.getReplay(0,bf.CIRCLE);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawCircle(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};pu.prototype.setImageStyle=function(t){this.imageStyle_=t};pu.prototype.setFillStrokeStyle=function(t,i){this.fillStyle_=t;this.strokeStyle_=i};pu.prototype.setTextStyle=function(t){this.textStyle_=t};var Mu={};Mu.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n":"precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}");Mu.vertex=new Vf(kh.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}");var zu=function(t,i){this.u_texCoordMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_texCoordMatrix":"d");this.u_projectionMatrix=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_projectionMatrix":"e");this.u_opacity=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_opacity":"f");this.u_texture=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_texture":"g");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"b");this.a_texCoord=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_texCoord":"c")};var _u=function(t,i){Bo.call(this,i);this.mapRenderer=t;this.arrayBuffer_=new Hf([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]);this.texture=null;this.framebuffer=null;this.framebufferDimension=undefined;this.texCoordMatrix=sa.create();this.projectionMatrix=sa.create();this.tmpMat4_=Xf.create();this.defaultLocations_=null};kh.inherits(_u,Bo);_u.prototype.bindFramebuffer=function(t,i){var s=this.mapRenderer.getGL();if(this.framebufferDimension===undefined||this.framebufferDimension!=i){var e=function(t,i,s){if(!t.isContextLost()){t.deleteFramebuffer(i);t.deleteTexture(s)}}.bind(null,s,this.framebuffer,this.texture);t.postRenderFunctions.push(e);var r=Qf.createEmptyTexture(s,i,i);var n=s.createFramebuffer();s.bindFramebuffer(_a.FRAMEBUFFER,n);s.framebufferTexture2D(_a.FRAMEBUFFER,_a.COLOR_ATTACHMENT0,_a.TEXTURE_2D,r,0);this.texture=r;this.framebuffer=n;this.framebufferDimension=i}else{s.bindFramebuffer(_a.FRAMEBUFFER,this.framebuffer)}};_u.prototype.composeFrame=function(t,i,s){this.dispatchComposeEvent_(uo.PRECOMPOSE,s,t);s.bindBuffer(_a.ARRAY_BUFFER,this.arrayBuffer_);var e=s.getGL();var r=Mu.fragment;var n=Mu.vertex;var h=s.getProgram(r,n);var a;if(!this.defaultLocations_){a=new zu(e,h);this.defaultLocations_=a}else{a=this.defaultLocations_}if(s.useProgram(h)){e.enableVertexAttribArray(a.a_position);e.vertexAttribPointer(a.a_position,2,_a.FLOAT,false,16,0);e.enableVertexAttribArray(a.a_texCoord);e.vertexAttribPointer(a.a_texCoord,2,_a.FLOAT,false,16,8);e.uniform1i(a.u_texture,0)}e.uniformMatrix4fv(a.u_texCoordMatrix,false,Xf.fromTransform(this.tmpMat4_,this.getTexCoordMatrix()));e.uniformMatrix4fv(a.u_projectionMatrix,false,Xf.fromTransform(this.tmpMat4_,this.getProjectionMatrix()));e.uniform1f(a.u_opacity,i.opacity);e.bindTexture(_a.TEXTURE_2D,this.getTexture());e.drawArrays(_a.TRIANGLE_STRIP,0,4);this.dispatchComposeEvent_(uo.POSTCOMPOSE,s,t)};_u.prototype.dispatchComposeEvent_=function(t,i,s){var e=this.getLayer();if(e.hasListener(t)){var r=s.viewState;var n=r.resolution;var h=s.pixelRatio;var a=s.extent;var o=r.center;var f=r.rotation;var u=s.size;var v=new pu(i,o,n,f,u,a,h);var l=new Wo(t,v,s,null,i);e.dispatchEvent(l)}};_u.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix};_u.prototype.getTexture=function(){return this.texture};_u.prototype.getProjectionMatrix=function(){return this.projectionMatrix};_u.prototype.handleWebGLContextLost=function(){this.texture=null;this.framebuffer=null;this.framebufferDimension=undefined};_u.prototype.prepareFrame=function(t,i,s){};_u.prototype.forEachLayerAtPixel=function(t,i,s,e){};var gu=function(t,i){_u.call(this,t,i);this.image_=null;this.hitCanvasContext_=null;this.hitTransformationMatrix_=null};kh.inherits(gu,_u);gu["handles"]=function(t,i){return t===no.WEBGL&&i.getType()===Fo.IMAGE};gu["create"]=function(t,i){return new gu(t,i)};gu.prototype.createTexture_=function(t){var i=t.getImage();var s=this.mapRenderer.getGL();return Qf.createTexture(s,i,_a.CLAMP_TO_EDGE,_a.CLAMP_TO_EDGE)};gu.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=this.getLayer();var h=n.getSource();var a=i.viewState.resolution;var o=i.viewState.rotation;var f=i.skippedFeatureUids;return h.forEachFeatureAtCoordinate(t,a,o,s,f,(function(t){return e.call(r,t,n)}))};gu.prototype.prepareFrame=function(t,i,s){var e=this.mapRenderer.getGL();var r=t.pixelRatio;var n=t.viewState;var h=n.center;var a=n.resolution;var o=n.rotation;var f=this.image_;var u=this.texture;var v=this.getLayer();var l=v.getSource();var c=t.viewHints;var d=t.extent;if(i.extent!==undefined){d=qh.getIntersection(d,i.extent)}if(!c[Ya.ANIMATING]&&!c[Ya.INTERACTING]&&!qh.isEmpty(d)){var m=n.projection;if(!kh.ENABLE_RASTER_REPROJECTION){var p=l.getProjection();if(p){m=p}}var M=l.getImage(d,a,r,m);if(M){var z=this.loadImage(M);if(z){f=M;u=this.createTexture_(M);if(this.texture){var _=function(t,i){if(!t.isContextLost()){t.deleteTexture(i)}}.bind(null,e,this.texture);t.postRenderFunctions.push(_)}}}}if(f){var g=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(g.width,g.height,r,h,a,o,f.getExtent());this.hitTransformationMatrix_=null;var w=this.texCoordMatrix;sa.reset(w);sa.scale(w,1,-1);sa.translate(w,0,-1);this.image_=f;this.texture=u;this.updateLogos(t,l)}return!!f};gu.prototype.updateProjectionMatrix_=function(t,i,s,e,r,n,h){var a=t*r;var o=i*r;var f=this.projectionMatrix;sa.reset(f);sa.scale(f,s*2/a,s*2/o);sa.rotate(f,-n);sa.translate(f,h[0]-e[0],h[1]-e[1]);sa.scale(f,(h[2]-h[0])/2,(h[3]-h[1])/2);sa.translate(f,1,1)};gu.prototype.hasFeatureAtCoordinate=function(t,i){var s=this.forEachFeatureAtCoordinate(t,i,0,Yh.TRUE,this);return s!==undefined};gu.prototype.forEachLayerAtPixel=function(t,i,s,e){if(!this.image_||!this.image_.getImage()){return undefined}if(this.getLayer().getSource().forEachFeatureAtCoordinate!==kh.nullFunction){var r=sa.apply(i.pixelToCoordinateTransform,t.slice());var n=this.forEachFeatureAtCoordinate(r,i,0,Yh.TRUE,this);if(n){return s.call(e,this.getLayer(),null)}else{return undefined}}else{var h=[this.image_.getImage().width,this.image_.getImage().height];if(!this.hitTransformationMatrix_){this.hitTransformationMatrix_=this.getHitTransformationMatrix_(i.size,h)}var a=sa.apply(this.hitTransformationMatrix_,t.slice());if(a[0]<0||a[0]>h[0]||a[1]<0||a[1]>h[1]){return undefined}if(!this.hitCanvasContext_){this.hitCanvasContext_=$a.createCanvasContext2D(1,1)}this.hitCanvasContext_.clearRect(0,0,1,1);this.hitCanvasContext_.drawImage(this.image_.getImage(),a[0],a[1],1,1,0,0,1,1);var o=this.hitCanvasContext_.getImageData(0,0,1,1).data;if(o[3]>0){return s.call(e,this.getLayer(),o)}else{return undefined}}};gu.prototype.getHitTransformationMatrix_=function(t,i){var s=sa.create();sa.translate(s,-1,-1);sa.scale(s,2/t[0],2/t[1]);sa.translate(s,0,t[1]);sa.scale(s,1,-1);var e=sa.invert(this.projectionMatrix.slice());var r=sa.create();sa.translate(r,0,i[1]);sa.scale(r,1,-1);sa.scale(r,i[0]/2,i[1]/2);sa.translate(r,1,1);sa.multiply(r,e);sa.multiply(r,s);return r};var wu=function(t,i){Qo.call(this,t,i);this.canvas_=document.createElement("CANVAS");this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=fo.CLASS_UNSELECTABLE;t.insertBefore(this.canvas_,t.childNodes[0]||null);this.clipTileCanvasWidth_=0;this.clipTileCanvasHeight_=0;this.clipTileContext_=$a.createCanvasContext2D();this.renderedVisible_=true;this.gl_=_a.getContext(this.canvas_,{antialias:true,depth:true,failIfMajorPerformanceCaveat:true,preserveDrawingBuffer:false,stencil:true});this.context_=new Qf(this.canvas_,this.gl_);Ih.listen(this.canvas_,$f.LOST,this.handleWebGLContextLost,this);Ih.listen(this.canvas_,$f.RESTORED,this.handleWebGLContextRestored,this);this.textureCache_=new jo;this.focus_=null;this.tileTextureQueue_=new ja(function(t){var i=t[1];var s=t[2];var e=i[0]-this.focus_[0];var r=i[1]-this.focus_[1];return 65536*Math.log(s)+Math.sqrt(e*e+r*r)/s}.bind(this),(function(t){return t[0].getKey()}));this.loadNextTileTexture_=function(t,i){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var s=this.tileTextureQueue_.dequeue();var e=s[0];var r=s[3];var n=s[4];this.bindTileTexture(e,r,n,_a.LINEAR,_a.LINEAR)}return false}.bind(this);this.textureCacheFrameMarkerCount_=0;this.initializeGL_()};kh.inherits(wu,Qo);wu["handles"]=function(t){return ga.WEBGL&&t===no.WEBGL};wu["create"]=function(t,i){return new wu(t,i)};wu.prototype.bindTileTexture=function(t,i,s,e,r){var n=this.getGL();var h=t.getKey();if(this.textureCache_.containsKey(h)){var a=this.textureCache_.get(h);n.bindTexture(_a.TEXTURE_2D,a.texture);if(a.magFilter!=e){n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_MAG_FILTER,e);a.magFilter=e}if(a.minFilter!=r){n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_MIN_FILTER,r);a.minFilter=r}}else{var o=n.createTexture();n.bindTexture(_a.TEXTURE_2D,o);if(s>0){var f=this.clipTileContext_.canvas;var u=this.clipTileContext_;if(this.clipTileCanvasWidth_!==i[0]||this.clipTileCanvasHeight_!==i[1]){f.width=i[0];f.height=i[1];this.clipTileCanvasWidth_=i[0];this.clipTileCanvasHeight_=i[1]}else{u.clearRect(0,0,i[0],i[1])}u.drawImage(t.getImage(),s,s,i[0],i[1],0,0,i[0],i[1]);n.texImage2D(_a.TEXTURE_2D,0,_a.RGBA,_a.RGBA,_a.UNSIGNED_BYTE,f)}else{n.texImage2D(_a.TEXTURE_2D,0,_a.RGBA,_a.RGBA,_a.UNSIGNED_BYTE,t.getImage())}n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_MAG_FILTER,e);n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_MIN_FILTER,r);n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_WRAP_S,_a.CLAMP_TO_EDGE);n.texParameteri(_a.TEXTURE_2D,_a.TEXTURE_WRAP_T,_a.CLAMP_TO_EDGE);this.textureCache_.set(h,{texture:o,magFilter:e,minFilter:r})}};wu.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();if(s.hasListener(t)){var e=this.context_;var r=i.extent;var n=i.size;var h=i.viewState;var a=i.pixelRatio;var o=h.resolution;var f=h.center;var u=h.rotation;var v=new pu(e,f,o,u,n,r,a);var l=new Wo(t,v,i,null,e);s.dispatchEvent(l)}};wu.prototype.disposeInternal=function(){var t=this.getGL();if(!t.isContextLost()){this.textureCache_.forEach((function(i){if(i){t.deleteTexture(i.texture)}}))}this.context_.dispose();Qo.prototype.disposeInternal.call(this)};wu.prototype.expireCache_=function(t,i){var s=this.getGL();var e;while(this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>kh.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK){e=this.textureCache_.peekLast();if(!e){if(+this.textureCache_.peekLastKey()==i.index){break}else{--this.textureCacheFrameMarkerCount_}}else{s.deleteTexture(e.texture)}this.textureCache_.pop()}};wu.prototype.getContext=function(){return this.context_};wu.prototype.getGL=function(){return this.gl_};wu.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_};wu.prototype.getType=function(){return no.WEBGL};wu.prototype.handleWebGLContextLost=function(t){t.preventDefault();this.textureCache_.clear();this.textureCacheFrameMarkerCount_=0;var i=this.getLayerRenderers();for(var s in i){var e=i[s];e.handleWebGLContextLost()}};wu.prototype.handleWebGLContextRestored=function(){this.initializeGL_();this.getMap().render()};wu.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(_a.TEXTURE0);t.blendFuncSeparate(_a.SRC_ALPHA,_a.ONE_MINUS_SRC_ALPHA,_a.ONE,_a.ONE_MINUS_SRC_ALPHA);t.disable(_a.CULL_FACE);t.disable(_a.DEPTH_TEST);t.disable(_a.SCISSOR_TEST);t.disable(_a.STENCIL_TEST)};wu.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())};wu.prototype.renderFrame=function(t){var i=this.getContext();var s=this.getGL();if(s.isContextLost()){return false}if(!t){if(this.renderedVisible_){this.canvas_.style.display="none";this.renderedVisible_=false}return false}this.focus_=t.focus;this.textureCache_.set((-t.index).toString(),null);++this.textureCacheFrameMarkerCount_;this.dispatchComposeEvent_(uo.PRECOMPOSE,t);var e=[];var r=t.layerStatesArray;jh.stableSort(r,Qo.sortByZIndex);var n=t.viewState.resolution;var h,a,o,f;for(h=0,a=r.length;h<a;++h){f=r[h];if(vo.visibleAtResolution(f,n)&&f.sourceState==io.READY){o=this.getLayerRenderer(f.layer);if(o.prepareFrame(t,f,i)){e.push(f)}}}var u=t.size[0]*t.pixelRatio;var v=t.size[1]*t.pixelRatio;if(this.canvas_.width!=u||this.canvas_.height!=v){this.canvas_.width=u;this.canvas_.height=v}s.bindFramebuffer(_a.FRAMEBUFFER,null);s.clearColor(0,0,0,0);s.clear(_a.COLOR_BUFFER_BIT);s.enable(_a.BLEND);s.viewport(0,0,this.canvas_.width,this.canvas_.height);for(h=0,a=e.length;h<a;++h){f=e[h];o=this.getLayerRenderer(f.layer);o.composeFrame(t,f,i)}if(!this.renderedVisible_){this.canvas_.style.display="";this.renderedVisible_=true}this.calculateMatrices2D(t);if(this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>kh.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK){t.postRenderFunctions.push(this.expireCache_.bind(this))}if(!this.tileTextureQueue_.isEmpty()){t.postRenderFunctions.push(this.loadNextTileTexture_);t.animate=true}this.dispatchComposeEvent_(uo.POSTCOMPOSE,t);this.scheduleRemoveUnusedLayerRenderers(t);this.scheduleExpireIconCache(t)};wu.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){var a;if(this.getGL().isContextLost()){return false}var o=i.viewState;var f=i.layerStatesArray;var u=f.length;var v;for(v=u-1;v>=0;--v){var l=f[v];var c=l.layer;if(vo.visibleAtResolution(l,o.resolution)&&n.call(h,c)){var d=this.getLayerRenderer(c);a=d.forEachFeatureAtCoordinate(t,i,s,e,r);if(a){return a}}}return undefined};wu.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r){var n=false;if(this.getGL().isContextLost()){return false}var h=i.viewState;var a=i.layerStatesArray;var o=a.length;var f;for(f=o-1;f>=0;--f){var u=a[f];var v=u.layer;if(vo.visibleAtResolution(u,h.resolution)&&e.call(r,v)){var l=this.getLayerRenderer(v);n=l.hasFeatureAtCoordinate(t,i);if(n){return true}}}return n};wu.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){if(this.getGL().isContextLost()){return false}var h=i.viewState;var a;var o=i.layerStatesArray;var f=o.length;var u;for(u=f-1;u>=0;--u){var v=o[u];var l=v.layer;if(vo.visibleAtResolution(v,h.resolution)&&r.call(e,l)){var c=this.getLayerRenderer(l);a=c.forEachLayerAtPixel(t,i,s,e);if(a){return a}}}return undefined};var yu={};yu.fragment=new jf(kh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n":"precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}");yu.vertex=new Vf(kh.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}");var bu=function(t,i){this.u_tileOffset=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_tileOffset":"d");this.u_texture=t.getUniformLocation(i,kh.DEBUG_WEBGL?"u_texture":"e");this.a_position=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_position":"b");this.a_texCoord=t.getAttribLocation(i,kh.DEBUG_WEBGL?"a_texCoord":"c")};var xu=function(t,i){_u.call(this,t,i);this.fragmentShader_=yu.fragment;this.vertexShader_=yu.vertex;this.locations_=null;this.renderArrayBuffer_=new Hf([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]);this.renderedTileRange_=null;this.renderedFramebufferExtent_=null;this.renderedRevision_=-1;this.tmpSize_=[0,0]};kh.inherits(xu,_u);xu["handles"]=function(t,i){return t===no.WEBGL&&i.getType()===Fo.TILE};xu["create"]=function(t,i){return new xu(t,i)};xu.prototype.disposeInternal=function(){var t=this.mapRenderer.getContext();t.deleteBuffer(this.renderArrayBuffer_);_u.prototype.disposeInternal.call(this)};xu.prototype.createLoadedTileFinder=function(t,i,s){var e=this.mapRenderer;return function(r,n){function h(t){var i=e.isTileTextureLoaded(t);if(i){if(!s[r]){s[r]={}}s[r][t.tileCoord.toString()]=t}return i}return t.forEachLoadedTile(i,r,n,h)}};xu.prototype.handleWebGLContextLost=function(){_u.prototype.handleWebGLContextLost.call(this);this.locations_=null};xu.prototype.prepareFrame=function(t,i,s){var e=this.mapRenderer;var r=s.getGL();var n=t.viewState;var h=n.projection;var a=this.getLayer();var o=a.getSource();var f=o.getTileGridForProjection(h);var u=f.getZForResolution(n.resolution);var v=f.getResolution(u);var l=o.getTilePixelSize(u,t.pixelRatio,h);var c=l[0]/ho.toSize(f.getTileSize(u),this.tmpSize_)[0];var d=v/c;var m=o.getTilePixelRatio(c)*o.getGutter(h);var p=n.center;var M=t.extent;var z=f.getTileRangeForExtentAndZ(M,u);var _;if(this.renderedTileRange_&&this.renderedTileRange_.equals(z)&&this.renderedRevision_==o.getRevision()){_=this.renderedFramebufferExtent_}else{var g=z.getSize();var w=Math.max(g[0]*l[0],g[1]*l[1]);var y=Fh.roundUpToPowerOfTwo(w);var b=d*y;var x=f.getOrigin(u);var k=x[0]+z.minX*l[0]*d;var E=x[1]+z.minY*l[1]*d;_=[k,E,k+b,E+b];this.bindFramebuffer(t,y);r.viewport(0,0,y,y);r.clearColor(0,0,0,0);r.clear(_a.COLOR_BUFFER_BIT);r.disable(_a.BLEND);var N=s.getProgram(this.fragmentShader_,this.vertexShader_);s.useProgram(N);if(!this.locations_){this.locations_=new bu(r,N)}s.bindBuffer(_a.ARRAY_BUFFER,this.renderArrayBuffer_);r.enableVertexAttribArray(this.locations_.a_position);r.vertexAttribPointer(this.locations_.a_position,2,_a.FLOAT,false,16,0);r.enableVertexAttribArray(this.locations_.a_texCoord);r.vertexAttribPointer(this.locations_.a_texCoord,2,_a.FLOAT,false,16,8);r.uniform1i(this.locations_.u_texture,0);var C={};C[u]={};var I=this.createLoadedTileFinder(o,h,C);var S=a.getUseInterimTilesOnError();var O=true;var T=qh.createEmpty();var A=new sf(0,0,0,0);var R,P,L,D,F;var G,W,j;for(G=z.minX;G<=z.maxX;++G){for(W=z.minY;W<=z.maxY;++W){D=o.getTile(u,G,W,c,h);if(i.extent!==undefined){j=f.getTileCoordExtent(D.tileCoord,T);if(!qh.intersects(j,i.extent)){continue}}F=D.getState();P=F==Wa.LOADED||F==Wa.EMPTY||F==Wa.ERROR&&!S;if(!P){D=D.getInterimTile()}F=D.getState();if(F==Wa.LOADED){if(e.isTileTextureLoaded(D)){C[u][D.tileCoord.toString()]=D;continue}}else if(F==Wa.EMPTY||F==Wa.ERROR&&!S){continue}O=false;L=f.forEachTileCoordParentTileRange(D.tileCoord,I,null,A,T);if(!L){R=f.getTileCoordChildTileRange(D.tileCoord,A,T);if(R){I(u+1,R)}}}}var V=Object.keys(C).map(Number);V.sort(jh.numberSafeCompareFunction);var U=new Float32Array(4);var q,X,Y,B;for(q=0,X=V.length;q<X;++q){B=C[V[q]];for(Y in B){D=B[Y];j=f.getTileCoordExtent(D.tileCoord,T);U[0]=2*(j[2]-j[0])/b;U[1]=2*(j[3]-j[1])/b;U[2]=2*(j[0]-_[0])/b-1;U[3]=2*(j[1]-_[1])/b-1;r.uniform4fv(this.locations_.u_tileOffset,U);e.bindTileTexture(D,l,m*c,_a.LINEAR,_a.LINEAR);r.drawArrays(_a.TRIANGLE_STRIP,0,4)}}if(O){this.renderedTileRange_=z;this.renderedFramebufferExtent_=_;this.renderedRevision_=o.getRevision()}else{this.renderedTileRange_=null;this.renderedFramebufferExtent_=null;this.renderedRevision_=-1;t.animate=true}}this.updateUsedTiles(t.usedTiles,o,u,z);var H=e.getTileTextureQueue();this.manageTilePyramid(t,o,f,c,h,M,u,a.getPreload(),(function(t){if(t.getState()==Wa.LOADED&&!e.isTileTextureLoaded(t)&&!H.isKeyQueued(t.getKey())){H.enqueue([t,f.getTileCoordCenter(t.tileCoord),f.getResolution(t.tileCoord[0]),l,m*c])}}),this);this.scheduleExpireCache(t,o);this.updateLogos(t,o);var J=this.texCoordMatrix;sa.reset(J);sa.translate(J,(Math.round(p[0]/v)*v-_[0])/(_[2]-_[0]),(Math.round(p[1]/v)*v-_[1])/(_[3]-_[1]));if(n.rotation!==0){sa.rotate(J,n.rotation)}sa.scale(J,t.size[0]*n.resolution/(_[2]-_[0]),t.size[1]*n.resolution/(_[3]-_[1]));sa.translate(J,-.5,-.5);return true};xu.prototype.forEachLayerAtPixel=function(t,i,s,e){if(!this.framebuffer){return undefined}var r=[t[0]/i.size[0],(i.size[1]-t[1])/i.size[1]];var n=sa.apply(this.texCoordMatrix,r.slice());var h=[n[0]*this.framebufferDimension,n[1]*this.framebufferDimension];var a=this.mapRenderer.getContext().getGL();a.bindFramebuffer(a.FRAMEBUFFER,this.framebuffer);var o=new Uint8Array(4);a.readPixels(h[0],h[1],1,1,a.RGBA,a.UNSIGNED_BYTE,o);if(o[3]>0){return s.call(e,this.getLayer(),o)}else{return undefined}};var ku=function(t,i){_u.call(this,t,i);this.dirty_=false;this.renderedRevision_=-1;this.renderedResolution_=NaN;this.renderedExtent_=qh.createEmpty();this.renderedRenderOrder_=null;this.replayGroup_=null;this.layerState_=null};kh.inherits(ku,_u);ku["handles"]=function(t,i){return t===no.WEBGL&&i.getType()===Fo.VECTOR};ku["create"]=function(t,i){return new ku(t,i)};ku.prototype.composeFrame=function(t,i,s){this.layerState_=i;var e=t.viewState;var r=this.replayGroup_;var n=t.size;var h=t.pixelRatio;var a=this.mapRenderer.getGL();if(r&&!r.isEmpty()){a.enable(a.SCISSOR_TEST);a.scissor(0,0,n[0]*h,n[1]*h);r.replay(s,e.center,e.resolution,e.rotation,n,h,i.opacity,i.managed?t.skippedFeatureUids:{});a.disable(a.SCISSOR_TEST)}};ku.prototype.disposeInternal=function(){var t=this.replayGroup_;if(t){var i=this.mapRenderer.getContext();t.getDeleteResourcesFunction(i)();this.replayGroup_=null}_u.prototype.disposeInternal.call(this)};ku.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(!this.replayGroup_||!this.layerState_){return undefined}else{var n=this.mapRenderer.getContext();var h=i.viewState;var a=this.getLayer();var o=this.layerState_;var f={};return this.replayGroup_.forEachFeatureAtCoordinate(t,n,h.center,h.resolution,h.rotation,i.size,i.pixelRatio,o.opacity,{},(function(t){var i=kh.getUid(t).toString();if(!(i in f)){f[i]=true;return e.call(r,t,a)}}))}};ku.prototype.hasFeatureAtCoordinate=function(t,i){if(!this.replayGroup_||!this.layerState_){return false}else{var s=this.mapRenderer.getContext();var e=i.viewState;var r=this.layerState_;return this.replayGroup_.hasFeatureAtCoordinate(t,s,e.center,e.resolution,e.rotation,i.size,i.pixelRatio,r.opacity,i.skippedFeatureUids)}};ku.prototype.forEachLayerAtPixel=function(t,i,s,e){var r=sa.apply(i.pixelToCoordinateTransform,t.slice());var n=this.hasFeatureAtCoordinate(r,i);if(n){return s.call(e,this.getLayer(),null)}else{return undefined}};ku.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};ku.prototype.prepareFrame=function(t,i,s){var e=this.getLayer();var r=e.getSource();this.updateLogos(t,r);var n=t.viewHints[Ya.ANIMATING];var h=t.viewHints[Ya.INTERACTING];var a=e.getUpdateWhileAnimating();var o=e.getUpdateWhileInteracting();if(!this.dirty_&&(!a&&n)||!o&&h){return true}var f=t.extent;var u=t.viewState;var v=u.projection;var l=u.resolution;var c=t.pixelRatio;var d=e.getRevision();var m=e.getRenderBuffer();var p=e.getRenderOrder();if(p===undefined){p=Lf.defaultOrder}var M=qh.buffer(f,m*l);if(!this.dirty_&&this.renderedResolution_==l&&this.renderedRevision_==d&&this.renderedRenderOrder_==p&&qh.containsExtent(this.renderedExtent_,M)){return true}if(this.replayGroup_){t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(s))}this.dirty_=false;var z=new mu(Lf.getTolerance(l,c),M,e.getRenderBuffer());r.loadFeatures(M,l,v);var _=function(t){var i;var s=t.getStyleFunction();if(s){i=s.call(t,l)}else{s=e.getStyleFunction();if(s){i=s(t,l)}}if(i){var r=this.renderFeature(t,l,c,i,z);this.dirty_=this.dirty_||r}};if(p){var g=[];r.forEachFeatureInExtent(M,(function(t){g.push(t)}),this);g.sort(p);g.forEach(_,this)}else{r.forEachFeatureInExtent(M,_,this)}z.finish(s);this.renderedResolution_=l;this.renderedRevision_=d;this.renderedRenderOrder_=p;this.renderedExtent_=M;this.replayGroup_=z;return true};ku.prototype.renderFeature=function(t,i,s,e,r){if(!e){return false}var n=false;if(Array.isArray(e)){for(var h=e.length-1,a=0;h>=a;--h){n=Lf.renderFeature(r,t,e[h],Lf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}}else{n=Lf.renderFeature(r,t,e,Lf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}return n};if(kh.ENABLE_CANVAS){ro.register(eo.MAP_RENDERER,tf);ro.registerMultiple(eo.LAYER_RENDERER,[Zo,ef,Df,Gf])}if(kh.ENABLE_WEBGL){ro.register(eo.MAP_RENDERER,wu);ro.registerMultiple(eo.LAYER_RENDERER,[gu,xu,ku])}var Eu=function(t){t=Ch.assign({},t);if(!t.controls){t.controls=po.defaults()}if(!t.interactions){t.interactions=Ro.defaults()}ao.call(this,t)};kh.inherits(Eu,ao);var Nu={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"};var Cu=function(t){Ph.call(this);this.options=t;this.id=t.id;this.insertFirst=t.insertFirst!==undefined?t.insertFirst:true;this.stopEvent=t.stopEvent!==undefined?t.stopEvent:true;this.element=document.createElement("DIV");this.element.className=t.className!==undefined?t.className:"ol-overlay-container "+fo.CLASS_SELECTABLE;this.element.style.position="absolute";this.autoPan=t.autoPan!==undefined?t.autoPan:false;this.autoPanAnimation=t.autoPanAnimation||{};this.autoPanMargin=t.autoPanMargin!==undefined?t.autoPanMargin:20;this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:true};this.mapPostrenderListenerKey=null;Ih.listen(this,Ph.getChangeEventType(Cu.Property.ELEMENT),this.handleElementChanged,this);Ih.listen(this,Ph.getChangeEventType(Cu.Property.MAP),this.handleMapChanged,this);Ih.listen(this,Ph.getChangeEventType(Cu.Property.OFFSET),this.handleOffsetChanged,this);Ih.listen(this,Ph.getChangeEventType(Cu.Property.POSITION),this.handlePositionChanged,this);Ih.listen(this,Ph.getChangeEventType(Cu.Property.POSITIONING),this.handlePositioningChanged,this);if(t.element!==undefined){this.setElement(t.element)}this.setOffset(t.offset!==undefined?t.offset:[0,0]);this.setPositioning(t.positioning!==undefined?t.positioning:Nu.TOP_LEFT);if(t.position!==undefined){this.setPosition(t.position)}};kh.inherits(Cu,Ph);Cu.prototype.getElement=function(){return this.get(Cu.Property.ELEMENT)};Cu.prototype.getId=function(){return this.id};Cu.prototype.getMap=function(){return this.get(Cu.Property.MAP)};Cu.prototype.getOffset=function(){return this.get(Cu.Property.OFFSET)};Cu.prototype.getPosition=function(){return this.get(Cu.Property.POSITION)};Cu.prototype.getPositioning=function(){return this.get(Cu.Property.POSITIONING)};Cu.prototype.handleElementChanged=function(){$a.removeChildren(this.element);var t=this.getElement();if(t){this.element.appendChild(t)}};Cu.prototype.handleMapChanged=function(){if(this.mapPostrenderListenerKey){$a.removeNode(this.element);Ih.unlistenByKey(this.mapPostrenderListenerKey);this.mapPostrenderListenerKey=null}var t=this.getMap();if(t){this.mapPostrenderListenerKey=Ih.listen(t,Fa.POSTRENDER,this.render,this);this.updatePixelPosition();var i=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();if(this.insertFirst){i.insertBefore(this.element,i.childNodes[0]||null)}else{i.appendChild(this.element)}}};Cu.prototype.render=function(){this.updatePixelPosition()};Cu.prototype.handleOffsetChanged=function(){this.updatePixelPosition()};Cu.prototype.handlePositionChanged=function(){this.updatePixelPosition();if(this.get(Cu.Property.POSITION)&&this.autoPan){this.panIntoView()}};Cu.prototype.handlePositioningChanged=function(){this.updatePixelPosition()};Cu.prototype.setElement=function(t){this.set(Cu.Property.ELEMENT,t)};Cu.prototype.setMap=function(t){this.set(Cu.Property.MAP,t)};Cu.prototype.setOffset=function(t){this.set(Cu.Property.OFFSET,t)};Cu.prototype.setPosition=function(t){this.set(Cu.Property.POSITION,t)};Cu.prototype.panIntoView=function(){var t=this.getMap();if(!t||!t.getTargetElement()){return}var i=this.getRect(t.getTargetElement(),t.getSize());var s=this.getElement();var e=this.getRect(s,[$a.outerWidth(s),$a.outerHeight(s)]);var r=this.autoPanMargin;if(!qh.containsExtent(i,e)){var n=e[0]-i[0];var h=i[2]-e[2];var a=e[1]-i[1];var o=i[3]-e[3];var f=[0,0];if(n<0){f[0]=n-r}else if(h<0){f[0]=Math.abs(h)+r}if(a<0){f[1]=a-r}else if(o<0){f[1]=Math.abs(o)+r}if(f[0]!==0||f[1]!==0){var u=t.getView().getCenter();var v=t.getPixelFromCoordinate(u);var l=[v[0]+f[0],v[1]+f[1]];t.getView().animate({center:t.getCoordinateFromPixel(l),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}};Cu.prototype.getRect=function(t,i){var s=t.getBoundingClientRect();var e=s.left+window.pageXOffset;var r=s.top+window.pageYOffset;return[e,r,e+i[0],r+i[1]]};Cu.prototype.setPositioning=function(t){this.set(Cu.Property.POSITIONING,t)};Cu.prototype.setVisible=function(t){if(this.rendered.visible!==t){this.element.style.display=t?"":"none";this.rendered.visible=t}};Cu.prototype.updatePixelPosition=function(){var t=this.getMap();var i=this.getPosition();if(!t||!t.isRendered()||!i){this.setVisible(false);return}var s=t.getPixelFromCoordinate(i);var e=t.getSize();this.updateRenderedPosition(s,e)};Cu.prototype.updateRenderedPosition=function(t,i){var s=this.element.style;var e=this.getOffset();var r=this.getPositioning();this.setVisible(true);var n=e[0];var h=e[1];if(r==Nu.BOTTOM_RIGHT||r==Nu.CENTER_RIGHT||r==Nu.TOP_RIGHT){if(this.rendered.left_!==""){this.rendered.left_=s.left=""}var a=Math.round(i[0]-t[0]-n)+"px";if(this.rendered.right_!=a){this.rendered.right_=s.right=a}}else{if(this.rendered.right_!==""){this.rendered.right_=s.right=""}if(r==Nu.BOTTOM_CENTER||r==Nu.CENTER_CENTER||r==Nu.TOP_CENTER){n-=this.element.offsetWidth/2}var o=Math.round(t[0]+n)+"px";if(this.rendered.left_!=o){this.rendered.left_=s.left=o}}if(r==Nu.BOTTOM_LEFT||r==Nu.BOTTOM_CENTER||r==Nu.BOTTOM_RIGHT){if(this.rendered.top_!==""){this.rendered.top_=s.top=""}var f=Math.round(i[1]-t[1]-h)+"px";if(this.rendered.bottom_!=f){this.rendered.bottom_=s.bottom=f}}else{if(this.rendered.bottom_!==""){this.rendered.bottom_=s.bottom=""}if(r==Nu.CENTER_LEFT||r==Nu.CENTER_CENTER||r==Nu.CENTER_RIGHT){h-=this.element.offsetHeight/2}var u=Math.round(t[1]+h)+"px";if(this.rendered.top_!=u){this.rendered.top_=s.top=u}}};Cu.prototype.getOptions=function(){return this.options};Cu.Property={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};var Iu=function(t){this.opacity_=t.opacity;this.rotateWithView_=t.rotateWithView;this.rotation_=t.rotation;this.scale_=t.scale;this.snapToPixel_=t.snapToPixel};Iu.prototype.getOpacity=function(){return this.opacity_};Iu.prototype.getRotateWithView=function(){return this.rotateWithView_};Iu.prototype.getRotation=function(){return this.rotation_};Iu.prototype.getScale=function(){return this.scale_};Iu.prototype.getSnapToPixel=function(){return this.snapToPixel_};Iu.prototype.getAnchor=function(){};Iu.prototype.getImage=function(t){};Iu.prototype.getHitDetectionImage=function(t){};Iu.prototype.getImageState=function(){};Iu.prototype.getImageSize=function(){};Iu.prototype.getHitDetectionImageSize=function(){};Iu.prototype.getOrigin=function(){};Iu.prototype.getSize=function(){};Iu.prototype.setOpacity=function(t){this.opacity_=t};Iu.prototype.setRotateWithView=function(t){this.rotateWithView_=t};Iu.prototype.setRotation=function(t){this.rotation_=t};Iu.prototype.setScale=function(t){this.scale_=t};Iu.prototype.setSnapToPixel=function(t){this.snapToPixel_=t};Iu.prototype.listenImageChange=function(t,i){};Iu.prototype.load=function(){};Iu.prototype.unlistenImageChange=function(t,i){};var Su=function(t){this.checksums_=null;this.canvas_=null;this.hitDetectionCanvas_=null;this.fill_=t.fill!==undefined?t.fill:null;this.origin_=[0,0];this.points_=t.points;this.radius_=t.radius!==undefined?t.radius:t.radius1;this.radius2_=t.radius2;this.angle_=t.angle!==undefined?t.angle:0;this.stroke_=t.stroke!==undefined?t.stroke:null;this.anchor_=null;this.size_=null;this.imageSize_=null;this.hitDetectionImageSize_=null;this.atlasManager_=t.atlasManager;this.render_(this.atlasManager_);var i=t.snapToPixel!==undefined?t.snapToPixel:true;var s=t.rotateWithView!==undefined?t.rotateWithView:false;Iu.call(this,{opacity:1,rotateWithView:s,rotation:t.rotation!==undefined?t.rotation:0,scale:1,snapToPixel:i})};kh.inherits(Su,Iu);Su.prototype.clone=function(){var t=new Su({fill:this.getFill()?this.getFill().clone():undefined,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():undefined,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});t.setOpacity(this.getOpacity());t.setScale(this.getScale());return t};Su.prototype.getAnchor=function(){return this.anchor_};Su.prototype.getAngle=function(){return this.angle_};Su.prototype.getFill=function(){return this.fill_};Su.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_};Su.prototype.getImage=function(t){return this.canvas_};Su.prototype.getImageSize=function(){return this.imageSize_};Su.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_};Su.prototype.getImageState=function(){return Lo.LOADED};Su.prototype.getOrigin=function(){return this.origin_};Su.prototype.getPoints=function(){return this.points_};Su.prototype.getRadius=function(){return this.radius_};Su.prototype.getRadius2=function(){return this.radius2_};Su.prototype.getSize=function(){return this.size_};Su.prototype.getStroke=function(){return this.stroke_};Su.prototype.listenImageChange=function(t,i){};Su.prototype.load=function(){};Su.prototype.unlistenImageChange=function(t,i){};Su.prototype.render_=function(t){var i;var s="";var e="";var r=0;var n=null;var h=0;var a;var o=0;if(this.stroke_){a=this.stroke_.getColor();if(a===null){a=Vo.defaultStrokeStyle}a=qo.asColorLike(a);o=this.stroke_.getWidth();if(o===undefined){o=Vo.defaultLineWidth}n=this.stroke_.getLineDash();h=this.stroke_.getLineDashOffset();if(!ga.CANVAS_LINE_DASH){n=null;h=0}e=this.stroke_.getLineJoin();if(e===undefined){e=Vo.defaultLineJoin}s=this.stroke_.getLineCap();if(s===undefined){s=Vo.defaultLineCap}r=this.stroke_.getMiterLimit();if(r===undefined){r=Vo.defaultMiterLimit}}var f=2*(this.radius_+o)+1;var u={strokeStyle:a,strokeWidth:o,size:f,lineCap:s,lineDash:n,lineDashOffset:h,lineJoin:e,miterLimit:r};if(t===undefined){var v=$a.createCanvasContext2D(f,f);this.canvas_=v.canvas;f=this.canvas_.width;i=f;this.draw_(u,v,0,0);this.createHitDetectionCanvas_(u)}else{f=Math.round(f);var l=!this.fill_;var c;if(l){c=this.drawHitDetectionCanvas_.bind(this,u)}var d=this.getChecksum();var m=t.add(d,f,f,this.draw_.bind(this,u),c);this.canvas_=m.image;this.origin_=[m.offsetX,m.offsetY];i=m.image.width;if(l){this.hitDetectionCanvas_=m.hitImage;this.hitDetectionImageSize_=[m.hitImage.width,m.hitImage.height]}else{this.hitDetectionCanvas_=this.canvas_;this.hitDetectionImageSize_=[i,i]}}this.anchor_=[f/2,f/2];this.size_=[f,f];this.imageSize_=[i,i]};Su.prototype.draw_=function(t,i,s,e){var r,n,h;i.setTransform(1,0,0,1,0,0);i.translate(s,e);i.beginPath();var a=this.points_;if(a===Infinity){i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,true)}else{var o=this.radius2_!==undefined?this.radius2_:this.radius_;if(o!==this.radius_){a=2*a}for(r=0;r<=a;r++){n=r*2*Math.PI/a-Math.PI/2+this.angle_;h=r%2===0?this.radius_:o;i.lineTo(t.size/2+h*Math.cos(n),t.size/2+h*Math.sin(n))}}if(this.fill_){var f=this.fill_.getColor();if(f===null){f=Vo.defaultFillStyle}i.fillStyle=qo.asColorLike(f);i.fill()}if(this.stroke_){i.strokeStyle=t.strokeStyle;i.lineWidth=t.strokeWidth;if(t.lineDash){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.lineCap=t.lineCap;i.lineJoin=t.lineJoin;i.miterLimit=t.miterLimit;i.stroke()}i.closePath()};Su.prototype.createHitDetectionCanvas_=function(t){this.hitDetectionImageSize_=[t.size,t.size];if(this.fill_){this.hitDetectionCanvas_=this.canvas_;return}var i=$a.createCanvasContext2D(t.size,t.size);this.hitDetectionCanvas_=i.canvas;this.drawHitDetectionCanvas_(t,i,0,0)};Su.prototype.drawHitDetectionCanvas_=function(t,i,s,e){i.setTransform(1,0,0,1,0,0);i.translate(s,e);i.beginPath();var r=this.points_;if(r===Infinity){i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,true)}else{var n=this.radius2_!==undefined?this.radius2_:this.radius_;if(n!==this.radius_){r=2*r}var h,a,o;for(h=0;h<=r;h++){o=h*2*Math.PI/r-Math.PI/2+this.angle_;a=h%2===0?this.radius_:n;i.lineTo(t.size/2+a*Math.cos(o),t.size/2+a*Math.sin(o))}}i.fillStyle=Vo.defaultFillStyle;i.fill();if(this.stroke_){i.strokeStyle=t.strokeStyle;i.lineWidth=t.strokeWidth;if(t.lineDash){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.stroke()}i.closePath()};Su.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-";var i=this.fill_?this.fill_.getChecksum():"-";var s=!this.checksums_||(t!=this.checksums_[1]||i!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]);if(s){var e="r"+t+i+(this.radius_!==undefined?this.radius_.toString():"-")+(this.radius2_!==undefined?this.radius2_.toString():"-")+(this.angle_!==undefined?this.angle_.toString():"-")+(this.points_!==undefined?this.points_.toString():"-");this.checksums_=[e,t,i,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]};var Ou=function(t){var i=t||{};Su.call(this,{points:Infinity,fill:i.fill,radius:i.radius,snapToPixel:i.snapToPixel,stroke:i.stroke,atlasManager:i.atlasManager})};kh.inherits(Ou,Su);Ou.prototype.clone=function(){var t=new Ou({fill:this.getFill()?this.getFill().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});t.setOpacity(this.getOpacity());t.setScale(this.getScale());return t};Ou.prototype.setRadius=function(t){this.radius_=t;this.render_(this.atlasManager_)};var Tu=function(t){var i=t||{};this.color_=i.color!==undefined?i.color:null;this.checksum_=undefined};Tu.prototype.clone=function(){var t=this.getColor();return new Tu({color:t&&t.slice?t.slice():t||undefined})};Tu.prototype.getColor=function(){return this.color_};Tu.prototype.setColor=function(t){this.color_=t;this.checksum_=undefined};Tu.prototype.getChecksum=function(){if(this.checksum_===undefined){if(this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient){this.checksum_=kh.getUid(this.color_).toString()}else{this.checksum_="f"+(this.color_?Uo.asString(this.color_):"-")}}return this.checksum_};var Au=function(t){var i=t||{};this.geometry_=null;this.geometryFunction_=Au.defaultGeometryFunction;if(i.geometry!==undefined){this.setGeometry(i.geometry)}this.fill_=i.fill!==undefined?i.fill:null;this.image_=i.image!==undefined?i.image:null;this.renderer_=i.renderer!==undefined?i.renderer:null;this.stroke_=i.stroke!==undefined?i.stroke:null;this.text_=i.text!==undefined?i.text:null;this.zIndex_=i.zIndex};Au.prototype.clone=function(){var t=this.getGeometry();if(t&&t.clone){t=t.clone()}return new Au({geometry:t,fill:this.getFill()?this.getFill().clone():undefined,image:this.getImage()?this.getImage().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,text:this.getText()?this.getText().clone():undefined,zIndex:this.getZIndex()})};Au.prototype.getRenderer=function(){return this.renderer_};Au.prototype.setRenderer=function(t){this.renderer_=t};Au.prototype.getGeometry=function(){return this.geometry_};Au.prototype.getGeometryFunction=function(){return this.geometryFunction_};Au.prototype.getFill=function(){return this.fill_};Au.prototype.setFill=function(t){this.fill_=t};Au.prototype.getImage=function(){return this.image_};Au.prototype.setImage=function(t){this.image_=t};Au.prototype.getStroke=function(){return this.stroke_};Au.prototype.setStroke=function(t){this.stroke_=t};Au.prototype.getText=function(){return this.text_};Au.prototype.setText=function(t){this.text_=t};Au.prototype.getZIndex=function(){return this.zIndex_};Au.prototype.setGeometry=function(t){if(typeof t==="function"){this.geometryFunction_=t}else if(typeof t==="string"){this.geometryFunction_=function(i){return i.get(t)}}else if(!t){this.geometryFunction_=Au.defaultGeometryFunction}else if(t!==undefined){this.geometryFunction_=function(){return t}}this.geometry_=t};Au.prototype.setZIndex=function(t){this.zIndex_=t};Au.createFunction=function(t){var i;if(typeof t==="function"){i=t}else{var s;if(Array.isArray(t)){s=t}else{Dh.assert(t instanceof Au,41);s=[t]}i=function(){return s}}return i};Au.default_=null;Au.defaultFunction=function(t,i){if(!Au.default_){var s=new Tu({color:"rgba(255,255,255,0.4)"});var e=new ou({color:"#3399CC",width:1.25});Au.default_=[new Au({image:new Ou({fill:s,stroke:e,radius:5}),fill:s,stroke:e})]}return Au.default_};Au.createDefaultEditing=function(){var t={};var i=[255,255,255,1];var s=[0,153,255,1];var e=3;t[Gh.POLYGON]=[new Au({fill:new Tu({color:[255,255,255,.5]})})];t[Gh.MULTI_POLYGON]=t[Gh.POLYGON];t[Gh.LINE_STRING]=[new Au({stroke:new ou({color:i,width:e+2})}),new Au({stroke:new ou({color:s,width:e})})];t[Gh.MULTI_LINE_STRING]=t[Gh.LINE_STRING];t[Gh.CIRCLE]=t[Gh.POLYGON].concat(t[Gh.LINE_STRING]);t[Gh.POINT]=[new Au({image:new Ou({radius:e*2,fill:new Tu({color:s}),stroke:new ou({color:i,width:e/2})}),zIndex:Infinity})];t[Gh.MULTI_POINT]=t[Gh.POINT];t[Gh.GEOMETRY_COLLECTION]=t[Gh.POLYGON].concat(t[Gh.LINE_STRING],t[Gh.POINT]);return t};Au.defaultGeometryFunction=function(t){return t.getGeometry()};var Ru=function(t){Ph.call(this);this.id_=undefined;this.geometryName_="geometry";this.style_=null;this.styleFunction_=undefined;this.geometryChangeKey_=null;Ih.listen(this,Ph.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);if(t!==undefined){if(t instanceof ea||!t){var i=t;this.setGeometry(i)}else{var s=t;this.setProperties(s)}}};kh.inherits(Ru,Ph);Ru.prototype.clone=function(){var t=new Ru(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();if(i){t.setGeometry(i.clone())}var s=this.getStyle();if(s){t.setStyle(s)}return t};Ru.prototype.getGeometry=function(){return this.get(this.geometryName_)};Ru.prototype.getId=function(){return this.id_};Ru.prototype.getGeometryName=function(){return this.geometryName_};Ru.prototype.getStyle=function(){return this.style_};Ru.prototype.getStyleFunction=function(){return this.styleFunction_};Ru.prototype.handleGeometryChange_=function(){this.changed()};Ru.prototype.handleGeometryChanged_=function(){if(this.geometryChangeKey_){Ih.unlistenByKey(this.geometryChangeKey_);this.geometryChangeKey_=null}var t=this.getGeometry();if(t){this.geometryChangeKey_=Ih.listen(t,Ah.CHANGE,this.handleGeometryChange_,this)}this.changed()};Ru.prototype.setGeometry=function(t){this.set(this.geometryName_,t)};Ru.prototype.setStyle=function(t){this.style_=t;this.styleFunction_=!t?undefined:Ru.createStyleFunction(t);this.changed()};Ru.prototype.setId=function(t){this.id_=t;this.changed()};Ru.prototype.setGeometryName=function(t){Ih.unlisten(this,Ph.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);this.geometryName_=t;Ih.listen(this,Ph.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);this.handleGeometryChanged_()};Ru.createStyleFunction=function(t){var i;if(typeof t==="function"){if(t.length==2){i=function(i){return t(this,i)}}else{i=t}}else{var s;if(Array.isArray(t)){s=t}else{Dh.assert(t instanceof Au,41);s=[t]}i=function(){return s}}return i};var Pu={};Pu.createOrUpdate=function(t,i,s,e){if(e!==undefined){e[0]=t;e[1]=i;e[2]=s;return e}else{return[t,i,s]}};Pu.getKeyZXY=function(t,i,s){return t+"/"+i+"/"+s};Pu.getKey=function(t){return Pu.getKeyZXY(t[0],t[1],t[2])};Pu.fromKey=function(t){return t.split("/").map(Number)};Pu.hash=function(t){return(t[1]<<t[0])+t[2]};Pu.quadKey=function(t){var i=t[0];var s=new Array(i);var e=1<<i-1;var r,n;for(r=0;r<i;++r){n=48;if(t[1]&e){n+=1}if(t[2]&e){n+=2}s[r]=String.fromCharCode(n);e>>=1}return s.join("")};Pu.withinExtentAndZ=function(t,i){var s=t[0];var e=t[1];var r=t[2];if(i.getMinZoom()>s||s>i.getMaxZoom()){return false}var n=i.getExtent();var h;if(!n){h=i.getFullTileRange(s)}else{h=i.getTileRangeForExtentAndZ(n,s)}if(!h){return true}else{return h.containsXY(e,r)}};var Lu={};Lu.createFromTemplate=function(t,i){var s=/\{z\}/g;var e=/\{x\}/g;var r=/\{y\}/g;var n=/\{-y\}/g;return function(h,a,o){if(!h){return undefined}else{return t.replace(s,h[0].toString()).replace(e,h[1].toString()).replace(r,(function(){var t=-h[2]-1;return t.toString()})).replace(n,(function(){var t=h[0];var s=i.getFullTileRange(t);Dh.assert(s,55);var e=s.getHeight()+h[2];return e.toString()}))}}};Lu.createFromTemplates=function(t,i){var s=t.length;var e=new Array(s);for(var r=0;r<s;++r){e[r]=Lu.createFromTemplate(t[r],i)}return Lu.createFromTileUrlFunctions(e)};Lu.createFromTileUrlFunctions=function(t){if(t.length===1){return t[0]}return function(i,s,e){if(!i){return undefined}else{var r=Pu.hash(i);var n=Fh.modulo(r,t.length);return t[n](i,s,e)}}};Lu.nullTileUrlFunction=function(t,i,s){return undefined};Lu.expandUrl=function(t){var i=[];var s=/\{([a-z])-([a-z])\}/.exec(t);if(s){var e=s[1].charCodeAt(0);var r=s[2].charCodeAt(0);var n;for(n=e;n<=r;++n){i.push(t.replace(s[0],String.fromCharCode(n)))}return i}s=s=/\{(\d+)-(\d+)\}/.exec(t);if(s){var h=parseInt(s[2],10);for(var a=parseInt(s[1],10);a<=h;a++){i.push(t.replace(s[0],a.toString()))}return i}i.push(t);return i};var Du=function(t,i,s){Th.call(this);var e=s?s:{};this.tileCoord=t;this.state=i;this.interimTile=null;this.key="";this.transition_=e.transition===undefined?250:e.transition;this.transitionStarts_={}};kh.inherits(Du,Th);Du.prototype.changed=function(){this.dispatchEvent(Ah.CHANGE)};Du.prototype.getKey=function(){return this.key+"/"+this.tileCoord};Du.prototype.getInterimTile=function(){if(!this.interimTile){return this}var t=this.interimTile;do{if(t.getState()==Wa.LOADED){return t}t=t.interimTile}while(t);return this};Du.prototype.refreshInterimChain=function(){if(!this.interimTile){return}var t=this.interimTile;var i=this;do{if(t.getState()==Wa.LOADED){t.interimTile=null;break}else if(t.getState()==Wa.LOADING){i=t}else if(t.getState()==Wa.IDLE){i.interimTile=t.interimTile}else{i=t}t=i.interimTile}while(t)};Du.prototype.getTileCoord=function(){return this.tileCoord};Du.prototype.getState=function(){return this.state};Du.prototype.setState=function(t){this.state=t;this.changed()};Du.prototype.load=function(){};Du.prototype.getAlpha=function(t,i){if(!this.transition_){return 1}var s=this.transitionStarts_[t];if(!s){s=i;this.transitionStarts_[t]=s}else if(s===-1){return 1}var e=i-s+1e3/60;if(e>=this.transition_){return 1}return Za.easeIn(e/this.transition_)};Du.prototype.inTransition=function(t){if(!this.transition_){return false}return this.transitionStarts_[t]!==-1};Du.prototype.endTransition=function(t){if(this.transition_){this.transitionStarts_[t]=-1}};var Fu=function(t,i,s,e,r,n){Du.call(this,t,i,n);this.crossOrigin_=e;this.src_=s;this.image_=new Image;if(e!==null){this.image_.crossOrigin=e}this.imageListenerKeys_=null;this.tileLoadFunction_=r};kh.inherits(Fu,Du);Fu.prototype.disposeInternal=function(){if(this.state==Wa.LOADING){this.unlistenImage_();this.image_=Fu.getBlankImage()}if(this.interimTile){this.interimTile.dispose()}this.state=Wa.ABORT;this.changed();Du.prototype.disposeInternal.call(this)};Fu.prototype.getImage=function(){return this.image_};Fu.prototype.getKey=function(){return this.src_};Fu.prototype.handleImageError_=function(){this.state=Wa.ERROR;this.unlistenImage_();this.image_=Fu.getBlankImage();this.changed()};Fu.prototype.handleImageLoad_=function(){if(this.image_.naturalWidth&&this.image_.naturalHeight){this.state=Wa.LOADED}else{this.state=Wa.EMPTY}this.unlistenImage_();this.changed()};Fu.prototype.load=function(){if(this.state==Wa.ERROR){this.state=Wa.IDLE;this.image_=new Image;if(this.crossOrigin_!==null){this.image_.crossOrigin=this.crossOrigin_}}if(this.state==Wa.IDLE){this.state=Wa.LOADING;this.changed();this.imageListenerKeys_=[Ih.listenOnce(this.image_,Ah.ERROR,this.handleImageError_,this),Ih.listenOnce(this.image_,Ah.LOAD,this.handleImageLoad_,this)];this.tileLoadFunction_(this,this.src_)}};Fu.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ih.unlistenByKey);this.imageListenerKeys_=null};Fu.getBlankImage=function(){var t=$a.createCanvasContext2D(1,1);t.fillStyle="rgba(0,0,0,0)";t.fillRect(0,0,1,1);return t.canvas};var Gu=function(t){jo.call(this,t)};kh.inherits(Gu,jo);Gu.prototype.expireCache=function(t){var i,s;while(this.canExpireCache()){i=this.peekLast();s=i.tileCoord[0].toString();if(s in t&&t[s].contains(i.tileCoord)){break}else{this.pop().dispose()}}};Gu.prototype.pruneExceptNewestZ=function(){if(this.getCount()===0){return}var t=this.peekFirstKey();var i=Pu.fromKey(t);var s=i[0];this.forEach((function(t){if(t.tileCoord[0]!==s){this.remove(Pu.getKey(t.tileCoord));t.dispose()}}),this)};var Wu={};Wu.calculateSourceResolution=function(t,i,s,e){var r=ia.transform(s,i,t);var n=ia.getPointResolution(i,e,s);var h=i.getMetersPerUnit();if(h!==undefined){n*=h}var a=t.getMetersPerUnit();if(a!==undefined){n/=a}var o=t.getExtent();if(!o||qh.containsCoordinate(o,r)){var f=ia.getPointResolution(t,n,r)/n;if(isFinite(f)&&f>0){n/=f}}return n};Wu.enlargeClipPoint_=function(t,i,s,e){var r=s-t,n=e-i;var h=Math.sqrt(r*r+n*n);return[Math.round(s+r/h),Math.round(e+n/h)]};Wu.render=function(t,i,s,e,r,n,h,a,o,f,u){var v=$a.createCanvasContext2D(Math.round(s*t),Math.round(s*i));if(o.length===0){return v.canvas}v.scale(s,s);var l=qh.createEmpty();o.forEach((function(t,i,s){qh.extend(l,t.extent)}));var c=qh.getWidth(l);var d=qh.getHeight(l);var m=$a.createCanvasContext2D(Math.round(s*c/e),Math.round(s*d/e));var p=s/e;o.forEach((function(t,i,s){var e=t.extent[0]-l[0];var r=-(t.extent[3]-l[3]);var n=qh.getWidth(t.extent);var h=qh.getHeight(t.extent);m.drawImage(t.image,f,f,t.image.width-2*f,t.image.height-2*f,e*p,r*p,n*p,h*p)}));var M=qh.getTopLeft(h);a.getTriangles().forEach((function(t,i,r){var h=t.source,a=t.target;var o=h[0][0],f=h[0][1],u=h[1][0],c=h[1][1],d=h[2][0],p=h[2][1];var z=(a[0][0]-M[0])/n,_=-(a[0][1]-M[1])/n;var g=(a[1][0]-M[0])/n,w=-(a[1][1]-M[1])/n;var y=(a[2][0]-M[0])/n,b=-(a[2][1]-M[1])/n;var x=o,k=f;o=0;f=0;u-=x;c-=k;d-=x;p-=k;var E=[[u,c,0,0,g-z],[d,p,0,0,y-z],[0,0,u,c,w-_],[0,0,d,p,b-_]];var N=Fh.solveLinearSystem(E);if(!N){return}v.save();v.beginPath();var C=(z+g+y)/3,I=(_+w+b)/3;var S=Wu.enlargeClipPoint_(C,I,z,_);var O=Wu.enlargeClipPoint_(C,I,g,w);var T=Wu.enlargeClipPoint_(C,I,y,b);v.moveTo(O[0],O[1]);v.lineTo(S[0],S[1]);v.lineTo(T[0],T[1]);v.clip();v.transform(N[0],N[2],N[1],N[3],z,_);v.translate(l[0]-x,l[3]-k);v.scale(e/s,-e/s);v.drawImage(m.canvas,0,0);v.restore()}));if(u){v.save();v.strokeStyle="black";v.lineWidth=1;a.getTriangles().forEach((function(t,i,s){var e=t.target;var r=(e[0][0]-M[0])/n,h=-(e[0][1]-M[1])/n;var a=(e[1][0]-M[0])/n,o=-(e[1][1]-M[1])/n;var f=(e[2][0]-M[0])/n,u=-(e[2][1]-M[1])/n;v.beginPath();v.moveTo(a,o);v.lineTo(r,h);v.lineTo(f,u);v.closePath();v.stroke()}));v.restore()}return v.canvas};var ju=function(t,i,s,e,r){this.sourceProj_=t;this.targetProj_=i;var n={};var h=ia.getTransform(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];if(!n[i]){n[i]=h(t)}return n[i]};this.maxSourceExtent_=e;this.errorThresholdSquared_=r*r;this.triangles_=[];this.wrapsXInSource_=false;this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!e&&!!this.sourceProj_.getExtent()&&qh.getWidth(e)==qh.getWidth(this.sourceProj_.getExtent());this.sourceWorldWidth_=this.sourceProj_.getExtent()?qh.getWidth(this.sourceProj_.getExtent()):null;this.targetWorldWidth_=this.targetProj_.getExtent()?qh.getWidth(this.targetProj_.getExtent()):null;var a=qh.getTopLeft(s);var o=qh.getTopRight(s);var f=qh.getBottomRight(s);var u=qh.getBottomLeft(s);var v=this.transformInv_(a);var l=this.transformInv_(o);var c=this.transformInv_(f);var d=this.transformInv_(u);this.addQuad_(a,o,f,u,v,l,c,d,kh.RASTER_REPROJECTION_MAX_SUBDIVISION);if(this.wrapsXInSource_){var m=Infinity;this.triangles_.forEach((function(t,i,s){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])}));this.triangles_.forEach((function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];if(i[0][0]-m>this.sourceWorldWidth_/2){i[0][0]-=this.sourceWorldWidth_}if(i[1][0]-m>this.sourceWorldWidth_/2){i[1][0]-=this.sourceWorldWidth_}if(i[2][0]-m>this.sourceWorldWidth_/2){i[2][0]-=this.sourceWorldWidth_}var s=Math.min(i[0][0],i[1][0],i[2][0]);var e=Math.max(i[0][0],i[1][0],i[2][0]);if(e-s<this.sourceWorldWidth_/2){t.source=i}}}),this)}n={}};ju.prototype.addTriangle_=function(t,i,s,e,r,n){this.triangles_.push({source:[e,r,n],target:[t,i,s]})};ju.prototype.addQuad_=function(t,i,s,e,r,n,h,a,o){var f=qh.boundingExtent([r,n,h,a]);var u=this.sourceWorldWidth_?qh.getWidth(f)/this.sourceWorldWidth_:null;var v=this.sourceWorldWidth_;var l=this.sourceProj_.canWrapX()&&u>.5&&u<1;var c=false;if(o>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var d=qh.boundingExtent([t,i,s,e]);var m=qh.getWidth(d)/this.targetWorldWidth_;c|=m>kh.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}if(!l&&this.sourceProj_.isGlobal()&&u){c|=u>kh.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}}if(!c&&this.maxSourceExtent_){if(!qh.intersects(f,this.maxSourceExtent_)){return}}if(!c){if(!isFinite(r[0])||!isFinite(r[1])||!isFinite(n[0])||!isFinite(n[1])||!isFinite(h[0])||!isFinite(h[1])||!isFinite(a[0])||!isFinite(a[1])){if(o>0){c=true}else{return}}}if(o>0){if(!c){var p=[(t[0]+s[0])/2,(t[1]+s[1])/2];var M=this.transformInv_(p);var z;if(l){var _=(Fh.modulo(r[0],v)+Fh.modulo(h[0],v))/2;z=_-Fh.modulo(M[0],v)}else{z=(r[0]+h[0])/2-M[0]}var g=(r[1]+h[1])/2-M[1];var w=z*z+g*g;c=w>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-s[0])<=Math.abs(t[1]-s[1])){var y=[(i[0]+s[0])/2,(i[1]+s[1])/2];var b=this.transformInv_(y);var x=[(e[0]+t[0])/2,(e[1]+t[1])/2];var k=this.transformInv_(x);this.addQuad_(t,i,y,x,r,n,b,k,o-1);this.addQuad_(x,y,s,e,k,b,h,a,o-1)}else{var E=[(t[0]+i[0])/2,(t[1]+i[1])/2];var N=this.transformInv_(E);var C=[(s[0]+e[0])/2,(s[1]+e[1])/2];var I=this.transformInv_(C);this.addQuad_(t,E,C,e,r,N,I,a,o-1);this.addQuad_(E,i,s,C,N,n,h,I,o-1)}return}}if(l){if(!this.canWrapXInSource_){return}this.wrapsXInSource_=true}this.addTriangle_(t,s,e,r,h,a);this.addTriangle_(t,i,s,r,n,h)};ju.prototype.calculateSourceExtent=function(){var t=qh.createEmpty();this.triangles_.forEach((function(i,s,e){var r=i.source;qh.extendCoordinate(t,r[0]);qh.extendCoordinate(t,r[1]);qh.extendCoordinate(t,r[2])}));return t};ju.prototype.getTriangles=function(){return this.triangles_};var Vu=function(t,i,s,e,r,n,h,a,o,f,u){Du.call(this,r,Wa.IDLE);this.renderEdges_=u!==undefined?u:false;this.pixelRatio_=h;this.gutter_=a;this.canvas_=null;this.sourceTileGrid_=i;this.targetTileGrid_=e;this.wrappedTileCoord_=n?n:r;this.sourceTiles_=[];this.sourcesListenerKeys_=null;this.sourceZ_=0;var v=e.getTileCoordExtent(this.wrappedTileCoord_);var l=this.targetTileGrid_.getExtent();var c=this.sourceTileGrid_.getExtent();var d=l?qh.getIntersection(v,l):v;if(qh.getArea(d)===0){this.state=Wa.EMPTY;return}var m=t.getExtent();if(m){if(!c){c=m}else{c=qh.getIntersection(c,m)}}var p=e.getResolution(this.wrappedTileCoord_[0]);var M=qh.getCenter(d);var z=Wu.calculateSourceResolution(t,s,M,p);if(!isFinite(z)||z<=0){this.state=Wa.EMPTY;return}var _=f!==undefined?f:kh.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD;this.triangulation_=new ju(t,s,d,c,z*_);if(this.triangulation_.getTriangles().length===0){this.state=Wa.EMPTY;return}this.sourceZ_=i.getZForResolution(z);var g=this.triangulation_.calculateSourceExtent();if(c){if(t.canWrapX()){g[1]=Fh.clamp(g[1],c[1],c[3]);g[3]=Fh.clamp(g[3],c[1],c[3])}else{g=qh.getIntersection(g,c)}}if(!qh.getArea(g)){this.state=Wa.EMPTY}else{var w=i.getTileRangeForExtentAndZ(g,this.sourceZ_);for(var y=w.minX;y<=w.maxX;y++){for(var b=w.minY;b<=w.maxY;b++){var x=o(this.sourceZ_,y,b,h);if(x){this.sourceTiles_.push(x)}}}if(this.sourceTiles_.length===0){this.state=Wa.EMPTY}}};kh.inherits(Vu,Du);Vu.prototype.disposeInternal=function(){if(this.state==Wa.LOADING){this.unlistenSources_()}Du.prototype.disposeInternal.call(this)};Vu.prototype.getImage=function(){return this.canvas_};Vu.prototype.reproject_=function(){var t=[];this.sourceTiles_.forEach((function(i,s,e){if(i&&i.getState()==Wa.LOADED){t.push({extent:this.sourceTileGrid_.getTileCoordExtent(i.tileCoord),image:i.getImage()})}}),this);this.sourceTiles_.length=0;if(t.length===0){this.state=Wa.ERROR}else{var i=this.wrappedTileCoord_[0];var s=this.targetTileGrid_.getTileSize(i);var e=typeof s==="number"?s:s[0];var r=typeof s==="number"?s:s[1];var n=this.targetTileGrid_.getResolution(i);var h=this.sourceTileGrid_.getResolution(this.sourceZ_);var a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Wu.render(e,r,this.pixelRatio_,h,this.sourceTileGrid_.getExtent(),n,a,this.triangulation_,t,this.gutter_,this.renderEdges_);this.state=Wa.LOADED}this.changed()};Vu.prototype.load=function(){if(this.state==Wa.IDLE){this.state=Wa.LOADING;this.changed();var t=0;this.sourcesListenerKeys_=[];this.sourceTiles_.forEach((function(i,s,e){var r=i.getState();if(r==Wa.IDLE||r==Wa.LOADING){t++;var n;n=Ih.listen(i,Ah.CHANGE,(function(s){var e=i.getState();if(e==Wa.LOADED||e==Wa.ERROR||e==Wa.EMPTY){Ih.unlistenByKey(n);t--;if(t===0){this.unlistenSources_();this.reproject_()}}}),this);this.sourcesListenerKeys_.push(n)}}),this);this.sourceTiles_.forEach((function(t,i,s){var e=t.getState();if(e==Wa.IDLE){t.load()}}));if(t===0){setTimeout(this.reproject_.bind(this),0)}}};Vu.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ih.unlistenByKey);this.sourcesListenerKeys_=null};var Uu=function(t){this.minZoom=t.minZoom!==undefined?t.minZoom:0;this.resolutions_=t.resolutions;Dh.assert(jh.isSorted(this.resolutions_,(function(t,i){return i-t}),true),17);var i;if(!t.origins){for(var s=0,e=this.resolutions_.length-1;s<e;++s){if(!i){i=this.resolutions_[s]/this.resolutions_[s+1]}else{if(this.resolutions_[s]/this.resolutions_[s+1]!==i){i=undefined;break}}}}this.zoomFactor_=i;this.maxZoom=this.resolutions_.length-1;this.origin_=t.origin!==undefined?t.origin:null;this.origins_=null;if(t.origins!==undefined){this.origins_=t.origins;Dh.assert(this.origins_.length==this.resolutions_.length,20)}var r=t.extent;if(r!==undefined&&!this.origin_&&!this.origins_){this.origin_=qh.getTopLeft(r)}Dh.assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18);this.tileSizes_=null;if(t.tileSizes!==undefined){this.tileSizes_=t.tileSizes;Dh.assert(this.tileSizes_.length==this.resolutions_.length,19)}this.tileSize_=t.tileSize!==undefined?t.tileSize:!this.tileSizes_?kh.DEFAULT_TILE_SIZE:null;Dh.assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22);this.extent_=r!==undefined?r:null;this.fullTileRanges_=null;this.tmpSize_=[0,0];if(t.sizes!==undefined){this.fullTileRanges_=t.sizes.map((function(t,i){var s=new sf(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));return s}),this)}else if(r){this.calculateTileRanges_(r)}};Uu.tmpTileCoord_=[0,0,0];Uu.prototype.forEachTileCoord=function(t,i,s){var e=this.getTileRangeForExtentAndZ(t,i);for(var r=e.minX,n=e.maxX;r<=n;++r){for(var h=e.minY,a=e.maxY;h<=a;++h){s([i,r,h])}}};Uu.prototype.forEachTileCoordParentTileRange=function(t,i,s,e,r){var n,h,a;var o=null;var f=t[0]-1;if(this.zoomFactor_===2){h=t[1];a=t[2]}else{o=this.getTileCoordExtent(t,r)}while(f>=this.minZoom){if(this.zoomFactor_===2){h=Math.floor(h/2);a=Math.floor(a/2);n=sf.createOrUpdate(h,h,a,a,e)}else{n=this.getTileRangeForExtentAndZ(o,f,e)}if(i.call(s,f,n)){return true}--f}return false};Uu.prototype.getExtent=function(){return this.extent_};Uu.prototype.getMaxZoom=function(){return this.maxZoom};Uu.prototype.getMinZoom=function(){return this.minZoom};Uu.prototype.getOrigin=function(t){if(this.origin_){return this.origin_}else{return this.origins_[t]}};Uu.prototype.getResolution=function(t){return this.resolutions_[t]};Uu.prototype.getResolutions=function(){return this.resolutions_};Uu.prototype.getTileCoordChildTileRange=function(t,i,s){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){var e=t[1]*2;var r=t[2]*2;return sf.createOrUpdate(e,e+1,r,r+1,i)}var n=this.getTileCoordExtent(t,s);return this.getTileRangeForExtentAndZ(n,t[0]+1,i)}return null};Uu.prototype.getTileRangeExtent=function(t,i,s){var e=this.getOrigin(t);var r=this.getResolution(t);var n=ho.toSize(this.getTileSize(t),this.tmpSize_);var h=e[0]+i.minX*n[0]*r;var a=e[0]+(i.maxX+1)*n[0]*r;var o=e[1]+i.minY*n[1]*r;var f=e[1]+(i.maxY+1)*n[1]*r;return qh.createOrUpdate(h,o,a,f,s)};Uu.prototype.getTileRangeForExtentAndZ=function(t,i,s){var e=Uu.tmpTileCoord_;this.getTileCoordForXYAndZ_(t[0],t[1],i,false,e);var r=e[1];var n=e[2];this.getTileCoordForXYAndZ_(t[2],t[3],i,true,e);return sf.createOrUpdate(r,e[1],n,e[2],s)};Uu.prototype.getTileCoordCenter=function(t){var i=this.getOrigin(t[0]);var s=this.getResolution(t[0]);var e=ho.toSize(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*e[0]*s,i[1]+(t[2]+.5)*e[1]*s]};Uu.prototype.getTileCoordExtent=function(t,i){var s=this.getOrigin(t[0]);var e=this.getResolution(t[0]);var r=ho.toSize(this.getTileSize(t[0]),this.tmpSize_);var n=s[0]+t[1]*r[0]*e;var h=s[1]+t[2]*r[1]*e;var a=n+r[0]*e;var o=h+r[1]*e;return qh.createOrUpdate(n,h,a,o,i)};Uu.prototype.getTileCoordForCoordAndResolution=function(t,i,s){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,false,s)};Uu.prototype.getTileCoordForXYAndResolution_=function(t,i,s,e,r){var n=this.getZForResolution(s);var h=s/this.getResolution(n);var a=this.getOrigin(n);var o=ho.toSize(this.getTileSize(n),this.tmpSize_);var f=e?.5:0;var u=e?0:.5;var v=Math.floor((t-a[0])/s+f);var l=Math.floor((i-a[1])/s+u);var c=h*v/o[0];var d=h*l/o[1];if(e){c=Math.ceil(c)-1;d=Math.ceil(d)-1}else{c=Math.floor(c);d=Math.floor(d)}return Pu.createOrUpdate(n,c,d,r)};Uu.prototype.getTileCoordForXYAndZ_=function(t,i,s,e,r){var n=this.getOrigin(s);var h=this.getResolution(s);var a=ho.toSize(this.getTileSize(s),this.tmpSize_);var o=e?.5:0;var f=e?0:.5;var u=Math.floor((t-n[0])/h+o);var v=Math.floor((i-n[1])/h+f);var l=u/a[0];var c=v/a[1];if(e){l=Math.ceil(l)-1;c=Math.ceil(c)-1}else{l=Math.floor(l);c=Math.floor(c)}return Pu.createOrUpdate(s,l,c,r)};Uu.prototype.getTileCoordForCoordAndZ=function(t,i,s){return this.getTileCoordForXYAndZ_(t[0],t[1],i,false,s)};Uu.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]};Uu.prototype.getTileSize=function(t){if(this.tileSize_){return this.tileSize_}else{return this.tileSizes_[t]}};Uu.prototype.getFullTileRange=function(t){if(!this.fullTileRanges_){return null}else{return this.fullTileRanges_[t]}};Uu.prototype.getZForResolution=function(t,i){var s=jh.linearFindNearest(this.resolutions_,t,i||0);return Fh.clamp(s,this.minZoom,this.maxZoom)};Uu.prototype.calculateTileRanges_=function(t){var i=this.resolutions_.length;var s=new Array(i);for(var e=this.minZoom;e<i;++e){s[e]=this.getTileRangeForExtentAndZ(t,e)}this.fullTileRanges_=s};var qu={};qu.getForProjection=function(t){var i=t.getDefaultTileGrid();if(!i){i=qu.createForProjection(t);t.setDefaultTileGrid(i)}return i};qu.wrapX=function(t,i,s){var e=i[0];var r=t.getTileCoordCenter(i);var n=qu.extentFromProjection(s);if(!qh.containsCoordinate(n,r)){var h=qh.getWidth(n);var a=Math.ceil((n[0]-r[0])/h);r[0]+=h*a;return t.getTileCoordForCoordAndZ(r,e)}else{return i}};qu.createForExtent=function(t,i,s,e){var r=e!==undefined?e:Vh.TOP_LEFT;var n=qu.resolutionsFromExtent(t,i,s);return new Uu({extent:t,origin:qh.getCorner(t,r),resolutions:n,tileSize:s})};qu.createXYZ=function(t){var i={};Ch.assign(i,t!==undefined?t:{});if(i.extent===undefined){i.extent=ia.get("EPSG:3857").getExtent()}i.resolutions=qu.resolutionsFromExtent(i.extent,i.maxZoom,i.tileSize);delete i.maxZoom;return new Uu(i)};qu.resolutionsFromExtent=function(t,i,s){var e=i!==undefined?i:kh.DEFAULT_MAX_ZOOM;var r=qh.getHeight(t);var n=qh.getWidth(t);var h=ho.toSize(s!==undefined?s:kh.DEFAULT_TILE_SIZE);var a=Math.max(n/h[0],r/h[1]);var o=e+1;var f=new Array(o);for(var u=0;u<o;++u){f[u]=a/Math.pow(2,u)}return f};qu.createForProjection=function(t,i,s,e){var r=qu.extentFromProjection(t);return qu.createForExtent(r,i,s,e)};qu.extentFromProjection=function(t){t=ia.get(t);var i=t.getExtent();if(!i){var s=180*ia.METERS_PER_UNIT[Hh.DEGREES]/t.getMetersPerUnit();i=qh.createOrUpdate(-s,-s,s,s)}return i};var Xu=function(t){this.html_=t.html;this.tileRanges_=t.tileRanges?t.tileRanges:null};Xu.prototype.getHTML=function(){return this.html_};Xu.prototype.intersectsAnyTileRange=function(t,i,s){if(!this.tileRanges_){return true}var e,r,n,h;for(h in t){if(!(h in this.tileRanges_)){continue}n=t[h];var a;for(e=0,r=this.tileRanges_[h].length;e<r;++e){a=this.tileRanges_[h][e];if(a.intersects(n)){return true}var o=i.getTileRangeForExtentAndZ(qu.extentFromProjection(s),parseInt(h,10));var f=o.getWidth();if(n.minX<o.minX||n.maxX>o.maxX){if(a.intersects(new sf(Fh.modulo(n.minX,f),Fh.modulo(n.maxX,f),n.minY,n.maxY))){return true}if(n.getWidth()>f&&a.intersects(o)){return true}}}}return false};var Yu=function(t){Ph.call(this);this.projection_=ia.get(t.projection);this.attributions_=null;this.attributions2_=this.adaptAttributions_(t.attributions);this.logo_=t.logo;this.state_=t.state!==undefined?t.state:io.READY;this.wrapX_=t.wrapX!==undefined?t.wrapX:false};kh.inherits(Yu,Ph);Yu.prototype.adaptAttributions_=function(t){if(!t){return null}if(t instanceof Xu){this.attributions_=[t];return function(i){return[t.getHTML()]}}if(Array.isArray(t)){if(t[0]instanceof Xu){this.attributions_=t;var i=t.map((function(t){return t.getHTML()}));return function(t){return i}}this.attributions_=t.map((function(t){return new Xu({html:t})}));return function(i){return t}}if(typeof t==="function"){return t}this.attributions_=[new Xu({html:t})];return function(i){return[t]}};Yu.prototype.forEachFeatureAtCoordinate=kh.nullFunction;Yu.prototype.getAttributions=function(){return this.attributions_};Yu.prototype.getAttributions2=function(){return this.attributions2_};Yu.prototype.getLogo=function(){return this.logo_};Yu.prototype.getProjection=function(){return this.projection_};Yu.prototype.getResolutions=function(){};Yu.prototype.getState=function(){return this.state_};Yu.prototype.getWrapX=function(){return this.wrapX_};Yu.prototype.refresh=function(){this.changed()};Yu.prototype.setAttributions=function(t){this.attributions2_=this.adaptAttributions_(t);this.changed()};Yu.prototype.setLogo=function(t){this.logo_=t};Yu.prototype.setState=function(t){this.state_=t;this.changed()};var Bu=function(t){Yu.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state,wrapX:t.wrapX});this.opaque_=t.opaque!==undefined?t.opaque:false;this.tilePixelRatio_=t.tilePixelRatio!==undefined?t.tilePixelRatio:1;this.tileGrid=t.tileGrid!==undefined?t.tileGrid:null;this.tileCache=new Gu(t.cacheSize);this.tmpSize=[0,0];this.key_="";this.tileOptions={transition:t.transition}};kh.inherits(Bu,Yu);Bu.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()};Bu.prototype.expireCache=function(t,i){var s=this.getTileCacheForProjection(t);if(s){s.expireCache(i)}};Bu.prototype.forEachLoadedTile=function(t,i,s,e){var r=this.getTileCacheForProjection(t);if(!r){return false}var n=true;var h,a,o;for(var f=s.minX;f<=s.maxX;++f){for(var u=s.minY;u<=s.maxY;++u){a=Pu.getKeyZXY(i,f,u);o=false;if(r.containsKey(a)){h=r.get(a);o=h.getState()===Wa.LOADED;if(o){o=e(h)!==false}}if(!o){n=false}}}return n};Bu.prototype.getGutter=function(t){return 0};Bu.prototype.getKey=function(){return this.key_};Bu.prototype.setKey=function(t){if(this.key_!==t){this.key_=t;this.changed()}};Bu.prototype.getOpaque=function(t){return this.opaque_};Bu.prototype.getResolutions=function(){return this.tileGrid.getResolutions()};Bu.prototype.getTile=function(t,i,s,e,r){};Bu.prototype.getTileGrid=function(){return this.tileGrid};Bu.prototype.getTileGridForProjection=function(t){if(!this.tileGrid){return qu.getForProjection(t)}else{return this.tileGrid}};Bu.prototype.getTileCacheForProjection=function(t){var i=this.getProjection();if(i&&!ia.equivalent(i,t)){return null}else{return this.tileCache}};Bu.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_};Bu.prototype.getTilePixelSize=function(t,i,s){var e=this.getTileGridForProjection(s);var r=this.getTilePixelRatio(i);var n=ho.toSize(e.getTileSize(t),this.tmpSize);if(r==1){return n}else{return ho.scale(n,r,this.tmpSize)}};Bu.prototype.getTileCoordForTileUrlFunction=function(t,i){var s=i!==undefined?i:this.getProjection();var e=this.getTileGridForProjection(s);if(this.getWrapX()&&s.isGlobal()){t=qu.wrapX(e,t,s)}return Pu.withinExtentAndZ(t,e)?t:null};Bu.prototype.refresh=function(){this.tileCache.clear();this.changed()};Bu.prototype.useTile=kh.nullFunction;Bu.Event=function(t,i){Oh.call(this,t);this.tile=i};kh.inherits(Bu.Event,Oh);var Hu={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var Ju=function(t){Bu.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition});this.tileLoadFunction=t.tileLoadFunction;this.tileUrlFunction=this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Lu.nullTileUrlFunction;this.urls=null;if(t.urls){this.setUrls(t.urls)}else if(t.url){this.setUrl(t.url)}if(t.tileUrlFunction){this.setTileUrlFunction(t.tileUrlFunction)}this.tileLoadingKeys_={}};kh.inherits(Ju,Bu);Ju.prototype.getTileLoadFunction=function(){return this.tileLoadFunction};Ju.prototype.getTileUrlFunction=function(){return this.tileUrlFunction};Ju.prototype.getUrls=function(){return this.urls};Ju.prototype.handleTileChange=function(t){var i=t.target;var s=kh.getUid(i);var e=i.getState();var r;if(e==Wa.LOADING){this.tileLoadingKeys_[s]=true;r=Hu.TILELOADSTART}else if(s in this.tileLoadingKeys_){delete this.tileLoadingKeys_[s];r=e==Wa.ERROR?Hu.TILELOADERROR:e==Wa.LOADED||e==Wa.ABORT?Hu.TILELOADEND:undefined}if(r!=undefined){this.dispatchEvent(new Bu.Event(r,i))}};Ju.prototype.setTileLoadFunction=function(t){this.tileCache.clear();this.tileLoadFunction=t;this.changed()};Ju.prototype.setTileUrlFunction=function(t,i){this.tileUrlFunction=t;this.tileCache.pruneExceptNewestZ();if(typeof i!=="undefined"){this.setKey(i)}else{this.changed()}};Ju.prototype.setUrl=function(t){var i=this.urls=Lu.expandUrl(t);this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Lu.createFromTemplates(i,this.tileGrid),t)};Ju.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Lu.createFromTemplates(t,this.tileGrid),i)};Ju.prototype.useTile=function(t,i,s){var e=Pu.getKeyZXY(t,i,s);if(this.tileCache.containsKey(e)){this.tileCache.get(e)}};var Zu=function(t){Ju.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Zu.defaultTileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition});this.crossOrigin=t.crossOrigin!==undefined?t.crossOrigin:null;this.tileClass=t.tileClass!==undefined?t.tileClass:Fu;this.tileCacheForProjection={};this.tileGridForProjection={};this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold;this.renderReprojectionEdges_=false};kh.inherits(Zu,Ju);Zu.prototype.canExpireCache=function(){if(!kh.ENABLE_RASTER_REPROJECTION){return Ju.prototype.canExpireCache.call(this)}if(this.tileCache.canExpireCache()){return true}else{for(var t in this.tileCacheForProjection){if(this.tileCacheForProjection[t].canExpireCache()){return true}}}return false};Zu.prototype.expireCache=function(t,i){if(!kh.ENABLE_RASTER_REPROJECTION){Ju.prototype.expireCache.call(this,t,i);return}var s=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==s?i:{});for(var e in this.tileCacheForProjection){var r=this.tileCacheForProjection[e];r.expireCache(r==s?i:{})}};Zu.prototype.getGutter=function(t){if(kh.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!ia.equivalent(this.getProjection(),t)){return 0}else{return this.getGutterInternal()}};Zu.prototype.getGutterInternal=function(){return 0};Zu.prototype.getOpaque=function(t){if(kh.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!ia.equivalent(this.getProjection(),t)){return false}else{return Ju.prototype.getOpaque.call(this,t)}};Zu.prototype.getTileGridForProjection=function(t){if(!kh.ENABLE_RASTER_REPROJECTION){return Ju.prototype.getTileGridForProjection.call(this,t)}var i=this.getProjection();if(this.tileGrid&&(!i||ia.equivalent(i,t))){return this.tileGrid}else{var s=kh.getUid(t).toString();if(!(s in this.tileGridForProjection)){this.tileGridForProjection[s]=qu.getForProjection(t)}return this.tileGridForProjection[s]}};Zu.prototype.getTileCacheForProjection=function(t){if(!kh.ENABLE_RASTER_REPROJECTION){return Ju.prototype.getTileCacheForProjection.call(this,t)}var i=this.getProjection();if(!i||ia.equivalent(i,t)){return this.tileCache}else{var s=kh.getUid(t).toString();if(!(s in this.tileCacheForProjection)){this.tileCacheForProjection[s]=new Gu(this.tileCache.highWaterMark)}return this.tileCacheForProjection[s]}};Zu.prototype.createTile_=function(t,i,s,e,r,n){var h=[t,i,s];var a=this.getTileCoordForTileUrlFunction(h,r);var o=a?this.tileUrlFunction(a,e,r):undefined;var f=new this.tileClass(h,o!==undefined?Wa.IDLE:Wa.EMPTY,o!==undefined?o:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);f.key=n;Ih.listen(f,Ah.CHANGE,this.handleTileChange,this);return f};Zu.prototype.getTile=function(t,i,s,e,r){var n=this.getProjection();if(!kh.ENABLE_RASTER_REPROJECTION||!n||!r||ia.equivalent(n,r)){return this.getTileInternal(t,i,s,e,n||r)}else{var h=this.getTileCacheForProjection(r);var a=[t,i,s];var o;var f=Pu.getKey(a);if(h.containsKey(f)){o=h.get(f)}var u=this.getKey();if(o&&o.key==u){return o}else{var v=this.getTileGridForProjection(n);var l=this.getTileGridForProjection(r);var c=this.getTileCoordForTileUrlFunction(a,r);var d=new Vu(n,v,r,l,a,c,this.getTilePixelRatio(e),this.getGutterInternal(),function(t,i,s,e){return this.getTileInternal(t,i,s,e,n)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);d.key=u;if(o){d.interimTile=o;d.refreshInterimChain();h.replace(f,d)}else{h.set(f,d)}return d}}};Zu.prototype.getTileInternal=function(t,i,s,e,r){var n=null;var h=Pu.getKeyZXY(t,i,s);var a=this.getKey();if(!this.tileCache.containsKey(h)){n=this.createTile_(t,i,s,e,r,a);this.tileCache.set(h,n)}else{n=this.tileCache.get(h);if(n.key!=a){var o=n;n=this.createTile_(t,i,s,e,r,a);if(o.getState()==Wa.IDLE){n.interimTile=o.interimTile}else{n.interimTile=o}n.refreshInterimChain();this.tileCache.replace(h,n)}}return n};Zu.prototype.setRenderReprojectionEdges=function(t){if(!kh.ENABLE_RASTER_REPROJECTION||this.renderReprojectionEdges_==t){return}this.renderReprojectionEdges_=t;for(var i in this.tileCacheForProjection){this.tileCacheForProjection[i].clear()}this.changed()};Zu.prototype.setTileGridForProjection=function(t,i){if(kh.ENABLE_RASTER_REPROJECTION){var s=ia.get(t);if(s){var e=kh.getUid(s).toString();if(!(e in this.tileGridForProjection)){this.tileGridForProjection[e]=i}}}};Zu.defaultTileLoadFunction=function(t,i){t.getImage().src=i};var Ku={KVP:"KVP",REST:"REST"};var $u=function(t){this.matrixIds_=t.matrixIds;Uu.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})};kh.inherits($u,Uu);$u.prototype.getMatrixId=function(t){return this.matrixIds_[t]};$u.prototype.getMatrixIds=function(){return this.matrixIds_};$u.createFromCapabilitiesMatrixSet=function(t,i,s){var e=[];var r=[];var n=[];var h=[];var a=[];var o=s!==undefined?s:[];var f="SupportedCRS";var u="TileMatrix";var v="Identifier";var l="ScaleDenominator";var c="TopLeftCorner";var d="TileWidth";var m="TileHeight";var p=t[f];var M=ia.get(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ia.get(p);var z=M.getMetersPerUnit();var _=M.getAxisOrientation().substr(0,2)=="ne";t[u].sort((function(t,i){return i[l]-t[l]}));t[u].forEach((function(t,i,s){var f;if(o.length>0){f=jh.find(o,(function(i,s,e){return t[v]==i[u]}))}else{f=true}if(f){r.push(t[v]);var p=t[l]*28e-5/z;var M=t[d];var g=t[m];if(_){n.push([t[c][1],t[c][0]])}else{n.push(t[c])}e.push(p);h.push(M==g?M:[M,g]);a.push([t["MatrixWidth"],-t["MatrixHeight"]])}}));return new $u({extent:i,origins:n,resolutions:e,matrixIds:r,tileSizes:h,sizes:a})};var Qu={};Qu.appendParams=function(t,i){var s=[];Object.keys(i).forEach((function(t){if(i[t]!==null&&i[t]!==undefined){s.push(t+"="+encodeURIComponent(i[t]))}}));var e=s.join("&");t=t.replace(/[?&]$/,"");t=t.indexOf("?")===-1?t+"?":t+"&";return t+e};var tv=function(t){this.version_=t.version!==undefined?t.version:"1.0.0";this.format_=t.format!==undefined?t.format:"image/jpeg";this.dimensions_=t.dimensions!==undefined?t.dimensions:{};this.layer_=t.layer;this.matrixSet_=t.matrixSet;this.style_=t.style;var i=t.urls;if(i===undefined&&t.url!==undefined){i=Lu.expandUrl(t.url)}this.requestEncoding_=t.requestEncoding!==undefined?t.requestEncoding:Ku.KVP;var s=this.requestEncoding_;var e=t.tileGrid;var r={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};if(s==Ku.KVP){Ch.assign(r,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_})}var n=this.dimensions_;this.createFromWMTSTemplate_=function(t){t=s==Ku.KVP?Qu.appendParams(t,r):t.replace(/\{(\w+?)\}/g,(function(t,i){return i.toLowerCase()in r?r[i.toLowerCase()]:t}));return function(i,r,h){if(!i){return undefined}else{var a={TileMatrix:e.getMatrixId(i[0]),TileCol:i[1],TileRow:-i[2]-1};Ch.assign(a,n);var o=t;if(s==Ku.KVP){o=Qu.appendParams(o,a)}else{o=o.replace(/\{(\w+?)\}/g,(function(t,i){return a[i]}))}return o}}};var h=i&&i.length>0?Lu.createFromTileUrlFunctions(i.map(this.createFromWMTSTemplate_)):Lu.nullTileUrlFunction;Zu.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:e,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:h,urls:i,wrapX:t.wrapX!==undefined?t.wrapX:false,transition:t.transition});this.setKey(this.getKeyForDimensions_())};kh.inherits(tv,Zu);tv.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Lu.createFromTileUrlFunctions(t.map(this.createFromWMTSTemplate_.bind(this))),i)};tv.prototype.getDimensions=function(){return this.dimensions_};tv.prototype.getFormat=function(){return this.format_};tv.prototype.getLayer=function(){return this.layer_};tv.prototype.getMatrixSet=function(){return this.matrixSet_};tv.prototype.getRequestEncoding=function(){return this.requestEncoding_};tv.prototype.getStyle=function(){return this.style_};tv.prototype.getVersion=function(){return this.version_};tv.prototype.getKeyForDimensions_=function(){var t=0;var i=[];for(var s in this.dimensions_){i[t++]=s+"-"+this.dimensions_[s]}return i.join("/")};tv.prototype.updateDimensions=function(t){Ch.assign(this.dimensions_,t);this.setKey(this.getKeyForDimensions_())};tv.optionsFromCapabilities=function(t,i){var s=t["Contents"]["Layer"];var e=jh.find(s,(function(t,s,e){return t["Identifier"]==i["layer"]}));if(e===null){return null}var r=t["Contents"]["TileMatrixSet"];var n,h,a;if(e["TileMatrixSetLink"].length>1){if("projection"in i){n=jh.findIndex(e["TileMatrixSetLink"],(function(t,s,e){var n=jh.find(r,(function(i){return i["Identifier"]==t["TileMatrixSet"]}));var h=n["SupportedCRS"];var a=ia.get(h.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ia.get(h);var o=ia.get(i["projection"]);if(a&&o){return ia.equivalent(a,o)}else{return h==i["projection"]}}))}else{n=jh.findIndex(e["TileMatrixSetLink"],(function(t,s,e){return t["TileMatrixSet"]==i["matrixSet"]}))}}else{n=0}if(n<0){n=0}h=e["TileMatrixSetLink"][n]["TileMatrixSet"];a=e["TileMatrixSetLink"][n]["TileMatrixSetLimits"];var o=e["Format"][0];if("format"in i){o=i["format"]}n=jh.findIndex(e["Style"],(function(t,s,e){if("style"in i){return t["Title"]==i["style"]}else{return t["isDefault"]}}));if(n<0){n=0}var f=e["Style"][n]["Identifier"];var u={};if("Dimension"in e){e["Dimension"].forEach((function(t,i,s){var e=t["Identifier"];var r=t["Default"];if(r===undefined){r=t["Value"][0]}u[e]=r}))}var v=t["Contents"]["TileMatrixSet"];var l=jh.find(v,(function(t,i,s){return t["Identifier"]==h}));var c;var d=l["SupportedCRS"];if(d){c=ia.get(d.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ia.get(d)}if("projection"in i){var m=ia.get(i["projection"]);if(m){if(!c||ia.equivalent(m,c)){c=m}}}var p=e["WGS84BoundingBox"];var M,z;if(p!==undefined){var _=ia.get("EPSG:4326").getExtent();z=p[0]==_[0]&&p[2]==_[2];M=ia.transformExtent(p,"EPSG:4326",c);var g=c.getExtent();if(g){if(!qh.containsExtent(g,M)){M=undefined}}}var w=$u.createFromCapabilitiesMatrixSet(l,M,a);var y=[];var b=i["requestEncoding"];b=b!==undefined?b:"";if("OperationsMetadata"in t&&"GetTile"in t["OperationsMetadata"]){var x=t["OperationsMetadata"]["GetTile"]["DCP"]["HTTP"]["Get"];for(var k=0,E=x.length;k<E;++k){if(x[k]["Constraint"]){var N=jh.find(x[k]["Constraint"],(function(t){return t["name"]=="GetEncoding"}));var C=N["AllowedValues"]["Value"];if(b===""){b=C[0]}if(b===Ku.KVP){if(jh.includes(C,Ku.KVP)){y.push(x[k]["href"])}}else{break}}else if(x[k]["href"]){b=Ku.KVP;y.push(x[k]["href"])}}}if(y.length===0){b=Ku.REST;e["ResourceURL"].forEach((function(t){if(t["resourceType"]==="tile"){o=t["format"];y.push(t["template"])}}))}return{urls:y,layer:i["layer"],matrixSet:h,format:o,projection:c,requestEncoding:b,tileGrid:w,style:f,dimensions:u,wrapX:z,crossOrigin:i["crossOrigin"]}};var iv={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};var sv={};sv.DOCUMENT=document.implementation.createDocument("","",null);sv.createElementNS=function(t,i){return sv.DOCUMENT.createElementNS(t,i)};sv.getAllTextContent=function(t,i){return sv.getAllTextContent_(t,i,[]).join("")};sv.getAllTextContent_=function(t,i,s){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE){if(i){s.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,""))}else{s.push(t.nodeValue)}}else{var e;for(e=t.firstChild;e;e=e.nextSibling){sv.getAllTextContent_(e,i,s)}}return s};sv.isDocument=function(t){return t instanceof Document};sv.isNode=function(t){return t instanceof Node};sv.getAttributeNS=function(t,i,s){return t.getAttributeNS(i,s)||""};sv.setAttributeNS=function(t,i,s,e){t.setAttributeNS(i,s,e)};sv.parse=function(t){return(new DOMParser).parseFromString(t,"application/xml")};sv.makeArrayExtender=function(t,i){return function(s,e){var r=t.call(i,s,e);if(r!==undefined){var n=e[e.length-1];jh.extend(n,r)}}};sv.makeArrayPusher=function(t,i){return function(s,e){var r=t.call(i!==undefined?i:this,s,e);if(r!==undefined){var n=e[e.length-1];n.push(r)}}};sv.makeReplacer=function(t,i){return function(s,e){var r=t.call(i!==undefined?i:this,s,e);if(r!==undefined){e[e.length-1]=r}}};sv.makeObjectPropertyPusher=function(t,i,s){return function(e,r){var n=t.call(s!==undefined?s:this,e,r);if(n!==undefined){var h=r[r.length-1];var a=i!==undefined?i:e.localName;var o;if(a in h){o=h[a]}else{o=h[a]=[]}o.push(n)}}};sv.makeObjectPropertySetter=function(t,i,s){return function(e,r){var n=t.call(s!==undefined?s:this,e,r);if(n!==undefined){var h=r[r.length-1];var a=i!==undefined?i:e.localName;h[a]=n}}};sv.makeChildAppender=function(t,i){return function(s,e,r){t.call(i!==undefined?i:this,s,e,r);var n=r[r.length-1];var h=n.node;h.appendChild(s)}};sv.makeArraySerializer=function(t,i){var s,e;return function(i,r,n){if(s===undefined){s={};var h={};h[i.localName]=t;s[i.namespaceURI]=h;e=sv.makeSimpleNodeFactory(i.localName)}sv.serialize(s,e,r,n)}};sv.makeSimpleNodeFactory=function(t,i){var s=t;return function(t,e,r){var n=e[e.length-1];var h=n.node;var a=s;if(a===undefined){a=r}var o=i;if(i===undefined){o=h.namespaceURI}return sv.createElementNS(o,a)}};sv.OBJECT_PROPERTY_NODE_FACTORY=sv.makeSimpleNodeFactory();sv.makeSequence=function(t,i){var s=i.length;var e=new Array(s);for(var r=0;r<s;++r){e[r]=t[i[r]]}return e};sv.makeStructureNS=function(t,i,s){var e=s!==undefined?s:{};var r,n;for(r=0,n=t.length;r<n;++r){e[t[r]]=i}return e};sv.parseNode=function(t,i,s,e){var r;for(r=i.firstElementChild;r;r=r.nextElementSibling){var n=t[r.namespaceURI];if(n!==undefined){var h=n[r.localName];if(h!==undefined){h.call(e,r,s)}}}};sv.pushParseAndPop=function(t,i,s,e,r){e.push(t);sv.parseNode(i,s,e,r);return e.pop()};sv.serialize=function(t,i,s,e,r,n){var h=(r!==undefined?r:s).length;var a,o;for(var f=0;f<h;++f){a=s[f];if(a!==undefined){o=i.call(n,a,e,r!==undefined?r[f]:undefined);if(o!==undefined){t[o.namespaceURI][o.localName].call(n,o,a,e)}}}};sv.pushSerializeAndPop=function(t,i,s,e,r,n,h){r.push(t);sv.serialize(i,s,e,r,n,h);return r.pop()};var ev={};ev.loadFeaturesXhr=function(t,i,s,e){return function(r,n,h){var a=new XMLHttpRequest;a.open("GET",typeof t==="function"?t(r,n,h):t,true);if(i.getType()==iv.ARRAY_BUFFER){a.responseType="arraybuffer"}a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=i.getType();var n;if(r==iv.JSON||r==iv.TEXT){n=a.responseText}else if(r==iv.XML){n=a.responseXML;if(!n){n=sv.parse(a.responseText)}}else if(r==iv.ARRAY_BUFFER){n=a.response}if(n){s.call(this,i.readFeatures(n,{featureProjection:h}),i.readProjection(n),i.getLastExtent())}else{e.call(this)}}else{e.call(this)}}.bind(this);a.onerror=function(){e.call(this)}.bind(this);a.send()}};ev.xhr=function(t,i){return ev.loadFeaturesXhr(t,i,(function(t,i){this.addFeatures(t)}),kh.nullFunction)};var rv={};rv.all=function(t,i){return[[-Infinity,-Infinity,Infinity,Infinity]]};rv.bbox=function(t,i){return[t]};rv.tile=function(t){return function(i,s){var e=t.getZForResolution(s);var r=t.getTileRangeForExtentAndZ(i,e);var n=[];var h=[e,0,0];for(h[1]=r.minX;h[1]<=r.maxX;++h[1]){for(h[2]=r.minY;h[2]<=r.maxY;++h[2]){n.push(t.getTileCoordExtent(h))}}return n}};var nv={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"};var hv=function(t){var i=t||{};Yu.call(this,{attributions:i.attributions,logo:i.logo,projection:undefined,state:io.READY,wrapX:i.wrapX!==undefined?i.wrapX:true});this.loader_=kh.nullFunction;this.format_=i.format;this.overlaps_=i.overlaps==undefined?true:i.overlaps;this.url_=i.url;if(i.loader!==undefined){this.loader_=i.loader}else if(this.url_!==undefined){Dh.assert(this.format_,7);this.loader_=ev.xhr(this.url_,this.format_)}this.strategy_=i.strategy!==undefined?i.strategy:rv.all;var s=i.useSpatialIndex!==undefined?i.useSpatialIndex:true;this.featuresRtree_=s?new uu:null;this.loadedExtentsRtree_=new uu;this.nullGeometryFeatures_={};this.idIndex_={};this.undefIdIndex_={};this.featureChangeKeys_={};this.featuresCollection_=null;var e,r;if(i.features instanceof xa){e=i.features;r=e.getArray()}else if(Array.isArray(i.features)){r=i.features}if(!s&&e===undefined){e=new xa(r)}if(r!==undefined){this.addFeaturesInternal(r)}if(e!==undefined){this.bindFeaturesCollection_(e)}};kh.inherits(hv,Yu);hv.prototype.addFeature=function(t){this.addFeatureInternal(t);this.changed()};hv.prototype.addFeatureInternal=function(t){var i=kh.getUid(t).toString();if(!this.addToIndex_(i,t)){return}this.setupChangeEvents_(i,t);var s=t.getGeometry();if(s){var e=s.getExtent();if(this.featuresRtree_){this.featuresRtree_.insert(e,t)}}else{this.nullGeometryFeatures_[i]=t}this.dispatchEvent(new hv.Event(nv.ADDFEATURE,t))};hv.prototype.setupChangeEvents_=function(t,i){this.featureChangeKeys_[t]=[Ih.listen(i,Ah.CHANGE,this.handleFeatureChange_,this),Ih.listen(i,Nh.PROPERTYCHANGE,this.handleFeatureChange_,this)]};hv.prototype.addToIndex_=function(t,i){var s=true;var e=i.getId();if(e!==undefined){if(!(e.toString()in this.idIndex_)){this.idIndex_[e.toString()]=i}else{s=false}}else{Dh.assert(!(t in this.undefIdIndex_),30);this.undefIdIndex_[t]=i}return s};hv.prototype.addFeatures=function(t){this.addFeaturesInternal(t);this.changed()};hv.prototype.addFeaturesInternal=function(t){var i,s,e,r;var n=[];var h=[];var a=[];for(s=0,e=t.length;s<e;s++){r=t[s];i=kh.getUid(r).toString();if(this.addToIndex_(i,r)){h.push(r)}}for(s=0,e=h.length;s<e;s++){r=h[s];i=kh.getUid(r).toString();this.setupChangeEvents_(i,r);var o=r.getGeometry();if(o){var f=o.getExtent();n.push(f);a.push(r)}else{this.nullGeometryFeatures_[i]=r}}if(this.featuresRtree_){this.featuresRtree_.load(n,a)}for(s=0,e=h.length;s<e;s++){this.dispatchEvent(new hv.Event(nv.ADDFEATURE,h[s]))}};hv.prototype.bindFeaturesCollection_=function(t){var i=false;Ih.listen(this,nv.ADDFEATURE,(function(s){if(!i){i=true;t.push(s.feature);i=false}}));Ih.listen(this,nv.REMOVEFEATURE,(function(s){if(!i){i=true;t.remove(s.feature);i=false}}));Ih.listen(t,ba.ADD,(function(t){if(!i){i=true;this.addFeature(t.element);i=false}}),this);Ih.listen(t,ba.REMOVE,(function(t){if(!i){i=true;this.removeFeature(t.element);i=false}}),this);this.featuresCollection_=t};hv.prototype.clear=function(t){if(t){for(var i in this.featureChangeKeys_){var s=this.featureChangeKeys_[i];s.forEach(Ih.unlistenByKey)}if(!this.featuresCollection_){this.featureChangeKeys_={};this.idIndex_={};this.undefIdIndex_={}}}else{if(this.featuresRtree_){this.featuresRtree_.forEach(this.removeFeatureInternal,this);for(var e in this.nullGeometryFeatures_){this.removeFeatureInternal(this.nullGeometryFeatures_[e])}}}if(this.featuresCollection_){this.featuresCollection_.clear()}if(this.featuresRtree_){this.featuresRtree_.clear()}this.loadedExtentsRtree_.clear();this.nullGeometryFeatures_={};var r=new hv.Event(nv.CLEAR);this.dispatchEvent(r);this.changed()};hv.prototype.forEachFeature=function(t,i){if(this.featuresRtree_){return this.featuresRtree_.forEach(t,i)}else if(this.featuresCollection_){return this.featuresCollection_.forEach(t,i)}};hv.prototype.forEachFeatureAtCoordinateDirect=function(t,i,s){var e=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(e,(function(e){var r=e.getGeometry();if(r.intersectsCoordinate(t)){return i.call(s,e)}else{return undefined}}))};hv.prototype.forEachFeatureInExtent=function(t,i,s){if(this.featuresRtree_){return this.featuresRtree_.forEachInExtent(t,i,s)}else if(this.featuresCollection_){return this.featuresCollection_.forEach(i,s)}};hv.prototype.forEachFeatureIntersectingExtent=function(t,i,s){return this.forEachFeatureInExtent(t,(function(e){var r=e.getGeometry();if(r.intersectsExtent(t)){var n=i.call(s,e);if(n){return n}}}))};hv.prototype.getFeaturesCollection=function(){return this.featuresCollection_};hv.prototype.getFeatures=function(){var t;if(this.featuresCollection_){t=this.featuresCollection_.getArray()}else if(this.featuresRtree_){t=this.featuresRtree_.getAll();if(!Ch.isEmpty(this.nullGeometryFeatures_)){jh.extend(t,Ch.getValues(this.nullGeometryFeatures_))}}return t};hv.prototype.getFeaturesAtCoordinate=function(t){var i=[];this.forEachFeatureAtCoordinateDirect(t,(function(t){i.push(t)}));return i};hv.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_.getInExtent(t)};hv.prototype.getClosestFeatureToCoordinate=function(t,i){var s=t[0];var e=t[1];var r=null;var n=[NaN,NaN];var h=Infinity;var a=[-Infinity,-Infinity,Infinity,Infinity];var o=i?i:Yh.TRUE;this.featuresRtree_.forEachInExtent(a,(function(t){if(o(t)){var i=t.getGeometry();var f=h;h=i.closestPointXY(s,e,n,h);if(h<f){r=t;var u=Math.sqrt(h);a[0]=s-u;a[1]=e-u;a[2]=s+u;a[3]=e+u}}}));return r};hv.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)};hv.prototype.getFeatureById=function(t){var i=this.idIndex_[t.toString()];return i!==undefined?i:null};hv.prototype.getFormat=function(){return this.format_};hv.prototype.getOverlaps=function(){return this.overlaps_};hv.prototype.getResolutions=function(){};hv.prototype.getUrl=function(){return this.url_};hv.prototype.handleFeatureChange_=function(t){var i=t.target;var s=kh.getUid(i).toString();var e=i.getGeometry();if(!e){if(!(s in this.nullGeometryFeatures_)){if(this.featuresRtree_){this.featuresRtree_.remove(i)}this.nullGeometryFeatures_[s]=i}}else{var r=e.getExtent();if(s in this.nullGeometryFeatures_){delete this.nullGeometryFeatures_[s];if(this.featuresRtree_){this.featuresRtree_.insert(r,i)}}else{if(this.featuresRtree_){this.featuresRtree_.update(r,i)}}}var n=i.getId();if(n!==undefined){var h=n.toString();if(s in this.undefIdIndex_){delete this.undefIdIndex_[s];this.idIndex_[h]=i}else{if(this.idIndex_[h]!==i){this.removeFromIdIndex_(i);this.idIndex_[h]=i}}}else{if(!(s in this.undefIdIndex_)){this.removeFromIdIndex_(i);this.undefIdIndex_[s]=i}}this.changed();this.dispatchEvent(new hv.Event(nv.CHANGEFEATURE,i))};hv.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Ch.isEmpty(this.nullGeometryFeatures_)};hv.prototype.loadFeatures=function(t,i,s){var e=this.loadedExtentsRtree_;var r=this.strategy_(t,i);var n,h;for(n=0,h=r.length;n<h;++n){var a=r[n];var o=e.forEachInExtent(a,(function(t){return qh.containsExtent(t.extent,a)}));if(!o){this.loader_.call(this,a,i,s);e.insert(a,{extent:a.slice()})}}};hv.prototype.removeLoadedExtent=function(t){var i=this.loadedExtentsRtree_;var s;i.forEachInExtent(t,(function(i){if(qh.equals(i.extent,t)){s=i;return true}}));if(s){i.remove(s)}};hv.prototype.removeFeature=function(t){var i=kh.getUid(t).toString();if(i in this.nullGeometryFeatures_){delete this.nullGeometryFeatures_[i]}else{if(this.featuresRtree_){this.featuresRtree_.remove(t)}}this.removeFeatureInternal(t);this.changed()};hv.prototype.removeFeatureInternal=function(t){var i=kh.getUid(t).toString();this.featureChangeKeys_[i].forEach(Ih.unlistenByKey);delete this.featureChangeKeys_[i];var s=t.getId();if(s!==undefined){delete this.idIndex_[s.toString()]}else{delete this.undefIdIndex_[i]}this.dispatchEvent(new hv.Event(nv.REMOVEFEATURE,t))};hv.prototype.removeFromIdIndex_=function(t){var i=false;for(var s in this.idIndex_){if(this.idIndex_[s]===t){delete this.idIndex_[s];i=true;break}}return i};hv.prototype.setLoader=function(t){this.loader_=t};hv.Event=function(t,i){Oh.call(this,t);this.feature=i};kh.inherits(hv.Event,Oh);var av={};av.lineString=function(t,i,s,e,r,n){var h=NaN;var a=NaN;var o=(s-i)/e;if(o===1){h=t[i];a=t[i+1]}else if(o==2){h=(1-r)*t[i]+r*t[i+e];a=(1-r)*t[i+1]+r*t[i+e+1]}else if(o!==0){var f=t[i];var u=t[i+1];var v=0;var l=[0];var c;for(c=i+e;c<s;c+=e){var d=t[c];var m=t[c+1];v+=Math.sqrt((d-f)*(d-f)+(m-u)*(m-u));l.push(v);f=d;u=m}var p=r*v;var M=jh.binarySearch(l,p);if(M<0){var z=(p-l[-M-2])/(l[-M-1]-l[-M-2]);var _=i+(-M-2)*e;h=Fh.lerp(t[_],t[_+e],z);a=Fh.lerp(t[_+1],t[_+e+1],z)}else{h=t[i+M*e];a=t[i+M*e+1]}}if(n){n[0]=h;n[1]=a;return n}else{return[h,a]}};av.lineStringCoordinateAtM=function(t,i,s,e,r,n){if(s==i){return null}var h;if(r<t[i+e-1]){if(n){h=t.slice(i,i+e);h[e-1]=r;return h}else{return null}}else if(t[s-1]<r){if(n){h=t.slice(s-e,s);h[e-1]=r;return h}else{return null}}if(r==t[i+e-1]){return t.slice(i,i+e)}var a=i/e;var o=s/e;while(a<o){var f=a+o>>1;if(r<t[(f+1)*e-1]){o=f}else{a=f+1}}var u=t[a*e-1];if(r==u){return t.slice((a-1)*e,(a-1)*e+e)}var v=t[(a+1)*e-1];var l=(r-u)/(v-u);h=[];var c;for(c=0;c<e-1;++c){h.push(Fh.lerp(t[(a-1)*e+c],t[a*e+c],l))}h.push(r);return h};av.lineStringsCoordinateAtM=function(t,i,s,e,r,n,h){if(h){return av.lineStringCoordinateAtM(t,i,s[s.length-1],e,r,n)}var a;if(r<t[e-1]){if(n){a=t.slice(0,e);a[e-1]=r;return a}else{return null}}if(t[t.length-1]<r){if(n){a=t.slice(t.length-e);a[e-1]=r;return a}else{return null}}var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];if(i==u){continue}if(r<t[i+e-1]){return null}else if(r<=t[u-1]){return av.lineStringCoordinateAtM(t,i,u,e,r,false)}i=u}return null};var ov=function(t,i){ra.call(this);this.flatMidpoint_=null;this.flatMidpointRevision_=-1;this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.setCoordinates(t,i)};kh.inherits(ov,ra);ov.prototype.appendCoordinate=function(t){if(!this.flatCoordinates){this.flatCoordinates=t.slice()}else{jh.extend(this.flatCoordinates,t)}this.changed()};ov.prototype.clone=function(){var t=new ov(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};ov.prototype.closestPointXY=function(t,i,s,e){if(e<qh.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(ha.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return ha.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,false,t,i,s,e)};ov.prototype.forEachSegment=function(t,i){return da.forEach(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)};ov.prototype.getCoordinateAtM=function(t,i){if(this.layout!=Xh.XYM&&this.layout!=Xh.XYZM){return null}var s=i!==undefined?i:false;return av.lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,s)};ov.prototype.getCoordinates=function(){return oa.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};ov.prototype.getCoordinateAt=function(t,i){return av.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)};ov.prototype.getLength=function(){return xf.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};ov.prototype.getFlatMidpoint=function(){if(this.flatMidpointRevision_!=this.getRevision()){this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_);this.flatMidpointRevision_=this.getRevision()}return this.flatMidpoint_};ov.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=fa.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new ov(null);s.setFlatCoordinates(Xh.XY,i);return s};ov.prototype.getType=function(){return Gh.LINE_STRING};ov.prototype.intersectsExtent=function(t){return ma.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)};ov.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(Xh.XY,null)}else{this.setLayout(i,t,1);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=aa.coordinates(this.flatCoordinates,0,t,this.stride);this.changed()}};ov.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var fv={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var uv=function(t){var i=t?t:{};var s=Ch.assign({},i);delete s.preload;delete s.useInterimTilesOnError;vo.call(this,s);this.setPreload(i.preload!==undefined?i.preload:0);this.setUseInterimTilesOnError(i.useInterimTilesOnError!==undefined?i.useInterimTilesOnError:true);this.type=Fo.TILE};kh.inherits(uv,vo);uv.prototype.getPreload=function(){return this.get(fv.PRELOAD)};uv.prototype.setPreload=function(t){this.set(fv.PRELOAD,t)};uv.prototype.getUseInterimTilesOnError=function(){return this.get(fv.USE_INTERIM_TILES_ON_ERROR)};uv.prototype.setUseInterimTilesOnError=function(t){this.set(fv.USE_INTERIM_TILES_ON_ERROR,t)};var vv=function(t){var i=t?t:{};var s=Ch.assign({},i);delete s.style;delete s.renderBuffer;delete s.updateWhileAnimating;delete s.updateWhileInteracting;vo.call(this,s);this.declutter_=i.declutter!==undefined?i.declutter:false;this.renderBuffer_=i.renderBuffer!==undefined?i.renderBuffer:100;this.style_=null;this.styleFunction_=undefined;this.setStyle(i.style);this.updateWhileAnimating_=i.updateWhileAnimating!==undefined?i.updateWhileAnimating:false;this.updateWhileInteracting_=i.updateWhileInteracting!==undefined?i.updateWhileInteracting:false;this.renderMode_=i.renderMode||Go.VECTOR;this.type=Fo.VECTOR};kh.inherits(vv,vo);vv.prototype.getDeclutter=function(){return this.declutter_};vv.prototype.setDeclutter=function(t){this.declutter_=t};vv.prototype.getRenderBuffer=function(){return this.renderBuffer_};vv.prototype.getRenderOrder=function(){return this.get(vv.Property_.RENDER_ORDER)};vv.prototype.getStyle=function(){return this.style_};vv.prototype.getStyleFunction=function(){return this.styleFunction_};vv.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_};vv.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_};vv.prototype.setRenderOrder=function(t){this.set(vv.Property_.RENDER_ORDER,t)};vv.prototype.setStyle=function(t){this.style_=t!==undefined?t:Au.defaultFunction;this.styleFunction_=t===null?undefined:Au.createFunction(this.style_);this.changed()};vv.prototype.getRenderMode=function(){return this.renderMode_};vv.Property_={RENDER_ORDER:"renderOrder"};var lv={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"};var cv=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-scale-line";this.innerElement_=document.createElement("DIV");this.innerElement_.className=s+"-inner";this.element_=document.createElement("DIV");this.element_.className=s+" "+fo.CLASS_UNSELECTABLE;this.element_.appendChild(this.innerElement_);this.viewState_=null;this.minWidth_=i.minWidth!==undefined?i.minWidth:64;this.renderedVisible_=false;this.renderedWidth_=undefined;this.renderedHTML_="";var e=i.render?i.render:cv.render;oo.call(this,{element:this.element_,render:e,target:i.target});Ih.listen(this,Ph.getChangeEventType(cv.Property_.UNITS),this.handleUnitsChanged_,this);this.setUnits(i.units||lv.METRIC)};kh.inherits(cv,oo);cv.LEADING_DIGITS=[1,2,5];cv.prototype.getUnits=function(){return this.get(cv.Property_.UNITS)};cv.render=function(t){var i=t.frameState;if(!i){this.viewState_=null}else{this.viewState_=i.viewState}this.updateElement_()};cv.prototype.handleUnitsChanged_=function(){this.updateElement_()};cv.prototype.setUnits=function(t){this.set(cv.Property_.UNITS,t)};cv.prototype.updateElement_=function(){var t=this.viewState_;if(!t){if(this.renderedVisible_){this.element_.style.display="none";this.renderedVisible_=false}return}var i=t.center;var s=t.projection;var e=this.getUnits();var r=e==lv.DEGREES?Hh.DEGREES:Hh.METERS;var n=ia.getPointResolution(s,t.resolution,i,r);if(e!=lv.DEGREES){n*=s.getMetersPerUnit()}var h=this.minWidth_*n;var a="";if(e==lv.DEGREES){var o=ia.METERS_PER_UNIT[Hh.DEGREES];if(s.getUnits()==Hh.DEGREES){h*=o}else{n/=o}if(h<o/60){a="″";n*=3600}else if(h<o){a="′";n*=60}else{a="°"}}else if(e==lv.IMPERIAL){if(h<.9144){a="in";n/=.0254}else if(h<1609.344){a="ft";n/=.3048}else{a="mi";n/=1609.344}}else if(e==lv.NAUTICAL){n/=1852;a="nm"}else if(e==lv.METRIC){if(h<.001){a="μm";n*=1e6}else if(h<1){a="mm";n*=1e3}else if(h<1e3){a="m"}else{a="km";n/=1e3}}else if(e==lv.US){if(h<.9144){a="in";n*=39.37}else if(h<1609.344){a="ft";n/=.30480061}else{a="mi";n/=1609.3472}}else{Dh.assert(false,33)}var f=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));var u,v;while(true){u=cv.LEADING_DIGITS[(f%3+3)%3]*Math.pow(10,Math.floor(f/3));v=Math.round(u/n);if(isNaN(v)){this.element_.style.display="none";this.renderedVisible_=false;return}else if(v>=this.minWidth_){break}++f}var l=u+" "+a;if(this.renderedHTML_!=l){this.innerElement_.innerHTML=l;this.renderedHTML_=l}if(this.renderedWidth_!=v){this.innerElement_.style.width=v+"px";this.renderedWidth_=v}if(!this.renderedVisible_){this.element_.style.display="";this.renderedVisible_=true}};cv.Property_={UNITS:"units"};var dv={FRACTION:"fraction",PIXELS:"pixels"};var mv=function(t,i,s,e,r,n){Th.call(this);this.hitDetectionImage_=null;this.image_=!t?new Image:t;if(e!==null){this.image_.crossOrigin=e}this.canvas_=n?document.createElement("CANVAS"):null;this.color_=n;this.imageListenerKeys_=null;this.imageState_=r;this.size_=s;this.src_=i;this.tainting_=false;if(this.imageState_==Lo.LOADED){this.determineTainting_()}};kh.inherits(mv,Th);mv.get=function(t,i,s,e,r,n){var h=$o.iconImageCache;var a=h.get(i,e,n);if(!a){a=new mv(t,i,s,e,r,n);h.set(i,e,n,a)}return a};mv.prototype.determineTainting_=function(){var t=$a.createCanvasContext2D(1,1);try{t.drawImage(this.image_,0,0);t.getImageData(0,0,1,1)}catch(t){this.tainting_=true}};mv.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Ah.CHANGE)};mv.prototype.handleImageError_=function(){this.imageState_=Lo.ERROR;this.unlistenImage_();this.dispatchChangeEvent_()};mv.prototype.handleImageLoad_=function(){this.imageState_=Lo.LOADED;if(this.size_){this.image_.width=this.size_[0];this.image_.height=this.size_[1]}this.size_=[this.image_.width,this.image_.height];this.unlistenImage_();this.determineTainting_();this.replaceColor_();this.dispatchChangeEvent_()};mv.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_};mv.prototype.getImageState=function(){return this.imageState_};mv.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_){if(this.tainting_){var i=this.size_[0];var s=this.size_[1];var e=$a.createCanvasContext2D(i,s);e.fillRect(0,0,i,s);this.hitDetectionImage_=e.canvas}else{this.hitDetectionImage_=this.image_}}return this.hitDetectionImage_};mv.prototype.getSize=function(){return this.size_};mv.prototype.getSrc=function(){return this.src_};mv.prototype.load=function(){if(this.imageState_==Lo.IDLE){this.imageState_=Lo.LOADING;this.imageListenerKeys_=[Ih.listenOnce(this.image_,Ah.ERROR,this.handleImageError_,this),Ih.listenOnce(this.image_,Ah.LOAD,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}};mv.prototype.replaceColor_=function(){if(this.tainting_||this.color_===null){return}this.canvas_.width=this.image_.width;this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);var i=t.getImageData(0,0,this.image_.width,this.image_.height);var s=i.data;var e=this.color_[0]/255;var r=this.color_[1]/255;var n=this.color_[2]/255;for(var h=0,a=s.length;h<a;h+=4){s[h]*=e;s[h+1]*=r;s[h+2]*=n}t.putImageData(i,0,0)};mv.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ih.unlistenByKey);this.imageListenerKeys_=null};var pv={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var Mv=function(t){var i=t||{};this.anchor_=i.anchor!==undefined?i.anchor:[.5,.5];this.normalizedAnchor_=null;this.anchorOrigin_=i.anchorOrigin!==undefined?i.anchorOrigin:pv.TOP_LEFT;this.anchorXUnits_=i.anchorXUnits!==undefined?i.anchorXUnits:dv.FRACTION;this.anchorYUnits_=i.anchorYUnits!==undefined?i.anchorYUnits:dv.FRACTION;this.crossOrigin_=i.crossOrigin!==undefined?i.crossOrigin:null;var s=i.img!==undefined?i.img:null;var e=i.imgSize!==undefined?i.imgSize:null;var r=i.src;Dh.assert(!(r!==undefined&&s),4);Dh.assert(!s||s&&e,5);if((r===undefined||r.length===0)&&s){r=s.src||kh.getUid(s).toString()}Dh.assert(r!==undefined&&r.length>0,6);var n=i.src!==undefined?Lo.IDLE:Lo.LOADED;this.color_=i.color!==undefined?Uo.asArray(i.color):null;this.iconImage_=mv.get(s,r,e,this.crossOrigin_,n,this.color_);this.offset_=i.offset!==undefined?i.offset:[0,0];this.offsetOrigin_=i.offsetOrigin!==undefined?i.offsetOrigin:pv.TOP_LEFT;this.origin_=null;this.size_=i.size!==undefined?i.size:null;var h=i.opacity!==undefined?i.opacity:1;var a=i.rotateWithView!==undefined?i.rotateWithView:false;var o=i.rotation!==undefined?i.rotation:0;var f=i.scale!==undefined?i.scale:1;var u=i.snapToPixel!==undefined?i.snapToPixel:true;Iu.call(this,{opacity:h,rotation:o,scale:f,snapToPixel:u,rotateWithView:a})};kh.inherits(Mv,Iu);Mv.prototype.clone=function(){return new Mv({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||undefined,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:this.size_!==null?this.size_.slice():undefined,opacity:this.getOpacity(),scale:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})};Mv.prototype.getAnchor=function(){if(this.normalizedAnchor_){return this.normalizedAnchor_}var t=this.anchor_;var i=this.getSize();if(this.anchorXUnits_==dv.FRACTION||this.anchorYUnits_==dv.FRACTION){if(!i){return null}t=this.anchor_.slice();if(this.anchorXUnits_==dv.FRACTION){t[0]*=i[0]}if(this.anchorYUnits_==dv.FRACTION){t[1]*=i[1]}}if(this.anchorOrigin_!=pv.TOP_LEFT){if(!i){return null}if(t===this.anchor_){t=this.anchor_.slice()}if(this.anchorOrigin_==pv.TOP_RIGHT||this.anchorOrigin_==pv.BOTTOM_RIGHT){t[0]=-t[0]+i[0]}if(this.anchorOrigin_==pv.BOTTOM_LEFT||this.anchorOrigin_==pv.BOTTOM_RIGHT){t[1]=-t[1]+i[1]}}this.normalizedAnchor_=t;return this.normalizedAnchor_};Mv.prototype.getColor=function(){return this.color_};Mv.prototype.getImage=function(t){return this.iconImage_.getImage(t)};Mv.prototype.getImageSize=function(){return this.iconImage_.getSize()};Mv.prototype.getHitDetectionImageSize=function(){return this.getImageSize()};Mv.prototype.getImageState=function(){return this.iconImage_.getImageState()};Mv.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)};Mv.prototype.getOrigin=function(){if(this.origin_){return this.origin_}var t=this.offset_;if(this.offsetOrigin_!=pv.TOP_LEFT){var i=this.getSize();var s=this.iconImage_.getSize();if(!i||!s){return null}t=t.slice();if(this.offsetOrigin_==pv.TOP_RIGHT||this.offsetOrigin_==pv.BOTTOM_RIGHT){t[0]=s[0]-i[0]-t[0]}if(this.offsetOrigin_==pv.BOTTOM_LEFT||this.offsetOrigin_==pv.BOTTOM_RIGHT){t[1]=s[1]-i[1]-t[1]}}this.origin_=t;return this.origin_};Mv.prototype.getSrc=function(){return this.iconImage_.getSrc()};Mv.prototype.getSize=function(){return!this.size_?this.iconImage_.getSize():this.size_};Mv.prototype.listenImageChange=function(t,i){return Ih.listen(this.iconImage_,Ah.CHANGE,t,i)};Mv.prototype.load=function(){this.iconImage_.load()};Mv.prototype.unlistenImageChange=function(t,i){Ih.unlisten(this.iconImage_,Ah.CHANGE,t,i)};const zv=`<svg width="16" height="24" viewBox="0 0 16 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.0011 22.5728L13.2809 12.0132H2.72134L8.0011 22.5728Z" fill="#DEDEDE" stroke="#BFBFBF" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" fill="#D0021B"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="#D0021B" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="black" stroke-opacity="0.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n`;const _v=':host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;}:host[hidden],:host[stzh-hidden]{display:none}:host::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-olmap{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;position:relative;width:100%;aspect-ratio:1/1}stzh-olmap[hidden],stzh-olmap[stzh-hidden]{display:none}stzh-olmap::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}stzh-olmap *,stzh-olmap *::before,stzh-olmap *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}stzh-olmap .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}stzh-olmap .stzh-fylingfocus-focused{outline-style:none !important}stzh-olmap .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}@media print{stzh-olmap{page-break-inside:avoid;break-inside:avoid}}@media screen and (min-width: 600px){stzh-olmap{aspect-ratio:16/9}}@media screen and (min-width: 900px){stzh-olmap{aspect-ratio:21/9}}.stzh-olmap{}.stzh-olmap__map{position:absolute;width:100%;height:100%;top:0;left:0}.stzh-olmap__map--print{margin-top:var(--stzh-space-xxlarge);max-width:100%;height:auto}.stzh-olmap__print-image{display:block;max-width:100%}.stzh-olmap .ol-overlaycontainer-stopevent{touch-action:manipulation}.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom-in,.stzh-olmap .ol-zoom-out,.stzh-olmap .ol-rotate-reset{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-deca-font-size);line-height:var(--stzh-font-deca-text-line-height);letter-spacing:var(--stzh-font-deca-text-letter-spacing);position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border:none;border-radius:0;color:var(--stzh-color-primary);transition:all var(--stzh-base-transition-animation-speed) ease;background-color:var(--stzh-color-white);width:var(--stzh-form-input-small-height);height:var(--stzh-form-input-small-height);cursor:pointer}.stzh-olmap .ol-print stzh-icon,.stzh-olmap .ol-location stzh-icon,.stzh-olmap .ol-zoom-in stzh-icon,.stzh-olmap .ol-zoom-out stzh-icon,.stzh-olmap .ol-rotate-reset stzh-icon{--size:var(--stzh-icon-size-small)}.stzh-olmap .ol-print:hover,.stzh-olmap .ol-location:hover,.stzh-olmap .ol-zoom-in:hover,.stzh-olmap .ol-zoom-out:hover,.stzh-olmap .ol-rotate-reset:hover{color:var(--stzh-color-primary70);background:var(--stzh-color-secondary20)}.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{position:absolute;right:var(--stzh-space-xsmall);bottom:var(--stzh-space-xsmall);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--stzh-button-border-radius)}@media print{.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{display:none}}.stzh-olmap .ol-layer{left:var(--stzh-space-xsmall);right:auto;padding:var(--stzh-space-xxxsmall);border:none;cursor:pointer}.stzh-olmap .ol-layer__thumbnail{width:4.75rem;height:4.75rem;display:block}.stzh-olmap .ol-layer__text{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);position:absolute;bottom:0;left:0;right:0;text-align:left;background-color:var(--stzh-color-white);color:var(--stzh-color-primary);padding-left:calc(var(--stzh-space-xxxsmall) + 0.0625rem);padding-right:calc(var(--stzh-space-xxxsmall) + 0.0625rem)}.stzh-olmap .ol-layer:hover .ol-layer__text{color:var(--stzh-color-primary-hover)}.stzh-olmap .ol-location{margin-bottom:calc(\n var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2\n )}.stzh-olmap .ol-location:hover{color:var(--stzh-color-primary-hover);background:var(--stzh-color-white)}.stzh-olmap .ol-location.active{color:var(--stzh-color-white);background:var(--stzh-color-primary)}.stzh-olmap .ol-zoom{margin-bottom:calc(\n var(--stzh-form-input-small-height) + var(--stzh-space-xsmall) + var(--stzh-space-xxxsmall)\n );background-color:transparent;border-radius:var(--stzh-button-border-radius);overflow:hidden}.stzh-olmap .ol-zoom-in{margin-bottom:var(--stzh-space-xxxsmall)}.stzh-olmap .ol-rotate-reset{width:2rem;height:2rem;border-radius:50%;box-shadow:none;margin-right:calc((var(--stzh-form-input-small-height) - 2rem) / 2);margin-bottom:calc(\n var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2 +\n var(--stzh-space-xxxsmall)\n )}.stzh-olmap .ol-rotate-reset span{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-olmap .ol-rotate-reset svg{width:0.99rem;height:1.32188rem}.stzh-olmap .ol-hidden{display:none}.stzh-olmap .ol-compass{display:flex;align-items:center;justify-content:center}.stzh-olmap .ol-scale-line{position:absolute;left:var(--stzh-space-xsmall);bottom:var(--stzh-space-xsmall);margin-left:calc(\n 4.75rem +\n var(--stzh-space-xxxsmall) + var(--stzh-space-xsmall)\n )}.stzh-olmap .ol-scale-line-inner{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);position:relative;color:var(--stzh-color-black);text-align:center;filter:drop-shadow(-0.0625rem 0px 0px white) drop-shadow(0.0625rem 0px 0px white) drop-shadow(0px -0.0625rem 0px white) drop-shadow(0px 0.0625rem 0px white)}.stzh-olmap .ol-scale-line-inner::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:0.28125rem;border:0.0625rem solid var(--stzh-color-black);border-top:0}.stzh-olmap .ol-attribution{display:none}.stzh-olmap--has-no-layer-control .ol-scale-line{margin-left:0}.stzh-olmap--has-no-print-control .ol-zoom{margin-bottom:0}.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(\n var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall) +\n var(--stzh-space-xxxsmall)\n )}.stzh-olmap--has-location-control .ol-rotate-reset{margin-bottom:calc(\n var(--stzh-form-input-small-height) * 4 + var(--stzh-space-xsmall) * 3 +\n var(--stzh-space-xxxsmall)\n )}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-location{margin-bottom:calc(\n var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall) +\n var(--stzh-space-xxxsmall)\n )}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(\n var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2 +\n var(--stzh-space-xxxsmall)\n )}.stzh-olmap__popover{background-color:var(--stzh-color-grey10);width:18.75rem}@media screen and (max-width: 599px){.stzh-olmap__popover{position:fixed;right:0;bottom:0;left:0;width:100%;z-index:5;display:flex}}.stzh-olmap__popover-content{padding:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{padding:var(--stzh-space-small)}}@media screen and (min-width: 900px){.stzh-olmap__popover-content{padding:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-olmap__popover-content{padding:var(--stzh-space-xlarge)}}.stzh-olmap__popover-content stzh-heading{margin-bottom:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{aspect-ratio:2/1}}.stzh-olmap__popover-link{position:absolute;top:0;right:0;bottom:0;left:0}.stzh-olmap__popover-image{position:relative}@media screen and (max-width: 599px){.stzh-olmap__popover-image{width:8.75rem;min-width:8.75rem;height:8.75rem;max-height:8.75rem;overflow:hidden}}.stzh-olmap__popover-image img{width:100%}@media screen and (max-width: 599px){.stzh-olmap__popover-image img{position:absolute;top:50%;left:50%;width:100%;height:100%;object-fit:cover;transform:translate(-50%, -50%)}}.stzh-olmap__popover *{text-decoration:none}';const gv=_v;window.proj4=Ni;window.proj4.defs("EPSG:2056","+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs");const wv={anchor:[.5,1],anchorXUnits:"fraction",anchorYUnits:"fraction",scale:.5,src:`${window.stzhComponents.pathMedia}/olmap/marker.png`};const yv=Object.assign(Object.assign({},wv),{src:`${window.stzhComponents.pathMedia}/olmap/marker-active.png`});const bv=Object.assign(Object.assign({},wv),{anchor:[.5,.5],src:`${window.stzhComponents.pathMedia}/olmap/marker-position.png`});const xv=class{constructor(s){t(this,s);this.stzhInitialized=i(this,"stzhInitialized",7);this.stzhPostRender=i(this,"stzhPostRender",7);this.stzhMoveStart=i(this,"stzhMoveStart",7);this.stzhMoveEnd=i(this,"stzhMoveEnd",7);this.stzhMovePanZoom=i(this,"stzhMovePanZoom",7);this._layers={};this.geoPositionChanged=false;this.handlePostRender=()=>{this.stzhPostRender.emit({component:"stzh-olmap"})};this.handleDoubleClick=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleMoveStart=()=>{this.stzhMoveStart.emit({component:"stzh-olmap"})};this.handleMoveEnd=()=>{this.stzhMoveEnd.emit({component:"stzh-olmap"});this.writeExtentToUrl().catch()};this.handlePointerdrag=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleChangeResolution=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleInsideModalOpen=()=>{if(this.map){requestAnimationFrame((()=>{this.map.updateSize()}))}};this.handlePrintButtonClick=()=>{if(!this.printIframe){this.printIframe=document.createElement("iframe");Object.assign(this.printIframe.style,{height:"0px",width:"0px",position:"absolute",border:"none"});this.element.append(this.printIframe)}this.printIframe.innerHTML="";const t=this.printIframe.contentWindow;const i=this.constructor.style.replace('@charset "UTF-8";',"");const s=Array.from(document.querySelectorAll("link")).map((t=>t.outerHTML));let e;this.map.once("postcompose",(function(t){const i=t.context.canvas;e=i.toDataURL("image/png")}));this.map.renderSync();t.document.body.innerHTML=`\n ${s.join("")}\n\n <style type="text/css">\n ${i}\n </style>\n\n <div class="stzh-olmap__map stzh-olmap__map--print">\n <img class="stzh-olmap__print-image" src="${e}">\n ${this.element.querySelector(".ol-scale-line.ol-unselectable").outerHTML}\n </div>\n `;setTimeout((()=>{try{t.document.execCommand("print",false,null)}catch(i){t.print()}}),1e3)};this.localization=undefined;this.hostname="www.ogc.stadt-zuerich.ch";this.scaleControl=true;this.layerControl=true;this.printControl=true;this.locationControl=false;this.layer="streets";this.zoom=7;this.zoomLocation=7;this.center=[2683311,1247082];this.centerMarker=true;this.pinchRotateThreshold=.3;this.resolutions=[67.73333333333,33.8666666667,16.9333333333,8.4666666667,4.2333333333,2.1166666667,1.0583333333,.5291666667,.2645833333,.1322916667,.0661458333];this.writeExtentToUrlEnabled=false;this.layers={streets:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-streets.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"basiskarte_zuerich_gebaeudeschraegansicht",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}},satellite:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-satellite.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"orthofoto",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}}};this._initialExtent=undefined}layersWatcher(t){if(typeof t==="string"){this._layers=JSON.parse(t)}else{this._layers=t}}resolutionsWatcher(t){if(typeof t==="string"){this._resolutions=JSON.parse(t)}else{this._resolutions=t}}zoomWatcher(t){if(this.map){this.map.getView().setZoom(t)}}scaleControlWatcher(t){if(!this.map){return}if(t){this.scaleControlOl=new cv({units:"metric"});this.map.addControl(this.scaleControlOl)}else{if(this.scaleControl){this.map.removeControl(this.scaleControlOl)}this.scaleControlOl=null}}printControlWatcher(t){if(!this.map){return}if(t){this.printControlElement=document.createElement("button");this.printControlElement.className="ol-print";this.printControlElement.type="button";this.printControlElement.ariaLabel=this.localization.printLabel;this.printControlElement.addEventListener("click",this.handlePrintButtonClick);this.printControlElement.innerHTML='<stzh-icon name="print" class="ol-print__icon"></stzh-icon>';this.printControlOl=new oo({element:this.printControlElement});this.map.addControl(this.printControlOl)}else{if(this.printControlOl){this.map.removeControl(this.printControlOl)}this.printControlOl=null;this.printControlElement=null}}layerControlWatcher(t){if(!this.map||this.layersArray.length===1){return}if(t){this.layerControlElement=document.createElement("button");this.layerControlElement.className="ol-layer";this.layerControlElement.type="button";this.layerControlElement.addEventListener("click",(()=>{this.layer=this.layer==="streets"?"satellite":"streets"}));this.layerControlImageElement=document.createElement("img");this.layerControlImageElement.className="ol-layer__thumbnail";this.layerControlImageElement.setAttribute("role","presentation");this.layerControlImageElement.setAttribute("alt","");this.layerControlTextElement=document.createElement("span");this.layerControlTextElement.className="ol-layer__text";this.layerControlElement.appendChild(this.layerControlImageElement);this.layerControlElement.appendChild(this.layerControlTextElement);this.layerControlOl=new oo({element:this.layerControlElement});this.map.addControl(this.layerControlOl)}else{if(this.layerControlOl){this.map.removeControl(this.layerControlOl)}this.layerControlOl=null;this.layerControlElement=null;this.layerControlImageElement=null;this.layerControlTextElement=null}}locationControlWatcher(t){if(!this.map){return}if(t){this.locationControlElement=document.createElement("button");this.locationControlElement.type="button";this.locationControlElement.className="ol-location";this.locationControlElement.innerHTML='<stzh-icon name="target-bullet" class="ol-location__icon"></stzh-icon>';this.locationControlElement.addEventListener("click",(()=>{const t=this.geolocation.getTracking();if(t){this.disableLocationTracking().catch()}else{this.enableLocationTracking().catch()}}));this.locationControlOl=new oo({element:this.locationControlElement});this.geolocation=new ya({projection:this.map.getView().getProjection()});this.positionMarkerOl=new Ru;this.positionMarkerOl.setId("position");const t=new Au({image:new Mv(bv)});this.positionMarkerOl.setStyle(t);this.positionLayer.getSource().addFeature(this.positionMarkerOl);this.geolocation.on("change:position",(()=>{const t=this.geolocation.getPosition();this.positionMarkerOl.setGeometry(new va(t));if(!this.geoPositionChanged&&qh.containsExtent(this._layers[this.layer].options.extent,this.positionMarkerOl.getGeometry().getExtent())){this.geoPositionChanged=true;this.map.getView().setCenter(t);if(this.zoomLocation){this.map.getView().setZoom(this.zoomLocation)}}}));this.geolocation.on("change:tracking",(()=>{const t=this.geolocation.getTracking();this.positionMarkerOl.setGeometry(null);this.setLocationControlState(t)}));this.geolocation.on("error",(()=>{this.setLocationControlState(false)}));this.map.addControl(this.locationControlOl)}else{this.disableLocationTracking().catch();if(this.locationControlOl){this.map.removeControl(this.locationControlOl)}if(this.positionMarkerOl){this.positionLayer.getSource().removeFeature(this.positionMarkerOl)}this.locationControlOl=null;this.locationControlElement=null;this.geolocation=null;this.positionMarkerOl=null}}layerWatcher(t){if(!this.map){return}Object.entries(this.rasterLayers).forEach((([i,s])=>{if(i===t){s.setVisible(true);this.map.getView().set("projection",this.projections[t]);const e=this.layersArray.find((([t])=>t!==this.layer));if(e){if(this.layerControlImageElement){this.layerControlImageElement.src=e[1].thumbnailUrl}if(this.layerControlTextElement){let t="";if(i==="streets"){t=this.localization.streetsLayerTitle}else if(i==="satellite"){t=this.localization.satelliteLayerTitle}this.layerControlTextElement.textContent=e[1].title||t}}}else{s.setVisible(false)}}))}centerWatcher(t){if(typeof t==="string"){this._center=JSON.parse(t)}else{this._center=t}if(this.map&&!this._initialExtent){this.map.getView().setCenter(this._center);if(this.centerMarkerOl){this.centerMarkerOl.setGeometry(new va(this._center))}}}async centerMarkerWatcher(t){if(t){this.centerMarkerOl=await this.addIconMarker(this._center)}else if(this.centerMarkerOl){this.removeIconMarker(this.centerMarkerOl)}}async getMap(){return this.map}async writeExtentToUrl(){if(this.writeExtentToUrlEnabled){const t=this.map.getView();const i=t.calculateExtent(this.map.getSize());const[s,e,r,n]=i;const h=new URLSearchParams(window.location.search);h.set("extent[0]",s.toFixed(10));h.set("extent[1]",e.toFixed(10));h.set("extent[2]",r.toFixed(10));h.set("extent[3]",n.toFixed(10));const a=`${window.location.pathname}?${h.toString()}`;history.replaceState(null,"",a)}}async getVisibleMarkers(){const t=this.iconLayer.getSource();const i=t.getFeatures();if(i.length===0){return[]}const s=this.map.getView().calculateExtent(this.map.getSize());return i.filter((t=>{const i=t.getGeometry().getExtent();return qh.intersects(s,i)}))}async findMarkerById(t){const i=this.iconLayer.getSource().getFeatures();return i.find((i=>i.get("id")===t))}async addIconMarker(t,i){const s=new Ru({geometry:new va(t)});const e=new Au({image:new Mv(wv)});if(i&&i.id){s.setProperties({id:i.id});s.setId(i.id)}s.setProperties({stzh:i});s.setStyle(e);this.iconLayer.getSource().addFeature(s);return s}async addIconMarkers(t){for(const i of t){await this.addIconMarker(i.coordinates,i.props)}return true}async updateViewToFitMarkers(t=1e3){const i=this.iconLayer.getSource();const s=i.getFeatures();if(s.length===0){return}let e=qh.createEmpty();s.forEach((t=>{qh.extend(e,t.getGeometry().getExtent())}));this.map.getView().fit(e,{size:this.map.getSize(),duration:t})}async removeAllIconMarkers(){return this.iconLayer.getSource().clear()}async removeIconMarker(t){return this.iconLayer.getSource().removeFeature(t)}async setIconMarkerActive(t){t.setStyle(new Au({image:new Mv(yv)}))}async setIconMarkerInactive(t){t.setStyle(new Au({image:new Mv(wv)}))}async setAllIconMarkersInactive(){const t=this.iconLayer.getSource();const i=t.getFeatures();i.forEach((t=>{this.setIconMarkerInactive(t).catch((t=>console.error(t)))}))}async enableLocationTracking(t=true){this.setLocationControlState(true);this.geoPositionChanged=!t;if(this.geolocation){this.geolocation.setTracking(true)}}async disableLocationTracking(){this.setLocationControlState(false);if(this.geolocation){this.geolocation.setTracking(false)}}async getDistance(t,i){const s=new ov([t,i]);const e=Wh.getLength(s,{projection:this.map.getView().getProjection()});return e}handleLoad(){if(this.map){requestAnimationFrame((()=>{this.map.updateSize()}))}}showPopover(t,i){if(i.imageUri){this.popoverElement.innerHTML=`<div class="stzh-olmap__popover-image"><img src="${i.imageUri}" alt="${i.title}"></div>`}let s='<div class="stzh-olmap__popover-content">';if(i.title){s+=`<stzh-heading curve="p2">${i.title}</stzh-heading>`}if(i.text){s+=`<stzh-text size="milli" color="info">${i.text}</stzh-text>`}if(i.data&&i.data.length){i.data.map((t=>{s+=`<div class="stzh-poi-teaser-list-item">\n <stzh-icon name="${t.icon}"></stzh-icon>\n <stzh-text size="micro">\n ${t.text}\n </stzh-text>\n </div>`}))}s+="</div>";this.popoverElement.innerHTML+=s;if(i.href){this.popoverElement.innerHTML+=`<a href="${i.href}" class="stzh-olmap__popover-link"></a>`}const e=new Cu({element:this.popoverElement,position:t,positioning:"bottom-center",offset:[0,-50],autoPan:false,autoPanAnimation:{duration:300}});this.map.addOverlay(e);this.map.renderSync()}initializeMarkerHover(){this.map.on("pointermove",(t=>{const i=this.map.getEventPixel(t.originalEvent);const s=this.map.hasFeatureAtPixel(i,{layerFilter:t=>t===this.iconLayer});const e=this.map.getTargetElement();if(s){e.style.cursor="pointer"}else{e.style.cursor=""}}))}setLocationControlState(t){if(this.positionLayer){this.positionLayer.setVisible(t)}if(this.locationControlElement){this.locationControlElement.classList.toggle("active",t)}}createMap(){const t=document.createElement("stzh-icon");t.ariaLabel=this.localization.zoomInLabel;t.name="plus";t.addEventListener("click",(()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})}));const i=document.createElement("stzh-icon");i.ariaLabel=this.localization.zoomOutLabel;i.name="minus";i.addEventListener("click",(()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})}));const s=document.createElement("div");s.innerHTML=zv;const e=document.createElement("span");e.innerText=this.localization.rotateLabel;s.appendChild(e);const r=new Eu({controls:po.defaults({zoomOptions:{zoomInLabel:t,zoomOutLabel:i,zoomInTipLabel:"",zoomOutTipLabel:""},rotateOptions:{label:s,tipLabel:""}}),interactions:new xa([new xo,new go,new bo,new To({threshold:this.pinchRotateThreshold}),new Ao,new Io,new So,new No]),loadTilesWhileAnimating:true,loadTilesWhileInteracting:true,target:this.mapElement,logo:false});return r}createRasterLayer(t,i){return new uv({title:"wmts",type:"base",extent:i.extent,source:this.createLayerSource(t,i)})}createLayerSource(t,i){if(!this.projections){this.projections={}}this.projections[t]=new Zh({code:"EPSG:2056",extent:i.extent});return this.creatRasterSource(t,i)}creatRasterSource(t,i){const{url:s,layer:e,matrixSet:r,origin:n}=i;const h=[];for(let t=0;t<this._resolutions.length;t++){h.push(t)}const a=new $u({origin:n,resolutions:this._resolutions,matrixIds:h,tileSize:[512,512]});return new tv({url:s,tileGrid:a,style:"default",projection:this.projections[t],crossOrigin:"anonymous",layer:e,matrixSet:r,requestEncoding:"REST"})}createIconLayer(){return new vv({source:new hv({})})}initMap(){this.map=this.createMap();this.map.on("postrender",this.handlePostRender);this.map.on("movestart",this.handleMoveStart);this.map.on("dblclick",this.handleDoubleClick);this.map.on("moveend",this.handleMoveEnd);this.map.on("pointerdrag",this.handlePointerdrag);this.map.on("change:resolution",this.handleChangeResolution);this.layersArray=Object.entries(this._layers);if(this.layersArray.length>2){throw new Error("There are only two different layers allowed.")}this.rasterLayers={};this.layersArray.forEach((([t,i])=>{i.options.url=i.options.url.replace(/\{hostname\}/gi,this.hostname);this.rasterLayers[t]=this.createRasterLayer(t,i.options);this.map.addLayer(this.rasterLayers[t])}));this.positionLayer=this.createIconLayer();this.positionLayer.setVisible(false);this.map.addLayer(this.positionLayer);this.iconLayer=this.createIconLayer();this.map.addLayer(this.iconLayer);const t=new Ka({center:this._center,projection:this.projections[this.layer],zoom:this.zoom,resolutions:this._resolutions});if(this._initialExtent){t.fit(this._initialExtent,{size:this.map.getSize()})}this.map.setView(t);this.centerWatcher(this.center);this.scaleControlWatcher(this.scaleControl);this.printControlWatcher(this.printControl);this.locationControlWatcher(this.locationControl);this.layerControlWatcher(this.layerControl);this.layerWatcher(this.layer);this.centerMarkerWatcher(this.centerMarker);this.initializeMarkerHover();this.map.on("singleclick",(t=>{this.setAllIconMarkersInactive().catch();this.popoverElement.innerHTML="";this.map.forEachFeatureAtPixel(t.pixel,(t=>{if(t.getGeometry()instanceof va){this.setIconMarkerActive(t).catch();const i=t.getProperties();if(i.stzh){this.showPopover(i.geometry.flatCoordinates,i.stzh)}return true}}))}));requestAnimationFrame((()=>{this.stzhInitialized.emit({component:"stzh-olmap"})}));this.handleMoveEnd()}componentShouldUpdate(t,i,s){return["hostname","localization","layers","resolutions","pinchRotateThreshold"].includes(s)}async componentWillLoad(){this.layersWatcher(this.layers);this.resolutionsWatcher(this.resolutions);if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"olmap")}const t=new URLSearchParams(window.location.search);const i=[parseFloat(t.get("extent[0]")),parseFloat(t.get("extent[1]")),parseFloat(t.get("extent[2]")),parseFloat(t.get("extent[3]"))];if(!isNaN(i[0])&&!isNaN(i[1])&&!isNaN(i[2])&&!isNaN(i[3])){this._initialExtent=i}}componentWillUpdate(){if(this.map){this.map.setTarget(null);this.map=null}}componentDidRender(){if(this.map){return}this.initMap()}connectedCallback(){const t=this.element.closest("stzh-dialog");if(t){t.addEventListener("stzhOpen",this.handleInsideModalOpen)}}disconnectedCallback(){if(this.map){this.map.setTarget(null);this.map=null}const t=this.element.closest("stzh-dialog");if(t){t.removeEventListener("stzhOpen",this.handleInsideModalOpen)}}render(){const t={"stzh-olmap":true,"stzh-olmap--has-no-layer-control":!this.layerControl,"stzh-olmap--has-no-print-control":!this.printControl,"stzh-olmap--has-location-control":this.locationControl};return r(h,{key:"9517c971b6ec79d7de68bd6016a5fc1c6160d77e"},r("div",{key:"d43fa25c26069487f74cb7c44f714a1da4438d92",class:t},r("div",{key:"f3d124346d2fabb508b92192071fd72047f7d36c",ref:t=>this.mapElement=t,class:"stzh-olmap__map"}),r("div",{key:"921b59e2f68ca6dd25973f7db7fea94d9b86c4c6",ref:t=>this.popoverElement=t,class:"stzh-olmap__popover"})))}get element(){return a(this)}static get watchers(){return{layers:["layersWatcher"],resolutions:["resolutionsWatcher"],zoom:["zoomWatcher"],scaleControl:["scaleControlWatcher"],printControl:["printControlWatcher"],layerControl:["layerControlWatcher"],locationControl:["locationControlWatcher"],layer:["layerWatcher"],center:["centerWatcher"],centerMarker:["centerMarkerWatcher"]}}};xv.style=gv;export{M as stzh_header,xv as stzh_olmap};
|
|
8
|
+
//# sourceMappingURL=p-8f90ba95.entry.js.map
|