PS1 Posted April 17 Share Posted April 17 How can i update marker postion on unimap in runtime by code? I can remove marker and add new one with new coordinates, but it working very slowly. i tried editing UniMap.pas with my function below but it giving me error : "JS Error: Cannot read properties of null (reading 'lat')" procedure TUniMapMarker.SetLatLng(Lat,Lng:double); begin with FOwner do JSCallGlobal(FMarkerJSName+'.setLatLng', [Lat,Lng]); end; I took it from the documentation : https://leafletjs.com/reference.html#Marker @Hayri ASLAN Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted April 17 Share Posted April 17 1 hour ago, PS1 said: How can i update marker postion on unimap in runtime by code? I can remove marker and add new one with new coordinates, but it working very slowly. i tried editing UniMap.pas with my function below but it giving me error : "JS Error: Cannot read properties of null (reading 'lat')" procedure TUniMapMarker.SetLatLng(Lat,Lng:double); begin with FOwner do JSCallGlobal(FMarkerJSName+'.setLatLng', [Lat,Lng]); end; I took it from the documentation : https://leafletjs.com/reference.html#Marker @Hayri ASLAN Please use JSCallGlobal(FMarkerJSName+'.setLatLng', [JSArray([Latitude,Longitude])]); I added SetLatLong procedure to UniMapMarker. With the new build, you will be able to use it as UniMap1.GetMarkerById(1).SetLatLong(Lat,Long) 1 Quote Link to comment Share on other sites More sharing options...
PS1 Posted April 18 Author Share Posted April 18 Thanks, it works ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.