[sldev] [SVC] Webmap API changed?
Harold Brown
labrat.hb at gmail.com
Wed Oct 3 09:00:45 PDT 2007
The below code (modified from that in the blog post) should be what you
want.
I did the something simliar when I was testing the new API, but I was doing
it in PHP.
function addRegionMarker (regionName, rx,ry, storeImage, popupCode)
{
var SLMap = this;
// Add a dynamic script to get this region position, and then add a market
and popup there
var varName = "slRegionPos_result";
var scriptURL =
"https://cap.secondlife.com/cap/0/d661249b-2b5a-4436-966a-3d3b8d7a574f?var="
+ varName + "&sim_name=" + encodeURIComponent(regionName);
// Once the script has loaded, we use the result to center the map on the
position
var onLoadHandler = function ()
{
if (slRegionPos_result.error)
{
//alert("The region name '" + regionName + "' was not recognised.");
}
else
{
var x = slRegionPos_result.x + (rx/256.0);
var y = slRegionPos_result.y + (ry/256.0);
var pos = new XYPoint(x, y);
yellow_dot_image = new Img(storeImage,60,45);
yellow_icon = new Icon(yellow_dot_image);
all_images = [yellow_icon, yellow_icon, yellow_icon, yellow_icon,
yellow_icon, yellow_icon, yellow_icon, yellow_icon, yellow_icon];
marker = new Marker(all_images, pos);
mapWindow = new MapWindow(popupCode);
mapInstance.addMarker(marker,mapWindow);
}
};
slAddDynamicScript(scriptURL, onLoadHandler);
}
On 10/3/07, Erik Anderson <odysseus654 at gmail.com> wrote:
>
> Well, I know that you aren't the only one that has been having these
> problems. Here's someone that appears to have found a workaround for the
> information they needed at least (in the comments):
>
> http://blog.katharineberry.co.uk/2007/09/27/ll-killed-ajaxlife/
>
>
> On 10/3/07, Mike Welch <mike at flat222.org > wrote:
>
> >
> > Hi,
> >
> > Does anyone know if there's been a change to the Webmap API?
> >
> > Suddenly all my maps have stopped working. I think it's related to the
> > SLPoint method which now seems to be non-functional.
> >
> > Looking at SLUrl.com and the auctions it looks like LL have moved to the
> > Google Maps API, but I've not seen an announcement about it and the rest of
> > the existing API seems to still work, just not SLPoint().
> >
> > Looking at those maps, they don't appear to use SLPoint, is there an
> > alternative method for going from (region,localx,localy) to (globalx,
> > globaly)?
> >
> > Anyone got any clues?
> >
> > Thanks
> >
> > Mike (Hinkley Baldwin)
> >
> > _______________________________________________
> > Click here to unsubscribe or manage your list subscription:
> > /index.html
> >
> >
>
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/sldev/attachments/20071003/294fc555/attachment-0001.htm
More information about the SLDev
mailing list