GerhardV Posted September 11, 2018 Share Posted September 11, 2018 An example showing how to incorporate Leaflet and OpenStreetMaps into UniGUI. The following lines must be added to the ServerModule | CustomFiles: https://unpkg.com/leaflet@1.3.4/dist/leaflet.css https://unpkg.com/leaflet@1.3.4/dist/leaflet.js See the Mapbox Tab in the application for more details. P.S. I am no expert with Leaflet - please see the following for more details: Getting started with Leaflet OpenStreetMap Mapbox - the accessToken used for this is a public one...you can register to receive your own. Leaflet Maps Example.zip 2 1 Quote Link to comment Share on other sites More sharing options...
picyka Posted September 11, 2018 Share Posted September 11, 2018 very well! Quote Link to comment Share on other sites More sharing options...
AlbertoVesx Posted September 12, 2018 Share Posted September 12, 2018 Thank you. Quote Link to comment Share on other sites More sharing options...
belo Posted September 14, 2018 Share Posted September 14, 2018 Congratulations! Quote Link to comment Share on other sites More sharing options...
jahlxx Posted November 17, 2018 Share Posted November 17, 2018 Hi friend, This is great. Good job!! Can I make 2 questions to you? - Can assign some text to markers, and show a tooltip when click? (I'll have some markers and a different message for every one) - Can have satellite view? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
jahlxx Posted November 18, 2018 Share Posted November 18, 2018 I answer myself: 1) UniSession.AddJS('var marker = L.marker([37.184203, -5.847710]).addTo(leafletMap).bindPopup("text");'); 2) in afteruodatehtml in clientevents of the htmlframe: var googleHybrid = L.tileLayer('http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}',{ maxZoom: 20, subdomains:['mt0','mt1','mt2','mt3'] }); var googleSat = L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',{ maxZoom: 20, subdomains:['mt0','mt1','mt2','mt3'] }); var googleTerrain = L.tileLayer('http://{s}.google.com/vt/lyrs=p&x={x}&y={y}&z={z}',{ maxZoom: 20, subdomains:['mt0','mt1','mt2','mt3'] }); var googleStreets = L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',{ maxZoom: 20, subdomains:['mt0','mt1','mt2','mt3'] }); leafletMap = L.map('uni_map_leaflet', { layers: [googleHybrid] // only add one! }) .setView([37.18161024, -5.84075043], 10); var baseLayers = { "Hybrid": googleHybrid, "Street": googleStreets, "Satellite": googleSat, "Terrain": googleTerrain, "Catastro": catastro }; L.control.layers(baseLayers).addTo(leafletMap); 2 Quote Link to comment Share on other sites More sharing options...
christian2000 Posted March 19, 2023 Share Posted March 19, 2023 Hello everybody! Why I can not download example? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 20, 2023 Share Posted March 20, 2023 7 hours ago, christian2000 said: Why I can not download example? 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.