-
Notifications
You must be signed in to change notification settings - Fork 208
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
Switch to yarn #678
Merged
Merged
Switch to yarn #678
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6bc9a8c
Add yarn
kaustubh-nair 116f385
Remove error log
kaustubh-nair 1f1dedd
Modify package.json
kaustubh-nair f7f526f
Add yarn install to start.sh
kaustubh-nair 68385c3
Add leaflet google
kaustubh-nair ae88815
Remove leaflet-google from package json
kaustubh-nair 49af138
remove passenger error logs
kaustubh-nair b34dd84
Fix install script
kaustubh-nair 5c0c7c7
Remove flag
kaustubh-nair 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 |
---|---|---|
|
@@ -44,3 +44,5 @@ todo.txt | |
.byebug_history | ||
coverage_report/ | ||
test/reports/ | ||
yarn-error.log | ||
|
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 @@ | ||
--install.modules-folder "./public/lib" |
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 |
---|---|---|
@@ -0,0 +1,204 @@ | ||
// | ||
// Copied from https://gist.githubusercontent.com/jywarren/770e5018c7fea09e3044b1297bd99dc0/raw/6de6259a766f473559a10a29c4a5ccf23b2a0dea/Google.js | ||
// | ||
/* | ||
* Google layer using Google Maps API | ||
*/ | ||
|
||
/* global google: true */ | ||
|
||
L.Google = L.Class.extend({ | ||
includes: L.Mixin.Events, | ||
|
||
options: { | ||
minZoom: 0, | ||
maxZoom: 18, | ||
tileSize: 256, | ||
subdomains: 'abc', | ||
errorTileUrl: '', | ||
attribution: '', | ||
opacity: 1, | ||
continuousWorld: false, | ||
noWrap: false, | ||
mapOptions: { | ||
backgroundColor: '#dddddd' | ||
} | ||
}, | ||
|
||
// Possible types: SATELLITE, ROADMAP, HYBRID, TERRAIN | ||
initialize: function(type, options) { | ||
L.Util.setOptions(this, options); | ||
|
||
this._ready = google.maps.Map !== undefined; | ||
if (!this._ready) L.Google.asyncWait.push(this); | ||
|
||
this._type = type || 'SATELLITE'; | ||
}, | ||
|
||
onAdd: function(map, insertAtTheBottom) { | ||
this._map = map; | ||
this._insertAtTheBottom = insertAtTheBottom; | ||
|
||
// create a container div for tiles | ||
this._initContainer(); | ||
this._initMapObject(); | ||
|
||
// set up events | ||
map.on('viewreset', this._resetCallback, this); | ||
|
||
this._limitedUpdate = L.Util.limitExecByInterval(this._update, 150, this); | ||
map.on('move', this._update, this); | ||
|
||
map.on('zoomanim', this._handleZoomAnim, this); | ||
|
||
//20px instead of 1em to avoid a slight overlap with google's attribution | ||
map._controlCorners.bottomright.style.marginBottom = '20px'; | ||
|
||
this._reset(); | ||
this._update(); | ||
}, | ||
|
||
onRemove: function(map) { | ||
map._container.removeChild(this._container); | ||
|
||
map.off('viewreset', this._resetCallback, this); | ||
|
||
map.off('move', this._update, this); | ||
|
||
map.off('zoomanim', this._handleZoomAnim, this); | ||
|
||
map._controlCorners.bottomright.style.marginBottom = '0em'; | ||
}, | ||
|
||
getAttribution: function() { | ||
return this.options.attribution; | ||
}, | ||
|
||
setOpacity: function(opacity) { | ||
this.options.opacity = opacity; | ||
if (opacity < 1) { | ||
L.DomUtil.setOpacity(this._container, opacity); | ||
} | ||
}, | ||
|
||
setElementSize: function(e, size) { | ||
e.style.width = size.x + 'px'; | ||
e.style.height = size.y + 'px'; | ||
}, | ||
|
||
_initContainer: function() { | ||
var tilePane = this._map._container, | ||
first = tilePane.firstChild; | ||
|
||
if (!this._container) { | ||
this._container = L.DomUtil.create('div', 'leaflet-google-layer leaflet-top leaflet-left'); | ||
this._container.id = '_GMapContainer_' + L.Util.stamp(this); | ||
this._container.style.zIndex = 'auto'; | ||
} | ||
|
||
tilePane.insertBefore(this._container, first); | ||
|
||
this.setOpacity(this.options.opacity); | ||
this.setElementSize(this._container, this._map.getSize()); | ||
}, | ||
|
||
_initMapObject: function() { | ||
if (!this._ready) return; | ||
this._google_center = new google.maps.LatLng(0, 0); | ||
var map = new google.maps.Map(this._container, { | ||
center: this._google_center, | ||
zoom: 0, | ||
tilt: 0, | ||
mapTypeId: google.maps.MapTypeId[this._type], | ||
disableDefaultUI: true, | ||
keyboardShortcuts: false, | ||
draggable: false, | ||
disableDoubleClickZoom: true, | ||
scrollwheel: false, | ||
streetViewControl: false, | ||
styles: this.options.mapOptions.styles, | ||
backgroundColor: this.options.mapOptions.backgroundColor | ||
}); | ||
|
||
var _this = this; | ||
this._reposition = google.maps.event.addListenerOnce(map, 'center_changed', | ||
function() { _this.onReposition(); }); | ||
this._google = map; | ||
|
||
google.maps.event.addListenerOnce(map, 'idle', | ||
function() { _this._checkZoomLevels(); }); | ||
google.maps.event.addListenerOnce(map, 'tilesloaded', | ||
function() { _this.fire('load'); }); | ||
//Reporting that map-object was initialized. | ||
this.fire('MapObjectInitialized', { mapObject: map }); | ||
}, | ||
|
||
_checkZoomLevels: function() { | ||
//setting the zoom level on the Google map may result in a different zoom level than the one requested | ||
//(it won't go beyond the level for which they have data). | ||
// verify and make sure the zoom levels on both Leaflet and Google maps are consistent | ||
if (this._google.getZoom() !== this._map.getZoom()) { | ||
//zoom levels are out of sync. Set the leaflet zoom level to match the google one | ||
this._map.setZoom( this._google.getZoom() ); | ||
} | ||
}, | ||
|
||
_resetCallback: function(e) { | ||
this._reset(e.hard); | ||
}, | ||
|
||
_reset: function(clearOldContainer) { | ||
this._initContainer(); | ||
}, | ||
|
||
_update: function(e) { | ||
if (!this._google) return; | ||
this._resize(); | ||
|
||
var center = this._map.getCenter(); | ||
var _center = new google.maps.LatLng(center.lat, center.lng); | ||
|
||
this._google.setCenter(_center); | ||
this._google.setZoom(Math.round(this._map.getZoom())); | ||
|
||
this._checkZoomLevels(); | ||
}, | ||
|
||
_resize: function() { | ||
var size = this._map.getSize(); | ||
if (this._container.style.width === size.x && | ||
this._container.style.height === size.y) | ||
return; | ||
this.setElementSize(this._container, size); | ||
this.onReposition(); | ||
}, | ||
|
||
|
||
_handleZoomAnim: function (e) { | ||
var center = e.center; | ||
var _center = new google.maps.LatLng(center.lat, center.lng); | ||
|
||
this._google.setCenter(_center); | ||
this._google.setZoom(Math.round(e.zoom)); | ||
}, | ||
|
||
|
||
onReposition: function() { | ||
if (!this._google) return; | ||
google.maps.event.trigger(this._google, 'resize'); | ||
} | ||
}); | ||
|
||
L.Google.asyncWait = []; | ||
L.Google.asyncInitialize = function() { | ||
var i; | ||
for (i = 0; i < L.Google.asyncWait.length; i++) { | ||
var o = L.Google.asyncWait[i]; | ||
o._ready = true; | ||
if (o._container) { | ||
o._initMapObject(); | ||
o._update(); | ||
} | ||
} | ||
L.Google.asyncWait = []; | ||
}; |
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 was deleted.
Oops, something went wrong.
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,47 @@ | ||
{ | ||
"name": "mapknitter", | ||
"version": "1.0.0", | ||
"main": "app/assets/javascripts/application.js", | ||
"repository": "https://github.com/publiclab/mapknitter", | ||
"author": "Kaustubh Nair <kaustubh.nair108@gmail.com>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"blueimp-canvas-to-blob": "blueimp/JavaScript-Canvas-to-Blob#>=2.1.1", | ||
"blueimp-file-upload": "blueimp/jQuery-File-Upload#~9.8.1", | ||
"blueimp-load-image": "blueimp/JavaScript-Load-Image#>=1.13.0", | ||
"blueimp-tmpl": "blueimp/JavaScript-Templates#2.5.4", | ||
"bootstrap": "twbs/bootstrap#^4.3.1", | ||
"cartagen": "jywarren/cartagen#*", | ||
"exif-js": "jseidelin/exif-js#*", | ||
"font-awesome": "FortAwesome/Font-Awesome#^4.2.0", | ||
"fontawesome": "FortAwesome/Font-Awesome#~4.2.0", | ||
"glfx-js": "jywarren/glfx.js#*", | ||
"image-sequencer": "publiclab/image-sequencer#~1.4.0", | ||
"ion-rangeslider": "ionDen/ion.rangeslider#~2.3.0", | ||
"jquery": "jquery/jquery-dist#^2.1.3", | ||
"jquery-ui": "components/jqueryui#^1.12.1", | ||
"jquery-ujs": "rails/jquery-ujs#~1.0.3", | ||
"junction": "theleagueof/junction#*", | ||
"leaflet": "Leaflet/Leaflet#^1.0.0", | ||
"leaflet-dist": "vperron/leaflet-dist#0.7.x", | ||
"leaflet-distortableimage": "publiclab/Leaflet.DistortableImage#^0.4.3", | ||
"leaflet-draw": "Leaflet/Leaflet.draw#0.2.4", | ||
"leaflet-easybutton": "CliffCloud/Leaflet.EasyButton#1.0.0", | ||
"leaflet-environmental-layers": "publiclab/leaflet-environmental-layers#^1.1.2", | ||
"leaflet-fullhash": "sagarpreet-chadha/leaflet-fullHash#*", | ||
"leaflet-illustrate": "manleyjster/Leaflet.Illustrate#31d7daa42fb140c063c4a9d9ccf13a279bb1b8d7", | ||
"leaflet-omnivore": "mapbox/leaflet-omnivore#~0.3.2", | ||
"leaflet-providers": "leaflet-extras/leaflet-providers#1.0.6", | ||
"leaflet-spin": "makinacorpus/Leaflet.Spin#1.1.0", | ||
"leaflet-toolbar": "Leaflet/Leaflet.Toolbar#~0.3.0", | ||
"modalbox": "okonet/modalbox#*", | ||
"ol2": "openlayers/ol2#release-2.13.1", | ||
"prototypejs-bower": "plynchnlm/prototypejs-bower#1.7.2", | ||
"sparklines": "mariusGundersen/sparkline#~1.0.0", | ||
"spin.js": "fgnass/spin.js#^2.3.1", | ||
"webgl-distort": "jywarren/webgl-distort#*" | ||
}, | ||
"engines": { | ||
"yarn": ">= 1.0.0" | ||
} | ||
} |
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
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.
Is there such flag on yarn??
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.
No there isn't. Removed it. Thanks 👍