Map Tour new URL Parameter

446
3
05-08-2013 09:16 AM
DavidCaseiro
New Contributor
Hello,

I am trying add a parameter in the URL so that the application starts at a specific point of interest.
Is it possible? I think it as to be the name of the place, for example

???/index.html?name=Lisbon

it gets the parameter and goes direct to the point where the name= Lisbon

Thanks in advanced!
Tags (2)
0 Kudos
3 Replies
MikeMinami
Esri Notable Contributor
Nope, there isn�??t any URL parameter to help with the initial location.
The map tour initial extent is controlled by the webmap extent.

Thanks,

Mike
0 Kudos
DavidCaseiro
New Contributor
Thanks for the quick reply 😉

and there is no way to start the application at a specific point?
I am looking at the code and i am not finding a path to take...

thanks again
0 Kudos
MikeMinami
Esri Notable Contributor
This is the response from the app developer...

Adding an URL parameter to control the initial point can be done in tourPointLayerLoaded function in Core.js:
Replace
app.data.setCurrentPointByIndex(result.graphics.length ? 0 : -1);

with
var urlParams = esri.urlToObject(document.location.search).query || {};
var index = parseInt(urlParams.index);
if( index && ! Number.isNaN(index) && index <= app.data.getTourPoints().length )
    app.data.setCurrentPointByIndex(index - 1);
else
    app.data.setCurrentPointByIndex(result.graphics.length ? 0 : -1);


The map will be centered on the point, the level will be the same than when you don�??t have that URL parameter.
So you can play with the webmap extent to set the level but it will have to be the same for all your points of when you start without any URL parameter.

Thanks,

Mike
0 Kudos