Leaflet could use OpenSim tiles, but you need to set up custom projection, like this:
 

<script>

var mapMinZoom = 1;
var mapMaxZoom = 6;

L.Projection.Direct = {
project: function (latlng) {
return new L.Point(latlng.lat*256, latlng.lng*256);
},

unproject: function (point) {
return new L.LatLng(point.x/256, point.y/256);
}
};

L.CRS.OpenSim=L.extend({},L.CRS,{
projection: L.Projection.Direct,
transformation:new L.Transformation(1,0,1,0),

scale: function (zoom) {
return 1;// OpenSim zoom
}
});


var map = L.map('map',{
minZoom: mapMinZoom,
maxZoom:mapMaxZoom,
crs: L.CRS.OpenSim
});





map.setView([1000, 1000], 1);

L.tileLayer('http://localhost:8002/map-{z}-{x}-{y}-objects.jpg', {
maxZoom: mapMaxZoom,
continuousWorld: true,
noWrap:true,
tileSize:256,
crs: L.CRS.OpenSim,
attribution: 'opensim',
id: 'opensim',
}).addTo(map);

map.panTo([1000,1000]);


</script>

 
14.12.2015, 17:04, "ssm2017" <[email protected]>:
hello
i would like to create a web map using leaflet and the crs projection.
i am not able to make something valuable.
i have asked in the #leaflet channel and someone told me that OpenSimulator tiles (located in the Robust folder bin/maptiles) are weird.
here is what the person told me :
"if you have a tile, e.g. 1-1000-1000, make sure that the tiles 2-2000-2000, 2-2001-2000, 2-2000-2001 and 2-2001-2001 are the same thing, but 2x"

my questions are :
is this person right ?
did someone was able to create a web map using leaflet and v2 tiles ? (and if yes, how :) )
,

_______________________________________________
Opensim-dev mailing list
[email protected]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev

 
 
--
Отправлено из быстрой почты
http://mail.yandex.ru/neo2/collect/?exp=1&t=5
 
_______________________________________________
Opensim-dev mailing list
[email protected]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev

Reply via email to