Announcement

Collapse
No announcement yet.

Placemarker Label Size

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Placemarker Label Size

    hello, i'm building an web app with world wind to use inside webview as an app in android.
    but the label of placemarker is too small, how can i change size?

  • #2
    You can control a WorldWind.Placemark's label font size by adjusting the various "labelAttributes" properties of the WorldWind.PlaceMarkAttributes that are applied to that Placemark.
    For Instance:

    var normalAttributes = new WorldWind.PlacemarkAttributes(null);
    normalAttributes.labelAttributes.offset = new WorldWind.Offset(WorldWind.OFFSET_FRACTI ON, 0.5, WorldWind.OFFSET_FRACTION, 0.5);
    normalAttributes.labelAttributes.color = WorldWind.Color.WHITE;
    normalAttributes.labelAttributes.depthTe st = true;
    normalAttributes.labelAttributes.font.si ze = 14;
    normalAttributes.labelAttributes.scale = 1; //2 doubles, .5 is half scale, 0 hides the label.

    var placemark = new WorldWind.Placemark(new WorldWind.Position(latitude, longitude, altitude), eyeDistanceScaling, normalAttributes); //Where eyeDistanceScaling is true or false.
    placemark.label = "Hello";

    placemark.eyeDistanceScaling = true; //Indicates whether this placemark's size is reduced at higher than the threshold eye distances.
    placemark.eyeDistanceScalingThreshold = 10000; //The eye distance (in meters) above which to begin to scale the entire placemark by the scale factor.
    placemark.eyeDistanceScalingLabelThresho ld = 10000; //The eye altitude in meters above which this placemark's label is scaled based on eye alt

    //Attributes can be directly modified after the creation of the placemark also, like this. (to hide the labels set the scale to 0.)
    placemark.attributes.labelAttributes.sca le = 2; //Notice we use ".attributes" not ".normalAttributes" here

    Hope that helps.

    Comment

    Working...
    X