Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

new file testing

  • Loading branch information...
commit 3db983e429cd6cd0672120720ad2ef723cd36f3b 1 parent a1f3759
@Gabino3 Gabino3 authored
Showing with 18 additions and 10 deletions.
  1. +18 −10 js/geocamMaps.js
View
28 js/geocamMaps.js
@@ -72,6 +72,9 @@ GeocamResponderMaps.MapOverlay = Em.Object.extend({
if (Ember.typeOf(v) === 'function') {
continue;
}
+ if (Ember.typeOf(v) === 'object')
+ continue;
+
ret.push(key);
}
}
@@ -722,10 +725,10 @@ GeocamResponderMaps.NewFileController = Em.ArrayController.create({
var metaUrl;
var externalCopy = this.externalCopy;
console.log(externalCopy);
- $.post(GeocamResponderMaps.HOST+'layer/new/', JSON.stringify({externalUrl: externalCopy, hosting: "external"}), function(data){
- metaUrl = data.result.metaUrl;
- });
- this.metaUrl = metaUrl;
+ // $.post(GeocamResponderMaps.HOST+'layer/new/', JSON.stringify({externalUrl: externalCopy, hosting: "external"}), function(data){
+ // metaUrl = data.result.metaUrl;
+// });
+ // this.metaUrl = metaUrl;
},
create: function(){
if(this.name == ''){
@@ -760,9 +763,9 @@ GeocamResponderMaps.NewFileController = Em.ArrayController.create({
acceptTerms: this.acceptTerms
});
console.log(newOverlay.getJson());
- $.post(GeocamResponderMaps.HOST+'layer/new/', JSON.stringify(newOverlay.getJson()), function(data){
+ $.post(GeocamResponderMaps.HOST+'api/layers/', JSON.stringify(newOverlay.getJson()), function(data){
console.log(data);
- });
+ }, 'json');
GeocamResponderMaps.LibController.library.add(newOverlay);
GeocamResponderMaps.LibController.updateLibrary();
@@ -830,16 +833,21 @@ GeocamResponderMaps.NewFileController = Em.ArrayController.create({
document.getElementById('fileUploadButton').value='';
},
localFileSelect: function() {
- this.file = document.getElementById("fileUploadButton").files[0]; // FileList object
+ var file = document.getElementById("fileUploadButton").files[0]; // FileList object
var type = "application/vnd.google-earth.kml+xml";
- if(!type==this.file.type){
+ if(!type==file.type){
alert("Please choose a kml file");
document.getElementById('fileUploadButton').value='';
return ;
}
var reader = new FileReader();
- localCopy = this.file;
-
+ this.localCopy = file;
+
+
+ // this.file = new FormData();
+
+ // this.file.append('', file);
+
},
fileUpload: function() {
Please sign in to comment.
Something went wrong with that request. Please try again.