Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > > define([
- > > 'esri/units',
- > > 'esri/geometry/Extent',
- > > 'esri/config',
- > > /*'esri/urlUtils',*/
- > > 'esri/tasks/GeometryService',
- > > 'esri/layers/ImageParameters',
- > > 'gis/plugins/Google',
- > > 'dojo/i18n!./nls/main',
- > > 'dojo/topic',
- > > 'dojo/sniff',
- > > 'esri/geometry/Point',
- > > 'esri/dijit/Basemap',
- > > 'esri/dijit/BasemapLayer' ], function (units, Extent, esriConfig, /*urlUtils,*/ GeometryService, ImageParameters,
- > GoogleMapsLoader,
- > > i18n, topic, has, Point, Basemap, BasemapLayer) {
- > >
- > > // url to your proxy page, must be on same machine hosting you app. See proxy folder for readme.
- > > esriConfig.defaults.io.proxyUrl = 'proxy/proxy.ashx';
- > > esriConfig.defaults.io.alwaysUseProxy = false;
- > >
- > > // add a proxy rule to force specific domain requests through proxy
- > > // be sure the domain is added in proxy.config
- > > /*urlUtils.addProxyRule({
- > > urlPrefix: 'www.example.com',
- > > proxyUrl: 'proxy/proxy.ashx'
- > > });*/
- > >
- > > // url to your geometry server.
- > > esriConfig.defaults.geometryService = new GeometryService('https://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer');
- > >
- > > // Use your own Google Maps API Key.
- > > // https://developers.google.com/maps/documentation/javascript/get-api-key
- > > GoogleMapsLoader.KEY = 'NOT-A-REAL-API-KEY';
- > >
- > > // helper function returning ImageParameters for dynamic layers
- > > // example:
- > > // imageParameters: buildImageParameters({
- > > // layerIds: [0],
- > > // layerOption: 'show'
- > > // })
- > > function buildImageParameters (config) {
- > > config = config || {};
- > > var ip = new ImageParameters();
- > > //image parameters for dynamic services, set to png32 for higher quality exports
- > > ip.format = 'png32';
- > > for (var key in config) {
- > > if (config.hasOwnProperty(key)) {
- > > ip[key] = config[key];
- > > }
- > > }
- > > return ip;
- > > }
- > >
- > > //some example topics for listening to menu item clicks
- > > //these topics publish a simple message to the growler
- > > //in a real world example, these topics would be used
- > > //in their own widget to listen for layer menu click events
- > > topic.subscribe('layerControl/hello', function (event) {
- > > topic.publish('growler/growl', {
- > > title: 'Hello!',
- > > message: event.layer._titleForLegend + ' ' +
- > > (event.subLayer ? event.subLayer.name : '') +
- > > ' says hello'
- > > });
- > > });
- > > topic.subscribe('layerControl/goodbye', function (event) {
- > > topic.publish('growler/growl', {
- > > title: 'Goodbye!',
- > > message: event.layer._titleForLegend + ' ' +
- > > (event.subLayer ? event.subLayer.name : '') +
- > > ' says goodbye'
- > > });
- > > });
- > >
- > > return {
- > > // used for debugging your app
- > > isDebug: true,
- > >
- > > //default mapClick mode, mapClickMode lets widgets know what mode the map is in to avoid multipult map click actions from
- > taking
- > > place (ie identify while drawing).
- > > defaultMapClickMode: 'identify',
- > > // map options, passed to map constructor. see: https://developers.arcgis.com/javascript/jsapi/map-amd.html#map1
- > > mapOptions:{
- > > // tiled layer
- > > basemap: **new Basemap({
- > > id: 'soco',
- > > layers: [new BasemapLayer({
- > > url: 'http://gis-webpub.sonoma-county.org/arcgis/rest/services/BaseMap/SonomaCountyBaseMap/MapServer/'
- > > })]
- > > }),
- > > center: new Point({
- > > x: 6356023.515330248,
- > > y: 1917313.443425702,
- > > spatialReference: {
- > > wkid: 102642
- > > }
- > > }),
- > > zoom: 5
- > > }**,
Add Comment
Please, Sign In to add comment