Announcement

Collapse
No announcement yet.

Problem changing Placemark image

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

  • Problem changing Placemark image

    Hi all. I'm a WorldWind Web newbie though I have use the WorldWind DB via OpenLayers in the past. I'm having a problem changing the image of a Placemark. The Placemark shows up fine when I first add it to my layer. However, when I try to change the image nothing happens on the canvas. Here's my code:

    var placemark = myPlacemarks[system_name];
    if (placemark !== undefined) {
    placemarkLayer.removeRenderable(placemar k);
    placemark.latitude = newLatitude;
    placemark.longitude = newLongitude;
    placemark.imageSource = system_name == _active_system_name ?
    ['/static/images/active.png'] :
    ['/static/images/inactive.png'];
    placemark.updateImage = true;
    placemarkLayer.addRenderable(placemark);

    wwd.redraw(); //?

    I hope its not terribly obvious that I don't know what I'm doing, but I don't. The _actve_system_name has changed and the placemark.imageSource gets change appropriately. I tried it without the add and remove renderable part. Am I on the right track? What am I doing wrong?

  • #2
    If the image source is truly getting changed then the redraw should do the trick.

    My guess is you need to use: placemark.attributes.imageSource instead of placemark.imageSource.
    Last edited by price5583; 11-05-2018, 06:10 PM.

    Comment

    Working...
    X