• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: WEB-474
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Low Low
Assignee: Yoz Linden
Reporter: koz farina
Votes: 4
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
3. Second Life Website - WEB

Postcards need to send Global Coordinates since removal of SLPoint() from the SL Map API

Created: 08/Oct/07 09:54 AM   Updated: 05/Mar/08 04:16 PM
Component/s: Interactive map
Affects Version/s: None
Fix Version/s: Not Versioned

Environment: All platforms

Linden Lab Issue ID: DEV-711
Linden Lab Internal Branch: distributed-postcards


 Description  « Hide
Since the changes made to the SL Mapping API to using the Google Map API, it is impossible to pinpoint where a postcard was taken on the interactive maps.

Previously, we were able to call the JavaScript function SLPoint(simName, regionX, regionY) to pinpoint the location on the map, as the postcards provide this information.

We now only have XYPoint(globalX, globalY) in the JavaScript Mapping API to locate positions.

If the postcards also provided the Global Coordinates of the location as well as the Sim Name and Region XY coordinates, as it currently does in the body of the message, and also in a hidden HTML tag in the source of the email, the sites which use the maps would become fully functional again.

eg: http://bloghud.com which takes text only posts (which do provide global and region coordinates via LSL) and postcards, which now are unable to pinpoint the location on the map.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Yoz Linden added a comment - 02/Nov/07 06:46 PM
Firstly, my apologies for taking so long to get onto this one.

Despite how it appeared, the disabling of the old web map API wasn't directly related to the release of the new one. Both are meant to be running in parallel for a while, especially since there are many devs (such as yourself) using the old one. The problem was that generating the huge list of map data that was in the old Javascript code was causing such a database hit that we disabled it in order to find a better solution. Within the next couple of days, the old map API will be working again with much better caching, and so your existing code should be fine.

If putting coordinate data in the postcards themselves would still be a much better solution, let me know and I'll keep chasing that up. In the meantime, I want to get more developer input about the new map API and what we can do to improve it, especially with an view to phasing out the old one without leaving anyone high and dry. SLPoint() is an obvious next step.


Torley Linden added a comment - 05/Nov/07 07:58 AM
Changed priority to match internal issue's after triage.

koz farina added a comment - 25/Nov/07 07:34 AM
Hi.

Just trying to re-address this issue again - ie: being able to place a map next to a postcard sent via the client.

I think that having additional Global Coordinates being sent along with the existing Region Name and RegionXY coordinates would be great.

Currently, we still have no way of extrapolating global coordinates from a postcard email in order to pinpoint a map location, as XYPoint is used now since SLPoint no longer works.

Love to get this fixed asap, as this is now really holding up some important and cool iteration I've been intending to do over on bloghud.com for a while now.

tbanks.
Koz Farina


Thraxis Epsilon added a comment - 26/Nov/07 12:12 AM
Personally I use a PHP function much like the following:

function SLPoint_to_XYPoint($region,$x,$y)
{
$url = "https://cap.secondlife.com/cap/0/d661249b-2b5a-4436-966a-3d3b8d7a574f?var=a&sim_name=".urlencode($region);
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "spider", // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_TIMEOUT => 120, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
);

$ch = curl_init( $url );
curl_setopt_array( $ch, $options );
$content = curl_exec( $ch );
$err = curl_errno( $ch );
$errmsg = curl_error( $ch );
$header = curl_getinfo( $ch );
curl_close( $ch );

$content = substr($content,8,strlen($content)-9);
$content = str_replace("'", '"', $content);
$coord = json_decode($page,TRUE);

$coord['x'] = $coord['x'] + floatval($x) / 256.0;
$coord['y'] = $coord['y'] + floatval($y) / 256.0;
return $coord;
}


koz farina added a comment - 26/Nov/07 12:29 PM
crikey! that's a bit useful!
thanks for that!

is this an official function, that's not likely to disappear any time soon?

cheers,
Koz Farina


Yoz Linden added a comment - 23/Jan/08 10:09 AM
A late response, but yes, this is an official function which our Javascript webmap implementation uses. It's not currently documented, and we'll be fixing that soon.

Yoz Linden added a comment - 23/Jan/08 12:12 PM
I was ready to close this "Won't Finish" (due to the alternative solution above) but it looks like the postcard code is about to get some attention for a different reason so I'm trying to slip this in at the same time by making it really trivial to do.
Current proposal: a comment in the HTML that contains the grid x+y of the region. Koz, how does that sound?

koz farina added a comment - 23/Jan/08 05:34 PM
Having the HTML comment sounds good too. it will make other people's lives easier too.

So, this ability to use the SLPoint_to_XYPoint function isn't going away then?

Thanks Yoz,
Koz


Yoz Linden added a comment - 23/Jan/08 06:48 PM
Postcard template now fixed internally. The HTML now includes global_x, global_y and agent_id of the sender.
(Also fixed: A problem where region names in Slurl URLs weren't being escaped properly)

Yep, Koz - while it's possible that the URL for the coordinate lookup service might change, this is going to be a permanent service to both support our own webmap and others'.


Yoz Linden added a comment - 04/Mar/08 11:39 AM - edited
As of the 1.19.1 server release, you can stick a fork in this fix, because it's DONE.

Sent postcards are now using this format:

<!-- BEGIN POSTCARD DETAILS

agent_id=[UUID]

username="Firstname Lastname"

region_id=[UUID]

sim_name="[name]"

global_x=[int]

global_y=[int]

local_x=[int]

local_y=[int]

local_z=[int]

END POSTCARD DETAILS -->


Yoz Linden added a comment - 04/Mar/08 11:48 AM
Finally, an important note for all those to whom the above format info is useful:

At present, the postcard format continues to be NOT OFFICIALLY SUPPORTED. In other words, we make no guarantees about all postcards being in this format, nor about the format never changing. If you write code that parses SL postcards, please bear this in mind with regard to the assumptions your code makes, and the way it handles parsing failures.


Cristiano Midnight added a comment - 05/Mar/08 12:15 PM
I can't even begin to express how frustrating and annoying it is for you to change a format that has been constant for 3 years, with no regards for how it would affect any of the sites relying on postcard processing. You could have easily added a second set of comments instead of changing the format of the existing comments, but instead, you chose to break existing functionality with no warning at the whim of one person requesting it.

Ordinal Malaprop added a comment - 05/Mar/08 02:11 PM
Yoz, I really do hate to say this, but that is a very poor answer in my opinion. I do not use the postcard format myself but really - it has been consistent all this time, it is very well known that it is used by many third party sites, offering enormous amounts of free benefit to Linden Lab, and "oh well it isn't official you take your chances" is just not good enough.

All that anybody wants is just that, if there is a change to be made, it is announced before it happens, and what the change is is documented. That isn't too much to ask, is it? "We are going to change function X on date Y so that it does Z now"?

This sort of thing has improved dramatically over the past year, but this is a move back to bad old days.


Yoz Linden added a comment - 05/Mar/08 04:16 PM
Okay, time for a mea culpa, because - as you say - this should have been handled much better.

Cristiano: You're right, there should have been advance public notice of the change. The ecosystem of resident-run services is vital to SL, and this lack of planning around that failed all of us. In the future, I'll try to ensure that I notify residents accordingly when a change that I'm involved with may cause breakage.

Please accept my apologies for the problems that this caused your service.