Guest User

Untitled

a guest
Jan 15th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. > > define([
  2. > > 'esri/units',
  3. > > 'esri/geometry/Extent',
  4. > > 'esri/config',
  5. > > /*'esri/urlUtils',*/
  6. > > 'esri/tasks/GeometryService',
  7. > > 'esri/layers/ImageParameters',
  8. > > 'gis/plugins/Google',
  9. > > 'dojo/i18n!./nls/main',
  10. > > 'dojo/topic',
  11. > > 'dojo/sniff',
  12. > > 'esri/geometry/Point',
  13. > > 'esri/dijit/Basemap',
  14. > > 'esri/dijit/BasemapLayer' ], function (units, Extent, esriConfig, /*urlUtils,*/ GeometryService, ImageParameters,
  15. > GoogleMapsLoader,
  16. > > i18n, topic, has, Point, Basemap, BasemapLayer) {
  17. > >
  18. > > // url to your proxy page, must be on same machine hosting you app. See proxy folder for readme.
  19. > > esriConfig.defaults.io.proxyUrl = 'proxy/proxy.ashx';
  20. > > esriConfig.defaults.io.alwaysUseProxy = false;
  21. > >
  22. > > // add a proxy rule to force specific domain requests through proxy
  23. > > // be sure the domain is added in proxy.config
  24. > > /*urlUtils.addProxyRule({
  25. > > urlPrefix: 'www.example.com',
  26. > > proxyUrl: 'proxy/proxy.ashx'
  27. > > });*/
  28. > >
  29. > > // url to your geometry server.
  30. > > esriConfig.defaults.geometryService = new GeometryService('https://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer');
  31. > >
  32. > > // Use your own Google Maps API Key.
  33. > > // https://developers.google.com/maps/documentation/javascript/get-api-key
  34. > > GoogleMapsLoader.KEY = 'NOT-A-REAL-API-KEY';
  35. > >
  36. > > // helper function returning ImageParameters for dynamic layers
  37. > > // example:
  38. > > // imageParameters: buildImageParameters({
  39. > > // layerIds: [0],
  40. > > // layerOption: 'show'
  41. > > // })
  42. > > function buildImageParameters (config) {
  43. > > config = config || {};
  44. > > var ip = new ImageParameters();
  45. > > //image parameters for dynamic services, set to png32 for higher quality exports
  46. > > ip.format = 'png32';
  47. > > for (var key in config) {
  48. > > if (config.hasOwnProperty(key)) {
  49. > > ip[key] = config[key];
  50. > > }
  51. > > }
  52. > > return ip;
  53. > > }
  54. > >
  55. > > //some example topics for listening to menu item clicks
  56. > > //these topics publish a simple message to the growler
  57. > > //in a real world example, these topics would be used
  58. > > //in their own widget to listen for layer menu click events
  59. > > topic.subscribe('layerControl/hello', function (event) {
  60. > > topic.publish('growler/growl', {
  61. > > title: 'Hello!',
  62. > > message: event.layer._titleForLegend + ' ' +
  63. > > (event.subLayer ? event.subLayer.name : '') +
  64. > > ' says hello'
  65. > > });
  66. > > });
  67. > > topic.subscribe('layerControl/goodbye', function (event) {
  68. > > topic.publish('growler/growl', {
  69. > > title: 'Goodbye!',
  70. > > message: event.layer._titleForLegend + ' ' +
  71. > > (event.subLayer ? event.subLayer.name : '') +
  72. > > ' says goodbye'
  73. > > });
  74. > > });
  75. > >
  76. > > return {
  77. > > // used for debugging your app
  78. > > isDebug: true,
  79. > >
  80. > > //default mapClick mode, mapClickMode lets widgets know what mode the map is in to avoid multipult map click actions from
  81. > taking
  82. > > place (ie identify while drawing).
  83. > > defaultMapClickMode: 'identify',
  84. > > // map options, passed to map constructor. see: https://developers.arcgis.com/javascript/jsapi/map-amd.html#map1
  85. > > mapOptions:{
  86. > > // tiled layer
  87. > > basemap: **new Basemap({
  88. > > id: 'soco',
  89. > > layers: [new BasemapLayer({
  90. > > url: 'http://gis-webpub.sonoma-county.org/arcgis/rest/services/BaseMap/SonomaCountyBaseMap/MapServer/'
  91. > > })]
  92. > > }),
  93. > > center: new Point({
  94. > > x: 6356023.515330248,
  95. > > y: 1917313.443425702,
  96. > > spatialReference: {
  97. > > wkid: 102642
  98. > > }
  99. > > }),
  100. > > zoom: 5
  101. > > }**,
Add Comment
Please, Sign In to add comment