Improvements to mapping and upgrade to SLurl.com
|
Henri Beauchamp
Registered User
Join date: 8 Oct 2006
Posts: 253
|
01-24-2009 00:57
From: Henri Beauchamp The Wiki does not explain how we can get a the link to a single sim map from a LSL script... It would help as it is a tedious work to reverse engineer the javascript code in order to get the equivalent algorithm implemented in LSL... I did it in the past for the old map API, but it does not seem to be working any more with the new API (did the region coordinates in the SL grid change in the new API ?), and I'm not particularly fond of loosing time redoing the whole shebang when the info is probably available at LL, thus reinventing the wheel...
For info, here was the code I used with the old API:
ShowMap(key id) { string url = "http://secondlife.com/apps/mapapi/grid/map_image/"; vector sim_coord = llGetRegionCorner(); sim_coord.x = sim_coord.x / 256.0; sim_coord.y = 1279 - sim_coord.y / 256.0; url += (string)((integer)sim_coord.x) + "-" + (string)((integer)sim_coord.y); url += "-1-0.html"; llLoadURL(id, "View the sim map", url); }
And here was the code I tried in vain:
ShowMap(key id) { string url = "http://map.secondlife.com.s3.amazonaws.com/1/"; vector sim_coord = llGetRegionCorner(); sim_coord.x = sim_coord.x / 256.0; sim_coord.y = 1279 - sim_coord.y / 256.0; string x = (string)((integer)sim_coord.x); string y = (string)((integer)sim_coord.y); string x0 = llStringTrim(llGetSubString(" 00000", 0, 5 - llStringLength(x)), STRING_TRIM_HEAD) + x; string y0 = llStringTrim(llGetSubString(" 00000", 0, 5 - llStringLength(y)), STRING_TRIM_HEAD) + y; url += x0 + "/" + y0 + "/" + "map-1-" + x + "-" + y + "-objects.jpg"; llLoadURL(id, "View the sim map", url); } Nevermind, scratch that... I found the problem: just getting rid of the "magic" 1279 constant solves the problem. The proper code is: ShowMap(key id) { string url = "http://map.secondlife.com.s3.amazonaws.com/1/"; vector sim_coord = llGetRegionCorner(); sim_coord.x = sim_coord.x / 256.0; sim_coord.y = sim_coord.y / 256.0; string x = (string)((integer)sim_coord.x); string y = (string)((integer)sim_coord.y); string x0 = llStringTrim(llGetSubString(" 00000", 0, 5 - llStringLength(x)), STRING_TRIM_HEAD) + x; string y0 = llStringTrim(llGetSubString(" 00000", 0, 5 - llStringLength(y)), STRING_TRIM_HEAD) + y; url += x0 + "/" + y0 + "/" + "map-1-" + x + "-" + y + "-objects.jpg"; llLoadURL(id, "View the sim map", url); } I also added it to the Wiki 
|
herina Bode
Registered User
Join date: 9 Jan 2007
Posts: 11
|
01-24-2009 01:02
From: Argent Stonecutter Maybe you should use a standards-conforming browser.
The shoe is usually on the other foot.  I agree I should use a standards-conforming browser, and for personal use, I prefer Firefox. But IE (Internet Explorer) is also used by some (when I have a look to statistics in the web site, it is almost 80%), that is why I am testing on this browser too. I don't know if it is coming from google map, from brower, from SLMap API, from my source code or both. Page is builded using Ajax and calls to capability URLs to convert region coordinate into global coordinates. An embeded Google map alone is working fine.
|
herina Bode
Registered User
Join date: 9 Jan 2007
Posts: 11
|
01-24-2009 01:08
Great kob Henri !
|
herina Bode
Registered User
Join date: 9 Jan 2007
Posts: 11
|
01-24-2009 01:09
oups, sorry, Great job is better
|
Fractal Mandala
Registered User
Join date: 15 Dec 2003
Posts: 60
|
01-24-2009 13:10
The last header on the advanced examples page is:
Using Second Life region names (NOT IMPLEMENTED)
Any plans to implement this? About a year I opened a bug report about this feature not working in the original API. Since the SLpoint fucntion is still mentioned on that page and on the API reference page, I hope it will be forthcoming.
|
Elanthius Flagstaff
Registered User
Join date: 30 Apr 2006
Posts: 1,534
|
01-24-2009 13:18
Has anyone in here got markers to work properly so they scale when you zoom in and out?
_____________________
Visit http://ninjaland.net for mainland and covenant rentals or visit our amazing land store at Steamboat (199, 56). Also, we pay L$0.15/sqm/week for tier donated to our group and we rent pure tier to your group for L$0.25/sqm/week. Free L$ for Everyone - http://ninjaland.net/tools/search-scumming/
|
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
|
01-24-2009 13:26
Great work, REALLY looking forward to improvements on the inworld map! Inworld map not only comes up slowly, but brings the PC (including voice!) to its knees while it's rezzing. Feature request: Can the map be changed to have hover tips for continent and archipelago names? Both inworld and web? 
|
Ivanova Shostakovich
Fire Resistant
Join date: 1 Oct 2007
Posts: 98
|
Land info box
01-24-2009 21:26
Maybe the name of the continent can be displayed in the land info box. It can simply say 'Estate' when on a lone island.
|
herina Bode
Registered User
Join date: 9 Jan 2007
Posts: 11
|
01-25-2009 01:09
From: Fractal Mandala The last header on the advanced examples page is:
Using Second Life region names (NOT IMPLEMENTED)
Any plans to implement this? About a year I opened a bug report about this feature not working in the original API. Since the SLpoint fucntion is still mentioned on that page and on the API reference page, I hope it will be forthcoming. A workaround you can find in the Jira : https://jira.secondlife.com/browse/WEB-474You may use the function SLPoint_to_XYPoint($region,$x,$y) in PHP.
|
herina Bode
Registered User
Join date: 9 Jan 2007
Posts: 11
|
01-25-2009 03:12
Me again  it seems that in the slmapapi.js, the teleport button cannot be displayed. it is implemented in slmapapi as <img src="/_img/teleport_btn.gif">. The slmapi script is located in 'http://slurl.com/_scripts/', the img_src is trying to download the file 'http://slurl.com/_scripts/_img/teleport_btn.gif' which doesn't exist, the right URL is 'http://slurl.com/_img/teleport_btn.gif' slmapapi is to be fixed if we are referencing the online version, maybe to use a relative path is not a good idea, as we have to modify the script when using a downloaded version.
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
01-25-2009 03:47
From: herina Bode it is implemented in slmapapi as <img src="/_img/teleport_btn.gif">. The slmapi script is located in 'http://slurl.com/_scripts/', the img_src is trying to download the file 'http://slurl.com/_scripts/_img/teleport_btn.gif' which doesn't exist, the right URL is 'http://slurl.com/_img/teleport_btn.gif' That doesn't make sense. If the relative URL is "/_img/..." then the <img> tag will point to "http://slurl.com/_img/...". If your browser is trying to load something in "http://slurl.com/_scripts" when there's a "/" at the beginning of the relative URL it's broken.
|
herina Bode
Registered User
Join date: 9 Jan 2007
Posts: 11
|
01-25-2009 04:05
@Argent
oups, you are right, it soesn't make sense, I wrote too fast without to see the "/". Anyway, it is a relative path and the slmapapi.js is trying to load a file relative to the root of the web site and not from slurl.com site.
|
Snickers Snook
Odd Princess - Trout 7.3
Join date: 17 Apr 2007
Posts: 746
|
01-26-2009 16:42
From: Argent Stonecutter What OS? Windows XP Professional UPDATE: In Firefox 3, I went to Tools / Options / Applications and repointed secondlife to the viewer. All works now!!  The solution came from a post on the XStreetSL forums.
_____________________
 Buh-bye forums, it's been good ta know ya.
|
Philip Linden
Founder, Linden Lab
Join date: 18 Nov 2002
Posts: 428
|
01-27-2009 15:17
Elanthius: Try again now, we've just done an update on the jscript, might work correctly now relative to the problem with moving markers you mentioned. Your map looks better to me, but I may be missing something.
_____________________
Philip Linden Chairman & Founder, Linden Lab blog: http://secondlife.blogs.com/philip
|
Elanthius Flagstaff
Registered User
Join date: 30 Apr 2006
Posts: 1,534
|
01-27-2009 16:11
From: Philip Linden Elanthius: Try again now, we've just done an update on the jscript, might work correctly now relative to the problem with moving markers you mentioned. Your map looks better to me, but I may be missing something. Well, some things look to be behaving a little differently but the main things I'm complaining about are the same. I made this sample page to demonstrate one of them http://ninjaland.net/scripts/temp.html From: someone <!-- Insert common HTML header --> <script src="http://maps.google.com/maps?file=api&v=2&key=<my key here>" type="text/javascript"></script> <script src="http://ninjaland.net/scripts/slmapapi.js" type="text/javascript"></script> <script> function loadmap() { // creates the map var mapInstance = new SLMap(document.getElementById('map-container'), {disableVoiceInfo: true}); mapInstance.centerAndZoomAtSLCoord(new XYPoint(997,1002),2); // creates the icons var yellow_dot_image = new Img("http://secondlife.com/developers/mapapi/b_map_yellow.gif",9,9); var yellow_icon = new Icon(yellow_dot_image); var forsale_image = new Img("http://wiki.secondlife.com/w/images/1/1c/Forsale.png", 80, 83, true); var forsale_icon = new Icon(forsale_image); var yellow_images = [forsale_icon, yellow_icon, yellow_icon, yellow_icon, yellow_icon, yellow_icon]; var forsale_images = [yellow_icon, forsale_icon, forsale_icon, forsale_icon, forsale_icon, forsale_icon]; // creates the marker var marker1 = new Marker(yellow_images, new XYPoint(997,1002)); mapInstance.addMarker(marker1); var marker2 = new Marker(forsale_images, new XYPoint(998,1002)); mapInstance.addMarker(marker2); } </script> </head> <body onload="loadmap()"> <p>There should be a yellow marker in the center of this map: <div id="map-container"></div> </body>
As you zoom in the marker does not change from yellow_icon to forsale_icon like you might expect. One of the other problems I have is that on this same sample map if you zoom all the way out and scroll westwards the markers vanish from their original positions and appear at new ones in the center of the screen. I'm seeing this on firefox on linux and windows and on IE on windows.
_____________________
Visit http://ninjaland.net for mainland and covenant rentals or visit our amazing land store at Steamboat (199, 56). Also, we pay L$0.15/sqm/week for tier donated to our group and we rent pure tier to your group for L$0.25/sqm/week. Free L$ for Everyone - http://ninjaland.net/tools/search-scumming/
|
Archie Lukas
Transcended
Join date: 5 Jan 2007
Posts: 115
|
Search for SiMS box (please)
01-28-2009 06:10
Brilliant, a map that scrolls and zooms, excellent.
REQUEST: Can I search for an island / sim?
I’d like to find my home sim -but the in-world map is terrible and I can’t ’see’ the regions geographical region, it just goes all blue like.
What we need is the occasional immovable landmark, or fity.
Archie
_____________________
Archie Lukas
"Just the facts ma'am" MI5
|
Lex Mars
Founder: Subnova
Join date: 4 Apr 2004
Posts: 11
|
01-28-2009 15:23
Philip, I sent you the email you requested... but I didn't get a reply and wasn't sure you actually got it. So, I'm posting it here just in case there was a problem with a spam filter or something (and for everyone else's benefit). From: someone I run a free "API" on www.subnova.com that allows someone to query the website for a region's name (http://www.subnova.com/secondlife/api/map.php?sim=Subnova), and they get back the uuid of the current world map texture that the client uses. My system uses a bot that effectively downloads the worldmap data, collecting each region's name, global position, and map uuid.
From what gathered in your announcement, the client's world map would essentially be changed to a webpage window that uses a specialized UI skin to simulate the current map's functionality, but would actually be running off slurl code and using the images directly from Amazon S3. This would essentially make the inworld texture form of the map tiles redundant. So I naturally assumed that the initial plan was to no longer update those textures in the database.
The problem is that there are numerous sim monitoring and radar systems that use my API to be able to display the world map tile image on the face of a prim, without using the parcel's media channel. Without the continued updating and support for the existing map tile textures, all these products would lose a very significant functionality.
I already have a few panicked users asking me if I'm going to start uploading the textures myself, but at L$300,000 every 2 days... there's just no way I can replicate the current functionality... and keep my service free (and even then... I seriously doubt I could get US$1,132.38 every 2 days in fees).
So, I just need to know what to tell people.
Thanks.
_____________________
The net is vast and infinite.
|
herina Bode
Registered User
Join date: 9 Jan 2007
Posts: 11
|
01-28-2009 22:24
I had the same zooming troubles on moving markers when using reference of the online version of slampapi.js. After downloaded it and included it in my site, markers are working fine (I can't explain why and only have this problem with Internet Explorer, Firefox and safari were OK).
Advantage of downloading the slmapapi is you may fix the relative path url of the teleport button when displaying a window, you may implement the click event on map and double click event on map and markers. All are not implemented in the original script (but documented in the API).
a useful tip, the hasOverviewMapControl option is hiding the overview window in the bottom right corner.
mapInstance = new SLMap(document.getElementById('map-container'), {hasZoomControls: false, hasPanningControls: false, hasOverviewMapControl :false});
|
Elanthius Flagstaff
Registered User
Join date: 30 Apr 2006
Posts: 1,534
|
01-29-2009 07:43
Alla y'all suck. I've narrowed down most of my problem to the fact that markers don't increase or decrease in size when you zoom in and out.
I found this line
var markerImg = marker.icons[1];
which was clearly wrong since it meant markers were at size 1 no matter what the starting zoom. I fixed it as follows:
var markerImg = marker.icons[this.getCurrentZoomLevel()-1];
This works OK for the starting point but it's not clear to me how to adjust marker sizes on zoom since most of that work seems to be offloaded onto GMap or something.
_____________________
Visit http://ninjaland.net for mainland and covenant rentals or visit our amazing land store at Steamboat (199, 56). Also, we pay L$0.15/sqm/week for tier donated to our group and we rent pure tier to your group for L$0.25/sqm/week. Free L$ for Everyone - http://ninjaland.net/tools/search-scumming/
|
bigmoe Whitfield
I>3 Foxes
Join date: 29 Jul 2007
Posts: 459
|
01-30-2009 14:18
/me puts 7th resume in
and oh I do agree.
_____________________
GoodBye Forums we will miss you ~moe 2-2-2010~
|
Philip Linden
Founder, Linden Lab
Join date: 18 Nov 2002
Posts: 428
|
02-03-2009 20:26
Lex: Hmm, what an interesting problem. We had never contemplated the idea of someone hacking the viewer to get access to the UUID's for the map tile. So, the problem is that the existing system isn't scalable - essentially LL is covering the bill to inject new UUID's every few days into our asset system. We are expanding our own storage system to hold the map tile data, and of course greatly increasing the update frequency (which is good for all SL users) then would cost us even more if we keep this system going.
So it seems to me that we shouldn't keep pushing map tiles into our system as assets, even to keep your system running. LL (and by extension all SL users) is paying for this cost, and it certainly wasn't an intended use. Wouldn't you tend to agree?
_____________________
Philip Linden Chairman & Founder, Linden Lab blog: http://secondlife.blogs.com/philip
|
James Linden
Linden Lab Developer
Join date: 20 Nov 2002
Posts: 115
|
02-03-2009 20:45
Guys, a new version of slurl.com went out today (10 AM Pacific or so) that changes how that teleport button works in the "Teleport Now" pop-up info window. It's now a text link with a CSS style attached to it. The CSS in http://slurl.com/_styles/MAIN.css now provides a hard-coded URL to a button image, which you are free to use. Otherwise feel free to provide your own style sheets to make the button whatever you like. I've been debugging an internal problem where certain SLURLs generate "region not found" errors occasionally on page load. If you've got a SLURL of the form: http://slurl.com/secondlife/Regionthat fails to load about 10% of the time, please let me know what it is. It'll help me dig into this. (One of our several layers of squid caches is getting bad data in it with a time-to-live of 1 year. Ugh.) [email]james@lindenlab.com[/email] James
|
Gordon Wendt
404 - User not found
Join date: 10 May 2006
Posts: 1,024
|
02-03-2009 21:26
Phillip, so to translate from from Linden to English the below statement translates roughly to "tough shit". I have no direct connection to Lex or to any product that uses the current map system, although I was aware of them before Lex's post, but even I think that's a pretty awful answer. To clarify is there no way for people to get the tile information like that using the new system? If there was then people could upgrade their products to use it. If not then at least come out and say that instead of sidestepping around it by talking about "unintended uses". Edit: I'm sure you haven't had any reason to read any of my previous posts Phil, if you had you'd know that I don't especially like having to call Lindens out however it seems to be the only way to actually get anything resembling a straight answer out of you guys. Well I'd say just ask the Linden's who've I've communicated on but I think Rob, CG, Dan are the only ones still with the company, the rest have left for greener pastures. From: Philip Linden Lex: Hmm, what an interesting problem. We had never contemplated the idea of someone hacking the viewer to get access to the UUID's for the map tile. So, the problem is that the existing system isn't scalable - essentially LL is covering the bill to inject new UUID's every few days into our asset system. We are expanding our own storage system to hold the map tile data, and of course greatly increasing the update frequency (which is good for all SL users) then would cost us even more if we keep this system going.
So it seems to me that we shouldn't keep pushing map tiles into our system as assets, even to keep your system running. LL (and by extension all SL users) is paying for this cost, and it certainly wasn't an intended use. Wouldn't you tend to agree?
_____________________
Twitter: http://www.twitter.com/GWendt Plurk: http://www.plurk.com/GordonWendt GW Designs: XStreetSL
|
Baloo Uriza
Debian Linux Helper
Join date: 19 Apr 2008
Posts: 895
|
02-03-2009 22:33
From: Philip Linden For SL developers, and the more technically interested: We are now serving map tiles directly from <a href="http://aws.amazon.com/s3/">Amazon S3</a>, and have changed the file naming convention to hopefully make it much easier to develop other 3rd party maps based on the tiles we are generating. More documentation on using the webmap API is available <a href="http://wiki.secondlife.com/wiki/Webmap_API">on our wiki</a>. The map generation process is much more scalable than before, and is able to image the entire SL grid of about 30K regions in less than 2 days with just 4 dedicated machines. In general, the architecture approach of generating tiled images on sims into a public repository like S3 seems like the right approach for both performance and openness - it anticipates the ability for individual sim owners/operators in the future to create their own maps (or not make them at all!) and upload them to a common shared filespace on which multiple mapping systems can then depend. What kind of licensing is this data available under? If the licensing is appropriate, it would be interesting to use the data to start a project similar to what http://www.openstreetmap.org/ is doing for the real world, but instead to map SL for things like official highways, minor roads, planned routes, regular transit routes, railroads, general land usage, major landmarks and the sort. Might also help in standardizing street names (which are often ambiguous even when officially named due to lack of any cohesive map of navigation landmarks or reminder markers at regular intervals), and promoting awareness of the best teleportation routes to take (since better travelled routes seem to be more responsive than others), railroads, known operating transit routes, etc. An offshoot is that such a project would make things like navigation computers for vehicles possible. "In 80 meters, bear left onto market square, then bear right onto Heterocera Ring Road (SL-2)."
|
Baloo Uriza
Debian Linux Helper
Join date: 19 Apr 2008
Posts: 895
|
02-03-2009 22:38
From: Elanthius Flagstaff The key point is that all the textures should be available in world via UUIDs so that we can display them on prims. If you move to a totally web based system that won't be possible anymore. I haven't looked too deeply into this as of yet, but I imagine you could probably script your way out of this. Check out http://wiki.secondlife.com/wiki/Category:LSL_HTTP
|