<ion-view class="module-places places places-map l1"
          sb-page-background>
    <ion-nav-title>{{ page_title }}</ion-nav-title>

    <ion-nav-buttons side="secondary">
        <location-button icon-class="'places-location-action'"></location-button>

        <button ng-click="goToList()"
                class="button button-clear header-item places-secondary-button">
            <i class="icon ion-sb-list1"></i>
        </button>
    </ion-nav-buttons>

    <ion-content scroll="false"
                 class="maps">

        <div class="loader"
             ng-show="is_loading">
            <ion-spinner class="spinner-custom"></ion-spinner>
        </div>

        <div id="google-maps"
             class="map-canvas"
             sb-maps
             map="map"
             config="map_config"
             ng-if="map_config"
             data-tap-disabled="true"></div>

        <div id="mapInfoWindow"
             ng-class="{'hide': !showInfoWindow}"
             class="info-window slide-top">
            <div class="item item-custom item-text-wrap info-window-icon">
                <span class="info-window-title">{{ currentPlace.title }}</span>
                <br />
                <span class="info-window-distance"
                      ng-if="currentPlace.distance != 0">{{ ::'Distance' | translate:'places' }}: {{ currentPlace.distance }} {{ currentPlace.distanceUnit }}</span>
                -
                <span ng-click="goToPlace(currentPlace.id)"
                      class="info-window-more">
                    {{ ::'See details' | translate:'places' }} <i class="icon ion-android-open"></i>
                </span>
                <i ng-click="hideInfoWindow()"
                   class="icon ion-close info-close"></i>
            </div>
            <div ng-if="currentPlace"
                 sb-cms-address
                 block="currentPlace.address"
                 on-show-map="onShowMap(currentPlace.address)"></div>
            <div class="item item-custom item-text-wrap"></div>
        </div>

    </ion-content>
</ion-view>
