Community
All Communities
Products
ArcGIS Pro
ArcGIS Survey123
ArcGIS Online
ArcGIS Enterprise
Data Management
ArcGIS Experience Builder
Geoprocessing
ArcGIS Web AppBuilder
ArcGIS Dashboards
ArcGIS Field Maps
ArcGIS StoryMaps
All Products Communities
Industries
Education
Water Resources
State & Local Government
Transportation
Gas and Pipeline
Water Utilities
Roads and Highways
Telecommunications
Natural Resources
Electric
Imagery and Remote Sensing Insights (IRIS) COP
All Industries Communities
Developers
Python
JavaScript Maps SDK
Native Maps SDKs
ArcGIS API for Python
ArcGIS Pro SDK
ArcObjects SDK
Developers - General
ArcGIS REST APIs and Services
ArcGIS Online Developers
Game Engine Maps SDKs
File Geodatabase API
All Developers Communities
Global
Comunidad Esri Colombia - Ecuador - Panamá
ArcGIS 開発者コミュニティ
Czech GIS
ArcNesia
Europe
Esri India
Americas
Asia Pacific
Comunidad GEOTEC
GeoDev Germany
ArcGIS Content - Esri Nederland
All Global Communities
All Communities
Developers
User Groups
Industries
Services
Community Resources
Global
Events
Learning
Networks
ArcGIS Topics
Products
View All Communities
ArcGIS Ideas
GIS Life
Community Resources
Community Help Documents
Community Blog
Community Feedback
Member Introductions
All Community Resources
Sign In
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show
only
|
Search instead for
Did you mean:
Cancel
Home
:
All Communities
:
Developers
:
JavaScript Maps SDK
:
JavaScript Maps SDK Questions
:
Re: Can we pass the map service (REST) URL as a UR...
Options
Subscribe to RSS Feed
Mark Topic as New
Mark Topic as Read
Float this Topic for Current User
Bookmark
Subscribe
Mute
Printer Friendly Page
Select to view content in your preferred language
Translate Now
Can we pass the map service (REST) URL as a URL parameter to the JS API map template?
Subscribe
1910
8
07-26-2011 11:02 AM
by
DonBarker
Regular Contributor
07-26-2011
11:02 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
The ArcGIS.com (Javascript) viewer accepts a map service (REST) URL as a URL parameter, like this:
http://www.arcgis.com/home/webmap/viewer.html?url=http%3a%2f%2f129.2.24.163%2fArcGIS%2frest%2fservic...
When I try this with my locally-hosted JS API map template, nothing appears.
Can we pass the map service (REST) URL as a URL parameter to the JS API map template?
Thanks,
Don
Tags
(2)
Tags:
javascript
web_developers
Reply
0
Kudos
All Posts
Previous Topic
Next Topic
8 Replies
by
derekswingley1
Deactivated User
07-26-2011
11:10 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Yes, the
"Border and Margin" ArcGIS.com sample
show this.
Here's the URL for the sample:
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ags/ags_fullmaplayoutwithborderandmargin.ht...
And here it is with a URL parameter for a webmap:
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ags/ags_fullmaplayoutwithborderandmargin.ht...
Reply
0
Kudos
by
DonBarker
Regular Contributor
07-26-2011
11:24 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Derek,
Thanks for taking time to reply.
But my question is about passing in the REST URL as a parameter, rather than the unique id of an AGO web map.
Thanks,
Don
Reply
0
Kudos
by
DonBarker
Regular Contributor
07-26-2011
11:28 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Derek,
Thanks for taking time to reply.
But I don't see where the REST URL for a map service is passed as a URL parameter in either of the examples.
Reply
0
Kudos
by
derekswingley1
Deactivated User
07-26-2011
11:39 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
The same strategy applies. After you grab the URL using esri.urlToObject(), create a dynamic map service layer and add it to the map.
Reply
0
Kudos
by
DonBarker
Regular Contributor
07-26-2011
11:46 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Thanks for this explanation.
So, it requires some Javascript coding. Whereas, the example I provided for the ArcGIS.com viewer (above),
and this example of the AGXO (Silverlight) viewer
http://explorer.arcgis.com/?url=http://129.2.24.163/ArcGIS/rest/services/00_SMC_Environmental_Health...
require no scripting. Or, please let me know if I'm missing something.
Thanks,
Don
Reply
0
Kudos
by
derekswingley1
Deactivated User
07-26-2011
12:01 PM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
If you want to host it locally and/or do something not explicitly demonstrated in a sample, then yes, it requires a little code.
You're free to use the ArcGIS.com viewer or Explorer Online, though.
Reply
0
Kudos
by
DonBarker
Regular Contributor
07-26-2011
12:04 PM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Yes, these are very cool.
And a core part of our San Mateo County strategy to publish our county geodatabase map layers using AGO resources; i.e. at little or no cost besides our existing investment in ArcGIS Server and geodatabase.
Reply
0
Kudos
by
derekswingley1
Deactivated User
07-26-2011
12:09 PM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Nice. If you're interested in hosting your data on ArcGIS.com you should talk to your account rep.
Reply
0
Kudos
Post Reply