<div dir="rtl"><div style="" dir="ltr"><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">Hi, </span></div><div style="" dir="ltr"><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px"><br></span></div><div style="" dir="ltr"><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">Is there a way to write a script that makes requests </span><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">to the MapGuide REST API,</span></div><div style="" dir="ltr"><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">causing the server to generate and store precache tiles ?</span></div><div style="" dir="ltr"><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px"><br></span></div><div style="" dir="ltr"><div dir="ltr"><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">Assuming this will improve performance for the "External General XYZ Layer".</span></div></div><div style="" dir="ltr"><font color="#0d0d0d" face="Söhne, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Helvetica Neue, Arial, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji"><span style="font-size:16px">Something like:</span></font></div><div style="" dir="ltr"><font color="#0d0d0d" face="Söhne, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Helvetica Neue, Arial, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji"><span style="font-size:16px"><br></span></font></div><div style="" dir="ltr">import requests<br><br>server_url = '<a href="http://myserverurl/mapguide/rest/">http://myserverurl/mapguide/rest/</a>'<br>map_name = 'library/projectname/Maps/mymap.MapDefinition'<br>base_map_url = f'{server_url}tile/{map_name}/'<br><br># Define the zoom levels and tile ranges to precache<br>zoom_levels = [0, 1, 2, 3] # Example zoom levels<br>tile_range = range(0, 10) # Example tile range for x and y<br><br># Loop through each zoom level and tile range to request tiles<br>for zoom in zoom_levels<br> for x in tile_range<br> for y in tile_range<br> tile_url = f'{base_map_url}{zoom}{x}{y}.png'<br> response = requests.get(tile_url)<br> print(f'Requesting {tile_url} - Status {response.status_code}')<br><br> # Optional Implement some error handling and retry logic<br> if response.status_code != 200<br> print(f'Error retrieving tile at {zoom}{x}{y}')<font color="#0d0d0d" face="Söhne, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Helvetica Neue, Arial, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji"><span style="font-size:16px"><br></span></font></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="rtl" class="gmail_signature" data-smartmail="gmail_signature"><div dir="rtl"><p align="right"><font face="Times New Roman" size="3">
</font></p><div style="margin:0cm 0cm 0pt" dir="RTL"><span style="font-family:"Arial","sans-serif"" lang="HE">בכבוד רב,</span></div><div style="margin:0cm 0cm 0pt" dir="RTL"><span style="font-family:"Arial","sans-serif"" lang="HE"></span> </div><div style="margin:0cm 0cm 0pt" dir="RTL"><span style="color:rgb(0,0,153)"><b><span style="font-family:"Arial","sans-serif"" lang="HE">נמרוד כנען</span></b></span><b><span style="font-family:"Arial","sans-serif"" lang="HE"><span><span style="color:rgb(0,0,153)"> </span> </span>|<span> </span></span></b><span style="color:rgb(127,127,127);font-family:"Arial","sans-serif"" lang="HE">גיאומינד שירותי </span><font face="Calibri"><span style="color:rgb(127,127,127)" dir="LTR">GIS</span><span dir="RTL"></span><span dir="RTL"></span></font><span style="color:rgb(127,127,127);font-family:"Arial","sans-serif"" lang="HE"><span dir="RTL"></span><span dir="RTL"></span><span> </span>–<span> </span>פיתוח,<span>
</span>ייעוץ<span> </span>ושירותי ענן</span></div><div style="margin:0cm 0cm 0pt" dir="RTL"><font size="3"><span style="color:rgb(127,127,127);font-family:"Arial","sans-serif"" lang="HE"><font size="2">ישיר:
048101268 | נייד: 0525355483</font> |</span><span style="font-family:"Arial","sans-serif"" lang="HE"> <span style="color:rgb(89,89,89)"><a href="mailto:nimrod@geomind.co.il" target="_blank"><span style="color:rgb(89,89,89);font-family:"Calibri","sans-serif"" dir="LTR" lang="EN-US">nimrod@geomind.co.il</span></a></span></span></font></div><div style="margin:0cm 0cm 0pt" dir="RTL"><span dir="LTR" style="color:#1f497d"><img src="http://geomind.co.il/GeomindLogo.png" height="52" width="177"><br></span></div><p style="margin:0cm 0cm 0pt" dir="RTL"><font size="2"><span style="color:black;font-family:"Arial","sans-serif"" lang="HE">נא בקרו באתר החדש שלנו</span><span style="color:red;font-family:"Arial","sans-serif"" lang="HE"> </span><span style="font-family:"Arial","sans-serif"" lang="HE"><a href="http://geomind.co.il/" target="_blank"><span style="font-family:"Calibri","sans-serif"" dir="LTR" lang="EN-US"><font color="#0000ff">http://geomind.co.il</font></span></a></span></font></p><p align="right"><font face="Times New Roman" size="3">
</font></p></div></div></div>