leaflet for web map

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

leaflet for web map

ssm2017
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
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: leaflet for web map

Виталий Фицнер
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" <[hidden email]>:
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
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev

 
 
--
Отправлено из быстрой почты
http://mail.yandex.ru/neo2/collect/?exp=1&t=5
 

_______________________________________________
Opensim-dev mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: leaflet for web map

Ai Austin-2
In reply to this post by ssm2017
  ssm2017 at gmail.com
>i would like to create a web map using leaflet and the crs projection.
>i am not able to make something valuable.

I am not sure if this is useful in your requirement ssm2017... but
OpenSim.exe region servers can serve 256x256 pixel map tiles live using

<a href="http://simhost:port/index.php?method=regionImage">http://simhost:port/index.php?method=regionImage<UUID-minus-hyphens>

e.g.
http://virtual3.aiai.ed.ac.uk:9000/index.php?method=regionImagea664c887e87611dc95ff0800200c9a66

Remember to use the Region's OpenSim.exe server DNS (not the Robust
services or main loginURI unless its the same).  Note the
index.php?method=regionImage... is served by the core server, you
don't actually need PHP or a web server for this. SAlso remember to
remove all hyphens from the region's UUIS.  and regionImage s
followed straight by that UUID with no hyphens, there is no separator in there.

See example of the Openvue grid map served live ( including some
related Hypergrid accessible regions on other grids) at
http://virtual.aiai.ed.ac.uk:8002/resources/map.html 

_______________________________________________
Opensim-dev mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: leaflet for web map

ssm2017
In reply to this post by Виталий Фицнер
thank you Vitaly for your example but i was not able to make the map work.
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).

On Mon, Dec 14, 2015 at 5:31 PM, Виталий Фицнер <[hidden email]> wrote:
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" <[hidden email]>:
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
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev

 
 
--
Отправлено из быстрой почты
 

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



_______________________________________________
Opensim-dev mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: leaflet for web map

ssm2017
In reply to this post by Ai Austin-2
thank you Austin for your attention.
we are already using the Melanie's map on our grid that is mid big (FrancoGrid) so we need to use different map tiles depending on the zoom level and i wanted to try if we can use the generated tiles to make a webmap using leaflet and already generated tiles from Robust but it looks like only the zoom level 1 is good and all other zoom levels are not fine (some regions are inverted or moved somewhere else).

On Mon, Dec 14, 2015 at 11:26 PM, Ai Austin <[hidden email]> wrote:
 ssm2017 at gmail.com
i would like to create a web map using leaflet and the crs projection.
i am not able to make something valuable.

I am not sure if this is useful in your requirement ssm2017... but OpenSim.exe region servers can serve 256x256 pixel map tiles live using

http://simhost:port/index.php?method=regionImage<UUID-minus-hyphens>

e.g.
http://virtual3.aiai.ed.ac.uk:9000/index.php?method=regionImagea664c887e87611dc95ff0800200c9a66

Remember to use the Region's OpenSim.exe server DNS (not the Robust services or main loginURI unless its the same).  Note the index.php?method=regionImage... is served by the core server, you don't actually need PHP or a web server for this. SAlso remember to remove all hyphens from the region's UUIS.  and regionImage s followed straight by that UUID with no hyphens, there is no separator in there.

See example of the Openvue grid map served live ( including some related Hypergrid accessible regions on other grids) at
http://virtual.aiai.ed.ac.uk:8002/resources/map.html
_______________________________________________
Opensim-dev mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev


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