Linden Lab Official:Map API SLurl Technical Details

From Second Life Wiki
Jump to: navigation, search
Ll color vert 100.gif
Official Linden Lab® Information: You may access and link to this page, but you may not copy, distribute, modify, adapt, or translate any content on this page. This content is subject to the Terms of Service and is not available under the Creative Commons or any other license.

Have a suggestion to improve this page? Contact us.
NOTE: This is an official Second Life API provided and documented by Linden Lab. Its use is subject to the API Terms of Use.

The maps.secondlife.com and slurl.com websites are implemented using the Second Life Map API. If you have a website, you can use it as well to embed Second Life maps on your pages, in the same way you can embed Google Maps.

How it works

Use a SLurl to direct people to inworld locations like this:

  1. Create a SLurl, either within the Viewer or using SLurlBuilder.
  2. Share the SLurl with a person who you want to tell about something in Second Life.
  3. They click the SLurl. It's a web link like any other.
  4. They'll see a http://SLurl.com page and more info, if you provided it.
    SLURL-Here-example.png

If the person doesn't have Second Life

The SLurl page (either http://maps.secondlife.com or http://slurl.com) displays a link to join Second Life.

From the signup up page, they can quickly register, download the Second Life Viewer, and log in. When they first log in, they will initially arrive at the destination specified by the SLurl, not the default start location on Welcome Island. A quick tutorial opens upon their initial arrival to help them get started.

If the person has Second Life

If the Second Life Viewer is not already running, it will start.

  1. When they log in, they'll be at the location specified by the SLurl.
  2. If they're already logged in, the Place Profile opens in the Second Life Viewer's sidebar.
  3. When they click the Teleport button in this window, they'll be instantly teleported to the location specified by the SLurl. Alternatively, they can click Map to display the target location on the World Map, or close the sidebar if they don't want to be teleported.

What happens when a person clicks on the Teleport Now button

When someone clicks on the Teleport Now button in the SLurl.com page, the most recently installed Viewer starts and immediately telports them to the specified location in Second Life.

There isn't an immediate way to change which Viewer launches SLurls, so if you have the current released Viewer and a Release Candidate, whichever was installed most recently will start. You can change this by reinstalling the Viewer.

Every SLurl page's SLurl title and Teleport Now button link to a "secondlife://" address, which is an URI scheme which opens Second Life. This is different from the familiar "http://" used for webpages.

KBtip2.png Tip: The reason why it's advantageous to post "http://" SLurls instead of direct "secondlife://" addresses in webpages is for the benefit of people who don't have Second Life yet. Giving them the latter doesn't work, since it depends on SL being installed. A SLurl serves as a friendly intro to tell them about Second Life as-needed and where they'll be going.

Constructing SLurls

The basic format for a SLurl is:

http://SLurl.com/secondlife/<region>/<x>/<y>/<z>?param=value&param=value...

Where:

  • <region> is the name of the destination Region
  • <x> and <y> are the east/west and north/south coordinates of the destination; <z> is the vertical (height) coordinate.
  • The ? and the parameters that follow it are optional and provide additional information to be displayed in the SLurl.com page; see Query string parameters for more information.

Query string parameters

KBnote.png Note: In Linden Lab's official showcasing of SLurls, this has somewhat been deprecated by the Destination Guide.

You can use the SLurlBuilder to make the following easier.

Supply SLurl query string parameters to set the window title, image, and text. Parameters are just name=value pairs. Just like a standard URL, precede the first parameter pair with a question mark (?), and all subsequent parameter pairs with an ampersand (&).

Parameter Description Example
title Title text to display in the teleport window. To specify the window title "Come to My Island!" use

title=Come%20To%20My%20Island
For example: http://slurl.com/secondlife/Ahern/50/50/50/?title=Come%20To%20My%20Island

img URL of image to display in teleport window. Must be a complete (absolute) URL, and preferably a small image of 256x256 pixels or less. To display this example image, use

img=http://slurl.com/examples/forsale.png
For example: http://slurl.com/secondlife/Ahern/50/50/50/?img=http://SLurl.com/examples/forsale.png

msg Message text to display in the teleport window To specify the message text "Your text here", use

msg=Your%20text%20here
For example: http://slurl.com/secondlife/Ahern/50/50/50/?msg=Your%20text%20here.

Shortening SLurls

SLurls with string parameters can get quite long and ugly. This makes them difficult to paste into places like emails, which may have line breaks that mangle the SLurl.

You can use a 3rd-party URL-shortening service to condense a SLurl and make it easier to share. There are dozens of these out there, including:

  • bit.ly - Twitter's default, one of the most popular. Has stats-tracking.
  • Snurl - No relation to SLurl.
  • TinyURL - One of the first.

If you have a webserver with a customizable redirect, you can do something similar.

See also

Some of the below is outdated and kept for historical purposes.