Second Life Map Api
|
|
Dyne Talamasca
Noneuclidean Love Polygon
Join date: 9 Oct 2005
Posts: 436
|
12-15-2005 00:30
From: Bo Linden Dyne, if you want to link to a second life coordinate currently, you'll need find out the region name and the local coordinates (0-256) Sorry, I was needlessly vague. I know how to form the URL and the appropriate HTML. (I nearly forgot you needed the region name, but it doesn't matter; I can hardcode that, since I only care about the sim where my stuff is for the tinkering I'm doing right now.) My question is more "assuming I have a secondlife URL, how do I make javascript open that URL, instead of popping up an alert". I'm checking other sites' source for examples, but haven't found it yet. BTW, Point to Point teleporting is already released.  Edit: As far as I can tell, it would be something like this: // creates a function that we will bind to the double click action var doubleClickHandlerFunction = function(x,y) { // Pretend I calculate the local X and Y here document.location.href = "secondlife://my_sim/" + local_x + "/" + local_y; };
|
|
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
|
12-15-2005 00:46
Thank you! This is great
Question: Is this optimized for zooming to the sim level? As in - it only loads the sim displayed?
_____________________
Hiro Pendragon ------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio
Visit my SL blog: http://secondtense.blogspot.com
|
|
Frans Charming
You only need one Frans
Join date: 28 Jan 2005
Posts: 1,847
|
12-15-2005 01:38
Very Cool Bo! And i'm looking forward to the other api's you mentioned. =)
|
|
Dyne Talamasca
Noneuclidean Love Polygon
Join date: 9 Oct 2005
Posts: 436
|
12-15-2005 06:03
This is what I was attempting to do. The blue rectangle represents the southwest corner, the roundish pale grey blob is the northeast. Be careful along the edges. If you miss, it'll still work, but you'll end up in that relative position in Acontia ... that is, clicking in the east border of Emmelia (the sim to the west) puts you on the East border of Acontia instead. Zooming is left on mostly for context.
|
|
Bo Linden
Administrator
Join date: 29 Jun 2005
Posts: 17
|
12-15-2005 13:52
Hello Everyone, I've created a much easier way to link to inworld now. Simple use the function: gotoSLURL(Float x, Float y) You can see an example and read the documenation here: http://secondlife.com/apps/services/mapapi/index.html#adv_goto
|
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
12-15-2005 14:11
Very cool! Any thoughts on doing the opposite?  getXYPoints(slurl) eg getXYPoints("secondlife://boardman/100/100" 
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
|
Bo Linden
Administrator
Join date: 29 Jun 2005
Posts: 17
|
12-15-2005 14:34
Just a notice, the gotoSLURL feature seemed not to play well with IE, so we are temporarily disabling it. It'll make a post when its reenabled.
|
|
Cristiano Midnight
Evil Snapshot Baron
Join date: 17 May 2003
Posts: 8,616
|
12-15-2005 14:43
From: blaze Spinnaker Very cool! Any thoughts on doing the opposite?  getXYPoints(slurl) eg getXYPoints("secondlife://boardman/100/100"  Without the ability to get the necessary map coordinates based upon entering a sim name and x,y coordinates, it makes it very difficult to do any dynamic map generation. A lookup function that could be given a sim name and the 0-255 x/y coordinates would be very useful.
_____________________
Cristiano ANOmations - huge selection of high quality, low priced animations all $100L or less. ~SLUniverse.com~ SL's oldest and largest community site, featuring Snapzilla image sharing, forums, and much more. 
|
|
Bo Linden
Administrator
Join date: 29 Jun 2005
Posts: 17
|
12-15-2005 16:36
Cristiano. I'll take in consideration your request for a lookup function to go from region name > sl coordinate
As for the gotoSLURL function, it is now working in all supported browsers. Look to my previous post on how to use it.
|
|
Adam Zaius
Deus
Join date: 9 Jan 2004
Posts: 1,483
|
12-15-2005 21:43
Can we get a mouse-over callback for markers?  (Hehe.)
|
|
Bo Linden
Administrator
Join date: 29 Jun 2005
Posts: 17
|
12-15-2005 21:53
Hi Adam, its possible to do this callback. I'm guessing you want to show some preview of the marker before its clicked?
|
|
Adam Zaius
Deus
Join date: 9 Jan 2004
Posts: 1,483
|
12-15-2005 23:50
From: Bo Linden Hi Adam, its possible to do this callback. I'm guessing you want to show some preview of the marker before its clicked? Bingo. 
|
|
Dyne Talamasca
Noneuclidean Love Polygon
Join date: 9 Oct 2005
Posts: 436
|
12-15-2005 23:59
From: Bo Linden I've created a much easier way to link to inworld now. *Clicks stopwatch* OK, I make it ... eight hours. Is that a record for shortest time until a resident creation was rendered obsolete? I demand compensation! 
|
|
Bo Linden
Administrator
Join date: 29 Jun 2005
Posts: 17
|
12-16-2005 20:08
Hey Adam, I've added the hooks you've requested. Read about it here: http://secondlife.com/apps/services/mapapi/index.html#adv_marker_bindTo accommodate the new features, the Marker constructor has changed slightly. Good luck making your apps, note I will be away for the next week but I'll keep my ears open for more improvements to the api.
|
|
Dyne Talamasca
Noneuclidean Love Polygon
Join date: 9 Oct 2005
Posts: 436
|
12-17-2005 00:59
More fun with mappingSome notes: * In order to overlay something across the entire map (a fancy frame, for example), simply make an image of the appropriate size (whatever size you set in the style section), and set a marker at the center of the viewport using that image. That's pretty easy when the map center never changes. I'm guessing you would need to update this marker when the user pans, clicks, or drags the map. You could probably do the first two in the custom pan control functions or the click handler respectively. I'm not sure if you could do it with dragging the map at all. * In order to overlay something on a sim like the parcel owner map I have here, you need an overlay image for each zoom level you are concerned with (sims are 256 x 256 at the closest zoom). I didn't bother making more than one, since I turned off zoom. * The order of the addMarker calls determines their layering. So for a parcel overlay like mine, you want to add the overlay before the actual markers. * Since I now use gotoSLURL, you can click outside the borders of Acontia and it will wind up working properly. I still calculate the local coordinates myself so I can display them in the alert. Try loading this page in two different browsers (Firefox and IE in my case). If you then open SL using one browser, refreshing that same browser will open the in-client map. Refreshing the other browser will not open the in-client map (at least not always). Since the in-client map tends to kill my internet, I'd prefer if this were not the case (I suspect it's how SL handles the secondlife URL when it's already open, but I'm not sure why that URL is being loaded when the page refreshes, yet only on the browser you loaded SL from.)
|
|
Bo Linden
Administrator
Join date: 29 Jun 2005
Posts: 17
|
12-17-2005 01:05
Hey Dyne, your overlay looks very cool. I look forward to seeing what you come up with in the future. About the refreshing quirks, I'll definitely look into this when I have the chance.
|
|
Dyne Talamasca
Noneuclidean Love Polygon
Join date: 9 Oct 2005
Posts: 436
|
12-17-2005 01:42
Thanks.  I've no idea what I'll cook up; I've used other languages but I'm figuring out Javascript as I go, obviously, and I don't really know what it can do aside from stuff I've seen on other pages over the years. This API is the first thing I've seen that has made me want to learn it. Oh, I should point out that the sim name is not part of the parcel overlay. Here are the images if you don't feel like looking in the source for their filenames. Sim nameOverlayThat overlay is not even a little bit dynamically generated. I just flew around the sim seeing who owned what. (I actually planned to use it as part an in-world landmark map of the sim.) 
|
|
Frans Charming
You only need one Frans
Join date: 28 Jan 2005
Posts: 1,847
|
12-18-2005 06:43
Bo, i was wondering, is a more advanced Transaction History in the pipeline for the foreseeable future?
|
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
12-18-2005 06:52
heheheh you've raised the bar, Bo.
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
|
Lawrence Linden
Linden Lab Developer
Join date: 25 Jun 2005
Posts: 235
|
12-18-2005 11:15
From: Frans Charming Bo, i was wondering, is a more advanced Transaction History in the pipeline for the foreseeable future? Yes, but let's not redirect this thread. Cheers, Lawrence
|