Custom Marker Icon Resetting when MapPanTo

Hi,


I'm setting custom icon to marker with WebGMaps1.Markers[0].Icon:='abc.png';, when marker on the move i'm using MapPanTo function to follow marker, but when i use MapPanTo my custom icon resetting to default map icon.


Hi,


I haven't been able to reproduce this issue by using the MapPanTo function.
- When assigning a custom icon to an existing marker, please make sure this happens before calling WebGMaps1.Launch.
- If you are adding Markers after WebGMaps1.Launch has been called, please use the following code sample:   

WebGMaps1.Markers.Add(Latitude, Longitude, '', 'abc.png', false, true, true, true, false, 0);



Hi Bart,

I'm getting marker positions from database and creating markers icons according to speed limit, my code as below;


  spdlmt:=sorgu.Fields[7].AsInteger;
  lat:=StrToFloat(StringReplace(trim(sorgub.Fields[5].AsString), '.', ',', [rfReplaceAll]));
  lon:=StrToFloat(StringReplace(trim(sorgub.Fields[6].AsString), '.', ',', [rfReplaceAll]));
  spd:=Round(Strtofloat(StringReplace(copy(sorgub.Fields[7].asstring,0,12), '.', ',', [rfReplaceAll])));
  WebGMaps1.Markers.Add(lat,lon,Trim(sorgu.Fields[1].asstring));
  if (spd>=spdlmt) then
    begin
      WebGMaps1.Markers[mi].Icon:=ikon+'ikaz_48.png';
      WebGMaps1.Markers[mi].MapLabel.Text:=Trim(sorgu.Fields[1].asstring)+' - '+sorgub.Fields[9].AsString+' - '+sorgub.Fields[10].AsString+' Hız : '+inttostr(spd)+' KM - <b><font color=red>Hız Aşımı Uyarısı</b></font>';
    end//hız limiti aşımı
  else
    begin
    WebGMaps1.Markers[mi].Icon:=ikon+Trim(sorgu.Fields[6].asstring);
    WebGMaps1.Markers[mi].MapLabel.Text:=Trim(sorgu.Fields[1].asstring)+' - '+sorgub.Fields[9].AsString+' - '+sorgub.Fields[10].AsString+' Hız : '+inttostr(spd)+' KM';
    end;
  WebGMaps1.Markers[mi].InitialDropAnimation:=True;
  sorgu.Next;
  end;//while
cxComboBox1.ItemIndex:=-1;
cxComboBox1.Enabled:=False;
cxTextEdit1.Enabled:=False;
cxTextEdit2.Enabled:=False;
WebGMaps1.MapOptions.DefaultLatitude:=41.06035;
WebGMaps1.MapOptions.DefaultLongitude:=28.848891;
WebGMaps1.MapOptions.ZoomMap:=12;
WebGMaps1.Launch;



am i missing something ?


Hi,


I haven't noticed any problems in your code.
- Can you please make sure the image url is correct and accessible?
- Have you tried to test this in a simple application that only displays a marker on a fixed location with a fixed custom image?

above codes was belong to test project, with main project i edited my code to as simple as possible and resetting problem has gone, now custom icons works fine.


Thanks for your support.