Mindaugas Posted September 13, 2019 Share Posted September 13, 2019 Hello, I am creating a UniMap at runtime and trying to add a marker to it, but UniForm is not loading. procedure CreateMap(upanel: TUniPanel; lat, longt: Double); var umap: TUniMap; begin umap := TUniMap.Create(upanel); umap.Parent := upanel; umap.Align := alTop; umap.Height := 250; umap.LayoutConfig.Margin := '10 10 10 10'; with umap.MapLayers.Add do begin LayerType := mlGoogle; MapType := mtRoadMap; end; umap.DefaultLat := lat; umap.DefaultLong := longt; umap.DefaultZoom := 15; with umap.Markers.Add do begin id:= 1; Latitude:= lat; Longitude:= longt; Icon.iconUrl := 'images/icons/marker-icon.png'; Draggable:= True; AddToMap; PanToMarker(15); end; end; If I am not adding marker, uniform, and unimap load properly. I want that marker is shown on the unimap straight after creation (not after some event, like onclick, etc.). Is this possible? How to achieve this? Thank You. Link to comment Share on other sites More sharing options...
Sherzod Posted September 13, 2019 Share Posted September 13, 2019 2 hours ago, Mindaugas said: I am creating a UniMap at runtime and trying to add a marker to it, but UniForm is not loading. Hello, Can you please specify, which editon and build of UniGUI are you using? Link to comment Share on other sites More sharing options...
Mindaugas Posted September 13, 2019 Author Share Posted September 13, 2019 3 hours ago, Sherzod said: Hello, Can you please specify, which editon and build of UniGUI are you using? Latest available trial edition "uniGUI Complete Trial Edition 1.90.0.1509 (uniGUI Equinox)". Regards Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted September 13, 2019 Share Posted September 13, 2019 I will analyze. Link to comment Share on other sites More sharing options...
VolkovVitalD Posted August 19, 2021 Share Posted August 19, 2021 On 9/14/2019 at 4:11 AM, Hayri ASLAN said: I will analyze. Hello. Is there any result on this problem? Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted August 19, 2021 Share Posted August 19, 2021 17 minutes ago, VolkovVitalD said: Hello. Is there any result on this problem? Hello Please use below solution for now. I'll add OnMapReady Event procedure TMainForm.UniMap1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName='afterupdatehtml' then AddMarker end; Link to comment Share on other sites More sharing options...
VolkovVitalD Posted August 19, 2021 Share Posted August 19, 2021 7 minutes ago, Hayri ASLAN said: Hello You should add your marker when map is ready. So please use OnUpdateHTML event to add your marker I can't find the OnUpdateHTML event in TUniMap. My version uni-1.90.0.1545. Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted August 19, 2021 Share Posted August 19, 2021 Just now, VolkovVitalD said: I can't find the OnUpdateHTML event in TUniMap. My version uni-1.90.0.1545. I changed the solution. Please check above. Link to comment Share on other sites More sharing options...
VolkovVitalD Posted August 19, 2021 Share Posted August 19, 2021 It's working! Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now