Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapbox Compatibility (MGLMapView) #1

Closed
superandrew opened this issue Jan 19, 2017 · 1 comment
Closed

Mapbox Compatibility (MGLMapView) #1

superandrew opened this issue Jan 19, 2017 · 1 comment

Comments

@superandrew
Copy link

Hi, I am using RealmGeoQueries with Mapbox, so I added this extension to RealmGeoQueries.swift

public extension MGLMapView {
    
   
    var geoBox: GeoBox {
        
        let maxLat = self.visibleCoordinateBounds.ne.latitude
        let minLat = self.visibleCoordinateBounds.sw.latitude
        let maxLng = self.visibleCoordinateBounds.ne.longitude
        let minLng = self.visibleCoordinateBounds.sw.longitude
        
        return GeoBox(
            topLeft: CLLocationCoordinate2D(latitude: maxLat, longitude: minLng),
            bottomRight: CLLocationCoordinate2D(latitude: minLat, longitude: maxLng)
        )
        
    }
    
}

I would have filed a pull request, however I don't know how to make the Import MapBox optional for those who don't want to use it.

@mhergon
Copy link
Owner

mhergon commented Jan 19, 2017

Maybe the best way is creating another library extension and publishing on Cocoapods or similar.
I want make the RealmGeoQueries completely independent from another libraries.

@mhergon mhergon closed this as completed Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants