ElCherchu Posted November 27, 2021 Share Posted November 27, 2021 Hi, in my application I'm starting using UniMap, the case is that I don't want to show the MapLayers in map, instead of that I want to do it by code, but I don't Know how to do it, Anyone can help me?, in other case how can I show the compass in map and change the direction? Thanks.. I'm using: Delphi 10.2 Unigui: FMSoft_uniGUI_Complete_Professional_1.90.0.1555 TUniMap Quote Link to comment Share on other sites More sharing options...
zhyhero Posted November 28, 2021 Share Posted November 28, 2021 I think you can setup a custom MapLayer , and use custom img as base background map; procedure TMainForm.UniMapMapLayers0CustomLayerUrl(Sender: TObject; var TileLayerUrl: string); begin TileLayerUrl := '/files/clear.png'; //custom image end; Then darw you vectors and markers by code. About compass and direction ? I dont know now. Quote Link to comment Share on other sites More sharing options...
ElCherchu Posted November 28, 2021 Author Share Posted November 28, 2021 Hi zhyro, thank for response. I really want it is to set the maptype by code. Thanks. Quote Link to comment Share on other sites More sharing options...
zhyhero Posted November 28, 2021 Share Posted November 28, 2021 Sorry for misunderstand. It looks no direct control code, but map.addlayer(), map.removelayer(). Or use leaflet extension or plugin GitHub - gisarmory/Leaflet.ShowHideLayerGroup: Leaflet.ShowHideLayerGroup Quote Link to comment Share on other sites More sharing options...
ElCherchu Posted November 28, 2021 Author Share Posted November 28, 2021 Hello Changing the property collapsed to true o false we got For me is ok, but I'dont know how to add compass Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted November 29, 2021 Share Posted November 29, 2021 Hello Please explain clearly what are you trying to achieve. Quote Link to comment Share on other sites More sharing options...
zhyhero Posted November 29, 2021 Share Posted November 29, 2021 he want hide the "layers control" Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted November 29, 2021 Share Posted November 29, 2021 To remove UniMap control with UniMap1, JSInterface do begin JSCallGlobal(JSName+'_uniControl.remove', []); end; To add UniMap control with UniMap1, JSInterface do begin JSCall('uniMap.addControl', [JSStatement(JSName+'_uniControl')]); end; To change position, with UniMap1, JSInterface do begin JSCallGlobal(JSName+'_uniControl.remove', []); JSCode(JSName+'_uniControl.options.position="'+UniMapControlPositionStr[mpTopLeft]+'";'); JSCall('uniMap.addControl', [JSStatement(JSName+'_uniControl')]); end; Quote Link to comment Share on other sites More sharing options...
ElCherchu Posted November 29, 2021 Author Share Posted November 29, 2021 Thank Hayri, I'll tryit as soom as I can. Trank again.. Quote Link to comment Share on other sites More sharing options...
ElCherchu Posted December 1, 2021 Author Share Posted December 1, 2021 On 11/29/2021 at 9:41 AM, Hayri ASLAN said: To remove UniMap control with UniMap1, JSInterface do begin JSCallGlobal(JSName+'_uniControl.remove', []); end; To add UniMap control with UniMap1, JSInterface do begin JSCall('uniMap.addControl', [JSStatement(JSName+'_uniControl')]); end; To change position, with UniMap1, JSInterface do begin JSCallGlobal(JSName+'_uniControl.remove', []); JSCode(JSName+'_uniControl.options.position="'+UniMapControlPositionStr[mpTopLeft]+'";'); JSCall('uniMap.addControl', [JSStatement(JSName+'_uniControl')]); end; Thank Hayri This realy work. Quote Link to comment Share on other sites More sharing options...
FXSystems Posted July 29, 2022 Share Posted July 29, 2022 The above works great for the layer control. But how to remove and add drawing buttons from code? Can someone help me? I mean, for example, to remove the "Rectangle" button from "MapDrawOptions" 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.