Closed GoogleCodeExporter closed 9 years ago
Why do u need unique JS variables for the icons.
You just add an icon component to the parent marker easily.
Original comment by Hazem.sa...@gmail.com
on 30 Sep 2008 at 1:22
[deleted comment]
Icon icon1 = new Icon();
icon1.imageURL("xyz.png");
Icon icon2 = new Icon();
icon2.imageURL("xyz2.png");
marker1.add(icon1);
marker2.add(icon2);
Original comment by Hazem.sa...@gmail.com
on 30 Sep 2008 at 1:26
I am adding the icons to the markers in a loop, and for some reason the markers
all
appear the same rather than taking on their own images. I suspect it is because
they
are named the same.:
for (int i=0;i<images.length;i++){
Marker mark = new Marker();
mark.setJsVariable("mark"+Integer.toString(i+1));
mark.setLatitude(images[i].getLat());
mark.setLongitude(images[i].getLon());
Icon icon = new Icon();
icon.setImageURL("/GHS/images/"+images[i].getUrl());
mark.getChildren().add(icon);
map.getChildren().add(mark);
}
Original comment by william....@gmail.com
on 30 Sep 2008 at 1:49
I have modified the code and found that even if the icons have unique variable
names,
they images still appear the same. It seems that the markers may be calling the
same
"createIconFunctionnull()" instead.
By using: icon.setId("icon"+Integer.toString(i+1)); , the problem is resolved by
creating different function names.
Original comment by william....@gmail.com
on 30 Sep 2008 at 6:11
Yes. You have to set ids for Icons.
It is not a defect.
Original comment by Hazem.sa...@gmail.com
on 30 Sep 2008 at 10:36
Original issue reported on code.google.com by
william....@gmail.com
on 30 Sep 2008 at 4:47