Select to view content in your preferred language

side-accordion: bookmark function

2262
5
05-14-2014 02:31 PM
FlorianHruby2
Deactivated User
Dear all,

I would like to integrate a �??bookmark�?� or �??zoom-to-object�?� function into the side-accordion app (like the short-list app has).

Any hints where to start?

Thank you & best regards,

Flo
0 Kudos
5 Replies
StephenSylvia
Esri Regular Contributor
The JavaScript API includes a bookmark widget that will allow you to jump to any of the bookmarks that you save in ArcGIS Online. It takes only a couple lines of code to implement and can be styled as needed. You can find the documentation for it here: https://developers.arcgis.com/javascript/jsapi/bookmarks-amd.html.
0 Kudos
SiennaSvob
Deactivated User

Hey Stephen,

Could you provide more details of how to incorporate this into the code that comes with the app?

BEst,

Sienna

0 Kudos
FlorianHruby2
Deactivated User
Thank you for the link, Stephan!

That's the function I was looking for.

best regards,

F
0 Kudos
FlorianHruby2
Deactivated User
Hi again,

I added the following code of the example mentioned to the function init of the Core.js. However, I can see the regiones defined ("Northern California" & "Central Pennsylvania") in the dropdown menu but cannot click them.

Any ideas?

thank you & best regards,

Flo


   var bookmarks_list = [{
   "extent": {
    "spatialReference": {
     "wkid": 102100
    },
    "xmin":-14201669,
    "ymin":4642975,
    "xmax":-13021482,
    "ymax":5278931
   },
   "name": "Northern California" 
   }, {
   "extent": {
    "spatialReference": {
     "wkid":102100
    },
    "xmin":-8669334,
    "ymin":4982379,
    "xmax":-8664724,
    "ymax":4984864
   },
   "name": "Central Pennsylvania"
   }];
   
     
   // Create the bookmark widget
   var bookmarks = new esri.dijit.Bookmarks({
    bookmarks: bookmarks_list
   }, dojo.byId('bookmarks')); 
0 Kudos
SiennaSvob
Deactivated User

Hi thanks for posting this question as I would like to achieve the same outcome. Was it successful? In what template files did you place the bookmark widget? where in the code? It would be amazing if you could paste the code of how you got it to work!

thank you,

Sienna

0 Kudos