Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Getting a parcel map?

Buckaroo Mu
Alpha Geek
Join date: 17 Oct 2006
Posts: 106
09-13-2008 14:13
I've seen scripted objects in-world that can fetch and display a map of a parcel - the same map image shown on the in-world map, not the seriously outdated one from the MapAPI - and I was wondering if anyone could share how to do this? I'm sure it's just a matter of finding the correct UUID, I just haven't figured out where that info can be found yet.
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
Like this.
09-14-2008 00:40
This is how to do it.
With thanks to the people at 'subnova.com'.

From: someone


key http_request_id;
string URL = "http://www.subnova.com/secondlife/api/map.php";
string SIM_NAME;
integer iLine;

map(string name)
{
vector temp;
list temp_name;
integer i=0;
temp = llGetScale();
http_request_id = llHTTPRequest(URL + "?" + "sim" + "=", [], "";);
iLine = 0;
temp_name = llParseString2List(name,[],[" "]);
for(i=0;i<llGetListLength(temp_name);i++){
if(llList2String(temp_name,i) == " ";){
temp_name = llListReplaceList(temp_name,["_"],i,i);
}
}
SIM_NAME = llDumpList2String(temp_name,"";);
http_request_id = llHTTPRequest(URL + "?" + "sim" + "=" + SIM_NAME, [], "";);
}

default
{
state_entry()
{
map(llGetRegionName());
}

http_response(key request_id, integer status, list metadata, string body)
{
if (request_id == http_request_id){
if (body != "";) {
llSetTexture(body, ALL_SIDES);
llSetText(SIM_NAME + "\n \n \n ",<.984, .686, .365>,.8);
}
}
}

on_rez(integer n)
{
llResetScript();
}
}