How to use
See How to use ArcGIS samples for help on running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.
Bookmark
- This sample shows how to integrate bookmarks into your Web ADF Java 10.0 application. The bookmarks represent an area of interest on a map with some label and description. For example, a bookmark with the map zoomed into the Golden Gate bridge in San Francisco, can have a label and description of 'The Golden Gate' and 'GREAT views of the bay' respectively. This sample has been developed and tested with XMLBookmarks using San Francisco dataset.
- Create and start an ArcGIS map server object, SanFrancisco, the map configuration file at %AGSDEVKITJAVA%\java\samples\data\SanFrancisco\SanFrancisco.mxd.
- There are two ways to build the sample. You can either use ArcGIS Ant or Eclipse plugin. To use Ant, at command line, browse to %AGSDEVKITJAVA%\java\samples\bookmark, type arcgisant build, follow the command prompt to finish the build, use the SanFrancisco service created above. There will be a directory called build under the sample root folder, inside there will be a war file. Deploy the war file into Tomcat.
- Another way is to use Eclipse. Open Eclipse, File - New Project - ESRI Templates - Web ADF Samples.
- Choose the Bookmark.
- Go through the wizard to finish building the sample.
- Run the sample web application on server.
- You can either deploy this web application or import the WAR file directly into your IDE.
- After deployment access the sample by typing the URL (e.g. http://[host]:[port]/[samplename]) in a web browser.
- Select and view bookmark from the list of bookmarks in the drop down
- If the bookmark allows editing, 3 buttons, 'Add', 'Remove' and 'Update' will be visible
- The user can add or update bookmark's map extent, label or description, and user can also remove a bookmark
Download the files for Java
bookmarks.jsp | Lays out the tools, map and drop down to select and view bookmarks. Adds buttons to allow users to edit/remove bookmarks. |
bookmarks.js | Javascript file to send requests and process responses from the bookmarks page |
fc-bookmarks.xml | Managed beans and ajax renderers declared in this faces configuration file |
JavaSource\com\esri\arcgis\sample\bookmarks\Bookmark.java | Simple data object defining Bookmark's fields |
JavaSource\com\esri\arcgis\sample\bookmarks\BookmarkDetailsRenderer.java | Class to render bookmark details as xml |
JavaSource\com\esri\arcgis\sample\bookmarks\Bookmarks.java | Interface defining collection of bookmarks |
JavaSource\com\esri\arcgis\sample\bookmarks\BookmarksPhaseListener.java | PhaseListener to process AJAX request and render XML response |
JavaSource\com\esri\arcgis\sample\bookmarks\QueryBookmarks.java | Non-editable Bookmarks implementation using data from layers in service |
JavaSource\com\esri\arcgis\sample\bookmarks\XMLBookmarks.java | Editable bookmarks from xml file |
sample-bookmarks.xml | Sample xml bookmarks file |
JavaSource\com\esri\arcgis\sample\util\ExtentUtil.java | Utility class to work with WebExtent |
JavaSource\com\esri\arcgis\sample\util\QueryUtil.java | Utility class to perform queries against gis server |
Development licensing | Deployment licensing |
---|---|
Server | Server |