|
POST
|
I still doesnt have clarity ... But i know webpack can transpilling them into amd modules. The thing is how to do it now... I have this in my webpack.config.js file (i see this code in the sites u gave me before) What else should i set up there? am i in the right way? var path = require('path');
module.exports = {
entry: {
login: './static/js/bundles/login.js',
dashboard: './static/js/bundles/dashboard.js',
..
},
output: {
path: path.join(path.join(__dirname, 'dist'), 'js'),
filename: '[name].js'
},
devServer: {
inline: true,
port: 443,
host: "127.0.0.1"
},
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-2']
}
}
]
},
externals: [
function(context, request, callback) {
if (/^dojo/.test(request) ||
/^dojox/.test(request) ||
/^dijit/.test(request) ||
/^esri/.test(request)
) {
return callback(null, "amd " + request);
}
callback();
}
]
}; Cuz im getting the following error: Uncaught ReferenceError: __WEBPACK_EXTERNAL_MODULE_501__ is not defined Thanks for all ur help.
... View more
09-02-2016
08:42 AM
|
0
|
3
|
6124
|
|
POST
|
Rene, I still dont understand too much how to incorporate some modules that the arcgis js api has. For example, i want to use the Search that this example shows: ArcGIS API for JavaScript Sandbox How i said, im developing a webapp using the following setup: React JS as framework. Webpack as server, my config file is the following: var path = require('path');
module.exports = {
entry: {
login: './static/js/bundles/login.js',
dashboard: './static/js/bundles/dashboard.js'
},
output: {
path: path.join(path.join(__dirname, 'dist'), 'js'),
filename: '[name].js'
},
devServer: {
inline: true,
port: 443,
host: "127.0.0.1"
},
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-2']
}
}
]
}
}; gulp as task manager that doest this: var gulp = require('gulp');
var sass = require('gulp-sass');
var swig = require('gulp-swig');
var notify = require("gulp-notify");
function defaultError(type){
return function(err){
console.log(type + ' error : ' + err);
};
}
function dist(path){
return './dist/' + path;
}
function realPath(xs){
return './static/' + xs;
}
var reportError = function (error) {
notify({
title: 'Gulp Task Error',
message: 'Check the console.'
}).write(error);
console.log(error.toString());
this.emit('end');
}
gulp.task('sass', function(){
return gulp.src('./static/css/*.scss')
.pipe(sass({ outputStyle: 'compact' }))
.on('error', reportError)
.pipe(gulp.dest(dist('css')))
});
gulp.task('css', function(){
return gulp.src('./static/css/*.css')
.pipe(sass({ outputStyle: 'compact' }))
.on('error', reportError)
.pipe(gulp.dest(dist('css')))
});
gulp.task('templates', function(){
return gulp.src(['./*.html','!./base.html'])
.pipe(swig())
.pipe(gulp.dest('dist/templates'));
});
gulp.task('libs', function(){
return gulp.src('./static/js/vendor/*.js')
.pipe(gulp.dest(dist('js/vendor')));
});
gulp.task('fonts', function(){
return gulp.src('./static/css/fonts/*.ttf')
.on('error', reportError)
.pipe(gulp.dest(dist('css/fonts')))
});
gulp.task('images', function(){
return gulp.src('./static/css/images/**/*.png')
.on('error', reportError)
.pipe(gulp.dest(dist('css/images')))
});
gulp.task('html', function(){
return gulp.src('*.html')
.on('error', reportError)
.pipe(gulp.dest(dist('')))
});
gulp.task('js', function(){
return gulp.src('./static/js/vendor/**/*.js')
.on('error', reportError)
.pipe(gulp.dest(dist('')))
});
gulp.task('watch', function(){
gulp.watch(['css/**/*.scss'].map(realPath), ['sass']);
gulp.watch(['*.html'], ['templates']);
});
gulp.task('default', ['sass', 'templates', 'libs','fonts','images','watch', 'css','html']);
And my package.json file contains this. {
"name": "myprojectname",
"version": "1.0.0",
"description": "For next project.",
"main": "server.js",
"scripts": {
"start": "start npm run dev:server & start npm run gulp",
"dev:server": "webpack-dev-server",
"dev:build": "webpack --progress --colors",
"prod:build": "webpack --optimize-minimize --progress --colors",
"gulp": "gulp",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "..."
},
"author": "",
"license": "ISC",
"bugs": {
"url": "..."
},
"homepage": "...#readme",
"dependencies": {
"highcharts": "~4.2.4",
"lodash": "~4.15.0",
"react": "^0.14.7",
"react-data-grid": "~0.14.18",
"react-dom": "^0.14.7",
"griddle-react": "~0.4.1",
"react-native": "~0.24.1",
"jspdf": "~1.2.61",
"jspdf-autotable": "~2.0.25",
"cookie-handler": "~1.0.1",
"redux": "~3.5.2",
"react-select": "~1.0.0-beta13",
"rutjs": "~0.1.1",
"react-image-gallery": "~0.6.4",
"babel-plugin-transform-decorators-legacy": "~1.3.4",
"validator": "~5.5.0",
"react-bootstrap-modal": "~2.1.0",
"react-modal": "~1.4.0"
},
"devDependencies": {
"babel-core": "^6.6.5",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-2": "^6.5.0",
"babelify": "^7.2.0",
"browserify": "^13.0.0",
"gulp": "^3.9.1",
"gulp-notify": "~2.2.0",
"gulp-sass": "^2.2.0",
"gulp-swig": "^0.8.0",
"node-sass": "^3.4.2",
"react-tabs": "^0.5.3",
"webpack": "^1.12.14",
"webpack-dev-server": "^1.14.1",
"react-bootstrap": "~0.30.0"
}
} In the module that im working i want to load the arcgis api features like search, map like this: import Search from 'esri/dijit/Search' The way im doing it now is using the legacy code for all of the developing im working. For example when i implement Dynamic layers i need to write in this way (and it works). var layerD = new esri.layers.ArcGISDynamicMapServiceLayer(layers.read_direccionesDyn(),{id:"factigis_d"});
layerD .setImageFormat("png32");
layerD .setVisibleLayers([0]);
mapp.addLayer(layerD ); But for example when i want to write the legacy code for the Search showed in the example, var search = new esri.dijit.Search({map: mapp}, "search");
search.startup(); it gives me an error saying "Uncaught TypeError: esri.dijit.Search is not a constructor". If i put: dojo.require(esri.dijit.Search) is says "multiple define". Im pretty new on developing in this way , and I have been reading all the guides u guys gave me but im still very confused on how to fix my problem loading the esri modules with the setup that i have. My html is this one: and there i show where i put the arcgis js api <html lang="es">
<head>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" >
<link rel="shortcut icon" href="">
<title>GISRED - FactiGIS FRONTOFFICE</title>
<link rel="stylesheet" type="text/css" href="arcgis_js_api/library/3.16/3.16/dijit/themes/tundra/tundra.css" />
<link rel="stylesheet" type="text/css" href="arcgis_js_api/library/3.16/3.16/esri/css/esri.css" />
<link rel="stylesheet" href="static/js/vendor/bootstrap.min.css" />
<link rel="stylesheet" href="static/js/vendor/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="dist/css/factigis.css" />
<script src="static/js/vendor/jspdf/jspdf.min.js"></script>
<script src="static/js/vendor/jspdf/jspdf.plugin.autotable.js"></script>
<script src="static/js/vendor/jspdf/faker.min.js"></script>
<link rel="stylesheet" href="dist/css/react-select.css">
</head>
<body class="bodyfactigis">
<div id="myFactigis_FrontOffice" class="myFactigis_FrontOffice"></div>
<script type="text/javascript" src="arcgis_js_api/library/3.16/3.16/init.js"></script>
<script src="static/js/vendor/jquery.min.js"></script>
<script src="static/js/vendor/lodash.core.js"></script>
<script src="static/js/vendor/jQueryRotate.js"></script>
<script src="factigisFrontoffice.js"></script>
</body>
</html> I hope u guys that understand more than me about this could guide me, i really want to use the complete arcgis js api in my app without changing the way im working too much. Thanks in advice! 😞
... View more
09-02-2016
06:29 AM
|
0
|
5
|
6124
|
|
POST
|
The thing is, i tried the same script with another layer in the same directory ( actually is a table) and it works wihout any problem. So i dont thing thats the prob.
... View more
08-24-2016
10:56 AM
|
0
|
0
|
2084
|
|
POST
|
well if i dont put any geometry, like : adds: JSON.stringify([{ attributes: {Rut: '17091916-5'}, geometry: {}}]), of even this adds: JSON.stringify([{ attributes: {Rut: '17091916-5'}}]) i got the same error 1060, so my question is, the spatial reference in this case still matters?
... View more
08-24-2016
10:34 AM
|
0
|
2
|
2084
|
|
POST
|
Ah, well i dont know how to see if the spatial reference matches, cuz my arcgis admin makes the rest services. Is there a way to see it through rest service? Thanks!.
... View more
08-24-2016
08:35 AM
|
0
|
1
|
2084
|
|
POST
|
Hello, i have the following script and im getting an error 1060 that goes like this: {"addResults":[{"success":false,"error":{"code":1060,"description":"Rowbuffer creation failed."}}],"updateResults":[],"deleteResults":[]} error What im doing wrong? My script to add a new feature using ajax. function agregarFact(f, callback){aaa
var myAttributes = {
Rut : "1231556165-5",
Nombre : "a",
Apellido : "b",
Telefono : "84031822",
Email: "[email protected]",
Tipo_cliente : "INDUSTRIAL",
Tipo_contribuyente : "AUTOCONSUMO",
Rotulo : "131551077",
Tramo : "CD35-CD35-CD35",
Empalme : "SUBTERRANEO",
Fase : "TRIFASICO",
Potencia : 6.0,
Capacidad_empalme : 6.6,
Capacidad_interruptor : 10,
Tiempo_empalme : "DEFINITIVO",
Tipo_empalme: "BT",
Cantidad_empalme : 3,
ID_Direccion : 4855875,
Direccion: "AVENIDA ARGENTINA 1",
Potencia_calculada : 18,
DistRotuloMedidor: 15,
DistDireccionMedidor : 22,
Comuna : "VALPARAISO",
Alimentador: "BARON",
Idnodo : 131551077,
Estado_tramite: "NUEVA",
Tipo_factibilidad: "FACTIBILIDAD ASISTIDA",
Tipo_mejora : "",
Zona : "ZONA VALPARAISO",
Origen_factibilidad : "OFICINA COMERCIAL",
Sed :0,
PotenciaDispSed :-325.27305331396866
}
console.log(myAttributes)
let geox = f.factigisGeoCliente.x;
let geoy= f.factigisGeoCliente.y;
const data = {
f: 'json',
adds: JSON.stringify([{ attributes: myAttributes, geometry: {"x":geox , "y": geoy}}]),
token: token.read()
};
jQuery.ajax({
method: 'POST',
url: "http://myserver/arcgis/rest/services/FACTIBILIDAD/FACTIGIS/FeatureServer/0/applyEdits",
dataType:'html',
data: data
}).done(d =>{
if(d.includes("error")){
console.log(d,"error");
return callback(false);
}
if(d.includes("success")){
console.log(d,"adds");
return callback(true);
}
return callback(false)
})
.fail(f=>{
console.log(f,"no pase");
return callback(false)
});
}
... View more
08-24-2016
08:01 AM
|
0
|
6
|
3182
|
|
POST
|
OK, but my last question is: the script that i showed in the first comment is the way to do it? I mean , can i include that one or im missing something? (the logic) Thanks in advice!
... View more
08-16-2016
06:02 AM
|
0
|
1
|
1670
|
|
POST
|
Lets say. I have a db table that in certain moment the data that it has will be updated, so each time when that happen i need to run a buffer. I wanna know how to run a script automatically (via scheduled task or something else) that allows me to run the buffer to keep a service updated(a layer that shows the result in a web app with a map) .
... View more
08-16-2016
05:19 AM
|
0
|
3
|
1670
|
|
POST
|
Hello, Im pretty new on Geoprocessing tools and running automatic process in arcmap. I wanna know if theres a way to run a buffer automatically when new data is found in a db table, layer or anything else i wanna use. I just created a buffer in the toolbox and i save it, the structure is : my layer -> buffer tool -> output file. I save it and im trying to generate the python code to simulate the data will be loaded in that layer (its an example) and then i generate the buffer as a result. My python code is going like this. import arcpy from arcpy import env import arcgis arcpy.ImportToolbox("C:\Users\myuser\Documents\ArcGIS\Toolbox","BufferTramosSelected") arcpy.BufferTramosSelected_BufferTramosSelected() import time mins = 0 while mins != 5: print ">>>", mins arcpy.BufferTramosSelected_BufferTramosSelected() time.sleep(30) mins+=1 So is that correct? or theres another way to do this? I need suggestions and code (if somebody already do this). Thanks in advice!
... View more
08-12-2016
09:47 AM
|
0
|
5
|
2653
|
|
POST
|
I solved my problem accessing the arcmap in admin mode.
... View more
08-11-2016
06:54 AM
|
0
|
0
|
3430
|
|
POST
|
Im not trying to log in with my domain account, i have special credentials to do it. I said, when i log in in windows with a local account and try the credentials i have i can connect to the DB. After that, if i log in in my pc with my domain acc and try the credentials i cannot connect to the db. Idk whats happening.
... View more
08-10-2016
07:39 AM
|
0
|
2
|
3430
|
|
POST
|
Im not sure about it. But for example, i just tried with my local administrator account from my computer to connect to that DB with arcmap and it worked. If i tried with my domain acc i get the error that i showed u...
... View more
08-09-2016
02:36 PM
|
0
|
4
|
3430
|
|
POST
|
I did that already using the ip and instance, but when i do that gives me that error.
... View more
08-09-2016
12:51 PM
|
0
|
6
|
3430
|
|
POST
|
Hello, I am trying to connect to a SQL database and I have the following error: What is happening? my credentials for the sql server i tried it in another program and they work... Thanks in advice!
... View more
08-09-2016
12:21 PM
|
0
|
8
|
4394
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-21-2017 02:09 PM | |
| 1 | 04-10-2015 07:52 AM | |
| 1 | 03-23-2016 02:08 PM | |
| 1 | 02-22-2016 05:01 AM | |
| 1 | 10-09-2018 07:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-01-2024
03:05 AM
|