-
-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dojo build issues #547
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e8ef183
Move proj4 to the app config to allow developers to use offline vers…
green3g c5eeb40
Remove proj4 cdn path from streetview
green3g 35e8d8d
Add a package.js build descriptor file
green3g becb23c
Switch to the bower version of google maps loader.
green3g ec2b691
Use quotes around reserved property 'float'
green3g 2e74d21
Update package descriptor to only copy the image files
green3g 683f5de
Remove old plugin import
green3g 66a73bd
Fix indentation
green3g 580347d
Disable eslint on vendor google-maps loader
green3g 6a83281
Switch style setter to use dojo/dom-style
green3g 8ced6d2
Exclude node_modules from amd search
green3g 0e1ba87
Tell dojo to use the package.js build file
green3g 1cf7750
Exclude node_modules and other non-amd files from being tagged as amd
green3g 059b3ac
Remove troublesome error from Google Loader
green3g a62df6a
Add more rules to the package.js
green3g 95ed51c
Makes config/app dojo-build friendly
green3g 1e916e6
Fix proj4js path merge
green3g 3f89efc
Fix eslint errors (again)
green3g 0e5224f
Revert app.js back to cmv default and ignore app.js via the profile.
green3g 088b9c9
Merge branch 'develop' into fix/fix-dojo-build-issues
green3g 9914473
Merge branch 'develop' into fix/fix-dojo-build-issues
green3g 90ee802
Merge branch 'develop' into fix/fix-dojo-build-issues
green3g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* This file is referenced by the `dojoBuild` key in `package.json` and provides extra hinting specific to the Dojo | ||
* build system about how certain files in the package need to be handled at build time. Build profiles for the | ||
* application itself are stored in the `profiles` directory. | ||
*/ | ||
|
||
var profile = (function () { | ||
//only copy files matching these expressions | ||
//this prevents them from being evaluated as amd modules | ||
var reCopyOnly = [ | ||
/Gruntfile/, | ||
/package/, | ||
/app\.js/ | ||
]; | ||
//exclude from builds completely | ||
var reMiniExclude = [ | ||
/Gruntfile/, | ||
/package/ | ||
]; | ||
//non-amd modules | ||
var reNonAmd = [ | ||
/plugins\/Google/ | ||
]; | ||
return { | ||
// Resource tags are functions that provide hints to the build system about the way files should be processed. | ||
// Each of these functions is called once for every file in the package directory. The first argument passed to | ||
// the function is the filename of the file, and the second argument is the computed AMD module ID of the file. | ||
resourceTags: { | ||
// Files that contain test code and should be excluded when the `copyTests` build flag exists and is `false`. | ||
// It is strongly recommended that the `mini` build flag be used instead of `copyTests`. Therefore, no files | ||
// are marked with the `test` tag here. | ||
test: function (filename, mid) { | ||
return false; | ||
}, | ||
|
||
// Files that should be copied as-is without being modified by the build system. | ||
// All files in the `app/resources` directory that are not CSS files are marked as copy-only, since these files | ||
// are typically binaries (images, etc.) and may be corrupted by the build system if it attempts to process | ||
// them and naively assumes they are scripts. | ||
copyOnly: function (filename, mid) { | ||
for (var i = 0; i < reCopyOnly.length; i++) { | ||
if (reCopyOnly[i].test(filename)) { | ||
return true; | ||
} | ||
} | ||
return (/\/(images)\//.test(mid) && !/\.css$/.test(filename)) || | ||
/\/node_modules\//.test(mid); | ||
}, | ||
|
||
// Files that are AMD modules. | ||
// All JavaScript in this package should be AMD modules if you are starting a new project. If you are copying | ||
// any legacy scripts from an existing project, those legacy scripts should not be given the `amd` tag. | ||
amd: function (filename, mid) { | ||
for (var i = 0; i < reNonAmd.length; i++) { | ||
if (reNonAmd[i].test(filename)) { | ||
return false; | ||
} | ||
} | ||
return !this.copyOnly(filename, mid) && /\.js$/.test(filename); | ||
}, | ||
|
||
// Files that should not be copied when the `mini` build flag is set to true. | ||
// In this case, we are excluding this package configuration file which is not necessary in a built copy of | ||
// the application. | ||
miniExclude: function (filename, mid) { | ||
for (var i = 0; i < reMiniExclude.length; i++) { | ||
if (reMiniExclude[i].test(filename)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} | ||
}; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/*global google */ | ||
define([ | ||
'dojo/_base/declare', | ||
'dijit/_WidgetBase', | ||
|
@@ -17,31 +16,21 @@ define([ | |
'esri/geometry/Point', | ||
'esri/SpatialReference', | ||
'dijit/MenuItem', | ||
'//cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12/proj4.js', | ||
'proj4js/proj4', | ||
'dojo/i18n!./StreetView/nls/resource', | ||
|
||
'gis/plugins/Google', | ||
'dijit/form/ToggleButton', | ||
'xstyle/css!./StreetView/css/StreetView.css', | ||
'gis/plugins/async!//maps.google.com/maps/api/js?v=3' | ||
], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, lang, aspect, topic, GraphicsLayer, Graphic, SimpleRenderer, template, PictureMarkerSymbol, domStyle, domGeom, Point, SpatialReference, MenuItem, proj4, i18n) { | ||
|
||
'xstyle/css!./StreetView/css/StreetView.css' | ||
], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, lang, aspect, topic, GraphicsLayer, Graphic, SimpleRenderer, template, PictureMarkerSymbol, domStyle, domGeom, Point, SpatialReference, MenuItem, proj4, i18n, Google) { | ||
//cache google so | ||
var google; | ||
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], { | ||
widgetsInTemplate: true, | ||
templateString: template, | ||
i18n: i18n, | ||
mapClickMode: null, | ||
|
||
panoOptions: { | ||
addressControlOptions: { | ||
position: google.maps.ControlPosition.TOP_RIGHT | ||
}, | ||
linksControl: false, | ||
panControl: false, | ||
zoomControlOptions: { | ||
style: google.maps.ZoomControlStyle.SMALL | ||
}, | ||
enableCloseButton: false | ||
}, | ||
panoOptions: null, | ||
|
||
// in case this changes some day | ||
proj4BaseURL: 'http://spatialreference.org/', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the spatialreference.org domain does not work using HTTPS, I will switch references from http://spatialreference.org to use https://epsg.io and revise the JS once this PR has been merged. This change will apply to the MapInfo widget as well. |
||
|
@@ -57,29 +46,47 @@ define([ | |
|
||
postCreate: function () { | ||
this.inherited(arguments); | ||
this.createGraphicsLayer(); | ||
this.map.on('click', lang.hitch(this, 'getStreetView')); | ||
//load the google api asynchronously | ||
Google.load(lang.hitch(this, function (g) { | ||
//store a reference to google | ||
google = g; | ||
|
||
this.own(topic.subscribe('mapClickMode/currentSet', lang.hitch(this, 'setMapClickMode'))); | ||
//init our panoOptions since they depend on google | ||
this.panoOptions = { | ||
addressControlOptions: { | ||
position: google.maps.ControlPosition.TOP_RIGHT | ||
}, | ||
linksControl: false, | ||
panControl: false, | ||
zoomControlOptions: { | ||
style: google.maps.ZoomControlStyle.SMALL | ||
}, | ||
enableCloseButton: false | ||
}; | ||
this.createGraphicsLayer(); | ||
this.map.on('click', lang.hitch(this, 'getStreetView')); | ||
|
||
if (this.parentWidget) { | ||
if (this.parentWidget.toggleable) { | ||
this.own(aspect.after(this.parentWidget, 'toggle', lang.hitch(this, function () { | ||
this.onLayoutChange(this.parentWidget.open); | ||
}))); | ||
this.own(topic.subscribe('mapClickMode/currentSet', lang.hitch(this, 'setMapClickMode'))); | ||
|
||
if (this.parentWidget) { | ||
if (this.parentWidget.toggleable) { | ||
this.own(aspect.after(this.parentWidget, 'toggle', lang.hitch(this, function () { | ||
this.onLayoutChange(this.parentWidget.open); | ||
}))); | ||
} | ||
this.own(aspect.after(this.parentWidget, 'resize', lang.hitch(this, 'resize'))); | ||
this.own(topic.subscribe(this.parentWidget.id + '/resize/resize', lang.hitch(this, 'resize'))); | ||
} | ||
this.own(aspect.after(this.parentWidget, 'resize', lang.hitch(this, 'resize'))); | ||
this.own(topic.subscribe(this.parentWidget.id + '/resize/resize', lang.hitch(this, 'resize'))); | ||
} | ||
|
||
// spatialreference.org uses the old | ||
// Proj4js style so we need an alias | ||
// https://github.com/proj4js/proj4js/issues/23 | ||
window.Proj4js = proj4; | ||
// spatialreference.org uses the old | ||
// Proj4js style so we need an alias | ||
// https://github.com/proj4js/proj4js/issues/23 | ||
window.Proj4js = proj4; | ||
|
||
if (this.mapRightClickMenu) { | ||
this.addRightClickMenu(); | ||
} | ||
if (this.mapRightClickMenu) { | ||
this.addRightClickMenu(); | ||
} | ||
})); | ||
}, | ||
createGraphicsLayer: function () { | ||
this.pointSymbol = new PictureMarkerSymbol(require.toUrl('gis/dijit/StreetView/images/blueArrow.png'), 30, 30); | ||
|
@@ -129,7 +136,7 @@ define([ | |
} else { | ||
this.connectMapClick(); | ||
} | ||
//get map click, set up listener in post create | ||
//get map click, set up listener in post create | ||
}, | ||
disconnectMapClick: function () { | ||
this.streetViewButtonDijit.set('checked', true); | ||
|
@@ -302,4 +309,4 @@ define([ | |
this.mapClickMode = mode; | ||
} | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roemhildtg A heads up. From my latest PR #571, I am recommending we use HTTPS wherever possible as it has now become the preferred "standard" practice versus the old
//
url pattern. Assuming that recommendation passes review from @DavidSpriggs, this proj4js reference would change to HTTPS.