import Foundation
import UIKit

extension MapViewImpl {
    @objc public func consumeLoadFlag() -> Bool {
        if self.isMapLoaded {
            self.isMapLoaded = false
            return true
        }
        return false
    }
    
    @objc public func consumeRenderReadyFlag() -> Bool {
        if self.renderReady {
            self.renderReady = false
            return true
        }
        return false
    }
    
    @objc public func consumeRegionChangedFinishFlag() -> Bool {
        if self.regionChangedFinish {
            self.regionChangedFinish = false
            return true
        }
        return false
    }
    
    @objc public func consumeRegionChangedStartFlag() -> Bool {
        if self.regionChangedStart {
            self.regionChangedStart = false
            return true
        }
        return false
    }
    
    @objc public func consumeRegionChangingFlag() -> Bool {
        if self.regionChanging {
            self.regionChanging = false
            return true
        }
        return false
    }
    
    @objc public func consumeMapTapFlag() -> Bool {
        if self.mapTapped {
            self.mapTapped = false
            return true
        }
        return false
    }
    
    @objc public func consumePoiTapFlag() -> Bool {
        if self.poiTapped {
            self.poiTapped = false
            return true
        }
        return false
    }
    
    @objc public func consumeLongPressFlag() -> Bool {
        if self.longPressed {
            self.longPressed = false
            return true
        }
        return false
    }
    
    @objc public func consumeDoublePressFlag() -> Bool {
        if self.doublePressed {
            self.doublePressed = false
            return true
        }
        return false
    }
    
    @objc public func getChangeReason() -> UInt32 {
        return self.changeReason
    }
    
    @objc public func getCenterLatitudeValue() -> Double {
        return self.centerLatitude
    }
    
    @objc public func getCenterLongitudeValue() -> Double {
        return self.centerLongitude
    }
    
    @objc public func getZoomLevelValue() -> Double {
        return self.zoomLevelValue
    }
    
    @objc public func getTappedLatitudeValue() -> Double {
        return self.tappedLatitude
    }
    
    @objc public func getTappedLongitudeValue() -> Double {
        return self.tappedLongitude
    }
    
    @objc public func getTappedPoiName() -> String {
        return self.tappedPoiName
    }
    
    @objc public func getTappedPoiUid() -> String {
        return self.tappedPoiUid
    }
    
    @objc public func getTappedPoiLatitudeValue() -> Double {
        return self.tappedPoiLatitude
    }
    
    @objc public func getTappedPoiLongitudeValue() -> Double {
        return self.tappedPoiLongitude
    }
    
    @objc public func getLongPressedLatitudeValue() -> Double {
        return self.longPressedLatitude
    }
    
    @objc public func getLongPressedLongitudeValue() -> Double {
        return self.longPressedLongitude
    }
    
    @objc public func getDoublePressedLatitudeValue() -> Double {
        return self.doublePressedLatitude
    }
    
    @objc public func getDoublePressedLongitudeValue() -> Double {
        return self.doublePressedLongitude
    }
    
    @objc public func consumeOverlayTapFlag() -> Bool {
        if self.overlayTapped {
            self.overlayTapped = false
            return true
        }
        return false
    }
    
    @objc public func getTappedOverlayIdValue() -> Int {
        return self.tappedOverlayId
    }
    
    @objc public func getTappedOverlayType() -> String {
        return self.tappedOverlayType
    }
    
    @objc public func getTappedIsRichView() -> Bool {
        return self.tappedIsRichView
    }
    
    @objc public func getTappedRichViewItemIndex() -> Int {
        return self.tappedRichViewItemIndex
    }
    
    @objc public func consumeMultiPointTapFlag() -> Bool {
        if self.multiPointTapped {
            self.multiPointTapped = false
            return true
        }
        return false
    }
    
    @objc public func getTappedMultiPointOverlayId() -> Int {
        return self.tappedMultiPointOverlayId
    }
    
    @objc public func getTappedMultiPointIndex() -> Int {
        return self.tappedMultiPointIndex
    }
    
    @objc public func getTappedMultiPointLat() -> Double {
        return self.tappedMultiPointLat
    }
    
    @objc public func getTappedMultiPointLng() -> Double {
        return self.tappedMultiPointLng
    }
    
    @objc public func getTappedMultiPointTitle() -> String {
        return self.tappedMultiPointTitle
    }
    
    @objc public func destroyMap() {
        self.mapView.delegate = nil
        self.clearMarkers()
        self.clearPolylines()
        self.clearPolygons()
        self.clearCircles()
        self.mapView.removeFromSuperview()
    }
}
