<div dir="ltr"><div>thank you Vitaly for your example but i was not able to make the map work.<br></div>the zoom is inverted so i have added the "zoomReverse: true" property to the tileLayer and now the zoom is working fine but depending on the zoom level some tiles are inverted and coordinates are getting crazy (reverted zoom or not).<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 14, 2015 at 5:31 PM, Виталий Фицнер <span dir="ltr"><<a href="mailto:wchf@yandex.ru" target="_blank">wchf@yandex.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Leaflet could use OpenSim tiles, but you need to set up custom projection, like this:</div><div> </div><div><p><script></p><p>var mapMinZoom = 1;<br> var mapMaxZoom = 6;<br> <br>L.Projection.Direct = {<br> project: function (latlng) {<br> return new L.Point(latlng.lat*256, latlng.lng*256);<br> },<br> <br> unproject: function (point) {<br> return new L.LatLng(point.x/256, point.y/256);<br> }<br>};</p><p>L.CRS.OpenSim=L.extend({},L.CRS,{<br> projection: L.Projection.Direct,<br> transformation:new L.Transformation(1,0,1,0),<br> <br> scale: function (zoom) {<br> return 1;// OpenSim zoom<br> }<br> });</p><p><br> var map = L.map('map',{<br> minZoom: mapMinZoom,<br> maxZoom:mapMaxZoom,<br> crs: L.CRS.OpenSim<br> });</p><p><br> <br> <br> <br> map.setView([1000, 1000], 1);</p><p>L.tileLayer('<a href="http://localhost:8002/map-%7Bz%7D-%7Bx%7D-%7By%7D-objects.jpg" target="_blank">http://localhost:8002/map-{z}-{x}-{y}-objects.jpg</a>', {<br> maxZoom: mapMaxZoom,<br> continuousWorld: true,<br> noWrap:true,<br> tileSize:256,<br> crs: L.CRS.OpenSim,<br> attribution: 'opensim',<br> id: 'opensim',<br> }).addTo(map);<br> <br> map.panTo([1000,1000]);</p><p><br></script></p></div><div> </div><div>14.12.2015, 17:04, "ssm2017" <<a href="mailto:ssm2017@gmail.com" target="_blank">ssm2017@gmail.com</a>>:</div><blockquote type="cite"><div><div class="h5"><div><div><div><div><div><div><div><div>hello</div>i would like to create a web map using leaflet and the crs projection.</div>i am not able to make something valuable.</div>i have asked in the #leaflet channel and someone told me that OpenSimulator tiles (located in the Robust folder bin/maptiles) are weird.</div>here is what the person told me :<br>"if you have a tile, e.g. <span>1-1000-1000</span>, make sure that the tiles <span>2-2000-2000</span>, <span>2-2001-2000</span>, <span>2-2000-2001</span> and <span>2-2001-2001</span> are the same thing, but 2x"<br><br></div>my questions are :</div>is this person right ?</div>did someone was able to create a web map using leaflet and v2 tiles ? (and if yes, how :) )</div></div></div>,<p>_______________________________________________<br>Opensim-dev mailing list<br><a href="mailto:Opensim-dev@opensimulator.org" target="_blank">Opensim-dev@opensimulator.org</a><br><a href="http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev" target="_blank">http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev</a></p></blockquote><span class="HOEnZb"><font color="#888888"><div> </div><div> </div><div>-- <br>Отправлено из быстрой почты</div><div><a href="http://mail.yandex.ru/neo2/collect/?exp=1&t=5" target="_blank">http://mail.yandex.ru/neo2/collect/?exp=1&t=5</a></div><div> </div></font></span><br>_______________________________________________<br>
Opensim-dev mailing list<br>
<a href="mailto:Opensim-dev@opensimulator.org">Opensim-dev@opensimulator.org</a><br>
<a href="http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev" rel="noreferrer" target="_blank">http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev</a><br>
<br></blockquote></div><br></div>