mousebird / WhirlyGlobe-3

WhirlyGlobe-Maply 3.0 Implementation
Other
11 stars 6 forks source link

(iOS) MaplyScreenLabel color background issue #10

Closed dragonikpl closed 4 years ago

dragonikpl commented 4 years ago

Tested on latest develop using cocoapods.

Code:

    let location = MaplyCoordinate(x: 0.2, y: 0.2)
    let marker = MaplyScreenMarker()
    marker.image = UIImage(named: "blue-oval")
    marker.loc = location
    whirly.addScreenMarkers([marker], desc: nil)

    let label = MaplyScreenLabel()
    label.text = "Hello WORLD"
    label.loc = location
    let labelSettings: [String: Any] = [
        kMaplyFont: UIFont.boldSystemFont(ofSize: 14),
        kMaplyTextColor: UIColor.red,
        kMaplyBackgroundColor: UIColor.green
    ]
    whirly.addScreenLabels([label], desc: labelSettings)

    whirly.setPosition(location, height: 0.5)

Output: image

Issue is that text label is too high and not centered based on it's colored background position (it's too high).

mousebird commented 4 years ago

Fixed in 3.0