Leafletjs Mapping

Does anyone have any good step by step examples on how to integrate leafletjs in to scriptcase?

Take point or show the points?
I took the points and I am doing the sample now, I want to do it through a cluster, I’ll see what comes out …
You must make the library and then load the map in the onload. That’s all, the documentation is in leaftlet.

Hi @ddiaz , I have not dug back into this. But do you happen to have a sample of the code from your end of scriptcase in the onload? For some reason i just get stumped with maps.

thank you

Hi @ddiaz , I have jumped back on this. I am using a blank application at the moment. I am able to get all my markers but not the tiles for the maps. I have gone back to basics to verify that it works. Using a regular old php file outside of scritpcase i can get the tiles to appear and a marker no problem. once i go back into script case i loose the tiles. If I past the same code that i use in my php file with in the blank app i can not get the map to generate. Any thoughts?

?> OpenStreetMap Example <?php // Set the latitude and longitude of the location you want to display $lat = 51.5074; $lon = -0.1278; // Set the zoom level $zoom = 13; ?>
<script src="https://cdn.jsdelivr.net/npm/leaflet@1.7.1/dist/leaflet.js"></script>
<script>
  var map = L.map('map').setView([<?php echo $lat; ?>, <?php echo $lon; ?>], <?php echo $zoom; ?>);
	 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',
    maxZoom: 18,
  }).addTo(map);
  L.marker([<?php echo $lat; ?>, <?php echo $lon; ?>]).addTo(map);
</script>
<?php
all my points [details="Summary"] [[url=https://postimg.cc/s1YXcp2c][img]https://i.postimg.cc/s1YXcp2c/Screenshot-2023-04-14-151157.png[/img][/url]](https://forum.scriptcase.net/t/deploy-problem-on-shared-hosting-without-domain-pointed-while-under-development/23613) [/details]

Hi, @jbmcclain, I’m at the exact same situation: when trying to get the tiles from a blank app in scriptcase, there’s a 400 error. Did you succeded getting the tiles?

Hi @tfertil ,
In short yes. I will do a write up. It’s a little different than the examples . The variables used contine to break even when replacing them. I am not in front of the computer. But will be submitting a write up on it soon.

Good morning all, If you are looking for a replacement for google maps. Then here you go. the below link has the libraires you need to get started as well as code example to make it work with a blank application.
In the Zip file you will have a a txt file. Use that file for the php code in a blank app. Upload the leafet directory into the external libraires. Change your $sql query to meet your needs.

3 Likes