POST
|
Hey Matthew what code do you need. I have to code to autoPopulate a field.
... View more
10-24-2014
01:55 PM
|
0
|
1
|
1338
|
POST
|
This is my address it offers autocomplete as you can see below there is an option for autoComplete: true it has to say true. var geocoder = new Geocoder({ arcgisGeocoder: false, autoComplete: true, zoomScale:1000, geocoders: [ { url: "Your URL GOES HERE", name: "LRGVDC ", placeholder: "Locate", outFields: "*", singleLineFieldName: "SingleLine" }],
... View more
06-07-2014
04:09 PM
|
0
|
0
|
287
|
POST
|
I am trying to write a javascript application that puts points based on gps coordinates that are stored in mysql database. The database is been populate by an application on a android device and its getting its coordinates and sending them to mysql database. I want to plot the gps that are stored in that database so I can see in real life time where that person is going. I am trying to use ajax in this approach but the problem I am encountering is that I am trying to write a function that I can set an interval. For example, function NameOfFunction() This function is requesting the last record of that mysql database. stores in div html tag as hidden value { dojo.xhrGet({ url: "get-gps.php", load: function(result) { document.getElementById("lng").innerHTML = result; } }); } window.setInterval("NameOfFunction()", 1000); The problem is how I write a function inside dojo that can do interval timer so I can track does gps coordinates. Does anyone have any suggestions or a better approach to my problem..... Any Ideas........ Please help!!!!
... View more
06-06-2014
05:16 PM
|
0
|
1
|
1301
|
POST
|
I figure it out this is my answer. function initEditor(evt) { var featureLayer = evt.layers[0].layer; dojo.connect(featureLayer,'onBeforeApplyEdits',function(adds,deletes,updates){ dojo.forEach(adds,function(add){ if(add.attributes['psap'] === null){ add.attributes['psap'] = psap; } }); });
... View more
05-27-2014
07:47 AM
|
0
|
0
|
213
|
POST
|
I am having trouble with this code I am trying to auto populate a field from this feature class. This is what I have so far and is not working. my events.on('update-end', function is not working. could someone check it out and tell me what is wrong. Do I have to use attribute inspector instead if so How do I apply it to this code. Thanks, [HTML] var events = new FeatureLayer("http://maps.lrgvdc911.org:6080/arcgis/rest/services/Public_Outreach/EVENTS/FeatureServer/0",{ mode: FeatureLayer.MODE_ONDEMAND, outFields: ['EVENT_NAME', 'date','address','city','estattendance','agegroup', 'psap'] }); events.on('update-end', function(evt){ var feature = evt.feature; feature.attributes.psap = 'hello'; feature.getLayer().applyEdits(null, [feature], null); }); map.addLayers([events]); function initEditor(evt) { var templateLayers = arrayUtils.map(evt.layers, function(result){ return result.layer; }); var templatePicker = new TemplatePicker({ featureLayers: templateLayers, grouping: true, rows: "auto", columns: 1 }, "draggable"); templatePicker.startup(); var layers = arrayUtils.map(evt.layers, function(result) { return { featureLayer: result.layer, disableAttributeUpdate: false}; }); var settings = { map: map, templatePicker: templatePicker, layerInfos: layers, toolbarVisible: true, createOptions: { polylineDrawTools:[ Editor.CREATE_TOOL_FREEHAND_POLYLINE ], polygonDrawTools: [ Editor.CREATE_TOOL_FREEHAND_POLYGON, Editor.CREATE_TOOL_CIRCLE, Editor.CREATE_TOOL_TRIANGLE, Editor.CREATE_TOOL_RECTANGLE ] }, toolbarOptions: { reshapeVisible: true } }; var params = {settings: settings}; var myEditor = new Editor(params,'editorDiv'); //define snapping options var symbol = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_CROSS, 15, new SimpleLineSymbol( SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0, 0.5]), 5 ), null ); map.enableSnapping({ snapPointSymbol: symbol, tolerance: 20, snapKey: keys.ALT }); myEditor.startup(); }[/HTML]
... View more
05-21-2014
01:07 PM
|
0
|
1
|
604
|
POST
|
Are you using template picker. if yes could I see your full snippet of code. Thanks,
... View more
05-16-2014
04:23 PM
|
0
|
9
|
1338
|
POST
|
I found this code on the esri page is somewhat of what I am looking for. But the code is writting in legacy I want to use AMD style. Can help me change this code into AMD style. Thanks, dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("esri.map");
dojo.require("esri.toolbars.draw");
dojo.require("esri.toolbars.edit");
dojo.require("esri.layers.FeatureLayer");
dojo.require("esri.dijit.editing.TemplatePicker");
dojo.require("esri.dijit.AttributeInspector");
var map;
function init() {
//This sample requires a proxy page to handle communications with the ArcGIS Server services. You will need to
//replace the url below with the location of a proxy on your machine. See the 'Using the proxy page' help topic
//for details on setting up a proxy page.
esri.config.defaults.io.proxyUrl = "/proxy";
esri.config.defaults.io.alwaysUseProxy = false;
map = new esri.Map("map", {
basemap: "streets",
center: [-83.243, 42.584],
zoom: 15
});
dojo.connect(map, "onLayersAddResult", initEditing);
var pointLayer = new esri.layers.FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/FeatureServer/6", {
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
outFields: ["*"]
});
var lineLayer = new esri.layers.FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/FeatureServer/8", {
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
outFields: ["*"]
});
var polygonLayer = new esri.layers.FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/FeatureServer/9", {
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
outFields: ["*"]
});
map.addLayers([pointLayer,lineLayer,polygonLayer]);
}
function initEditing(results) {
var map = this;
var layers = dojo.map(results, function(result) {
return result.layer;
});
//display read-only info window when user clicks on feature
var query = new esri.tasks.Query();
dojo.forEach(layers, function(layer) {
dojo.connect(layer, "onClick", function(evt) {
if (map.infoWindow.isShowing) {
map.infoWindow.hide();
}
var layerInfos = [{
'featureLayer': layer,
'isEditable': false,
'showDeleteButton':false
}]
var attInspector = new esri.dijit.AttributeInspector({
layerInfos: layerInfos
}, dojo.create("div"));
query.objectIds = [evt.graphic.attributes.objectid];
layer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function(features) {
map.infoWindow.setTitle("");
map.infoWindow.setContent(attInspector.domNode);
map.infoWindow.resize(310, 165);
map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
});
});
});
var templatePicker = new esri.dijit.editing.TemplatePicker({
featureLayers: layers,
rows: 'auto',
columns: 'auto',
grouping: true
}, "templatePickerDiv");
templatePicker.startup();
var drawToolbar = new esri.toolbars.Draw(map);
var selectedTemplate;
dojo.connect(templatePicker, "onSelectionChange", function() {
selectedTemplate = templatePicker.getSelected();
if (selectedTemplate) {
switch (selectedTemplate.featureLayer.geometryType) {
case "esriGeometryPoint":
drawToolbar.activate(esri.toolbars.Draw.POINT);
break;
case "esriGeometryPolyline":
selectedTemplate.template.drawingTool === 'esriFeatureEditToolFreehand' ? drawToolbar.activate(esri.toolbars.Draw.FREEHAND_POLYLINE) : drawToolbar.activate(esri.toolbars.Draw.POLYLINE);
break;
case "esriGeometryPolygon":
selectedTemplate.template.drawingTool === 'esriFeatureEditToolFreehand' ? drawToolbar.activate(esri.toolbars.Draw.FREEHAND_POLYGON) : drawToolbar.activate(esri.toolbars.Draw.POLYGON);
break;
}
}
});
dojo.connect(drawToolbar, "onDrawEnd", function(geometry) {
//display the editable info window for newly created features
if (map.infoWindow.isShowing) {
map.infoWindow.hide();
}
drawToolbar.deactivate();
var fieldAttributes = layerFieldToAttributes(selectedTemplate.featureLayer.fields);
var newAttributes = dojo.mixin(fieldAttributes, selectedTemplate.template.prototype.attributes);
var newGraphic = new esri.Graphic(geometry, null, newAttributes);
var layerInfos = [{
'featureLayer': selectedTemplate.featureLayer,
'isEditable': true
}];
var attInspector = new esri.dijit.AttributeInspector({
layerInfos: layerInfos
}, dojo.create("div"));
selectedTemplate.featureLayer.applyEdits([newGraphic], null, null, function() {
var screenPoint = map.toScreen(getInfoWindowPositionPoint(newGraphic));
map.infoWindow.setContent(attInspector.domNode);
map.infoWindow.resize(325, 185);
map.infoWindow.show(screenPoint, map.getInfoWindowAnchor(screenPoint));
templatePicker.clearSelection();
});
dojo.connect(attInspector, "onAttributeChange", function(feature, fieldName, newFieldValue) {
feature.attributes[fieldName] = newFieldValue;
feature.getLayer().applyEdits(null, [feature], null);
});
dojo.connect(attInspector, "onDelete", function(feature) {
feature.getLayer().applyEdits(null, null, [feature]);
map.infoWindow.hide();
});
});
}
function getInfoWindowPositionPoint(feature) {
var point;
switch (feature.getLayer().geometryType) {
case "esriGeometryPoint":
point = feature.geometry;
break;
case "esriGeometryPolyline":
var pathLength = feature.geometry.paths[0].length;
point = feature.geometry.getPoint(0, Math.ceil(pathLength / 2));
break;
case "esriGeometryPolygon":
point = feature.geometry.getExtent().getCenter();
break;
}
return point;
}
function layerFieldToAttributes(fields) {
var attributes = {};
dojo.forEach(fields, function(field) {
attributes[field.name] = null;
});
return attributes;
}
... View more
05-16-2014
04:09 PM
|
0
|
0
|
198
|
POST
|
I want to use templatepicker, layerinfos, editor, and attributeInspector all together. I am trying but my map breaks. Could anyone show me an example of all this objects at work together. Simple example would be fine but including these objects. Thanks.
... View more
05-16-2014
04:03 PM
|
0
|
1
|
1134
|
POST
|
I have a feature class that I put points on the map. When I put a point on the map a info window appears to input the values. One of the fields from that info window I would like to autopopulate that information that is what I am asking. But the problem is that I have no clue how to do it. Could you help me.
... View more
05-16-2014
05:11 AM
|
0
|
0
|
1338
|
POST
|
This is exactly what I am trying to do. I am learning javascript api but I done couple of great things with it but I need help. This is my code that I am using for the map. I dont know how to implemented on my feature class I want to auto populate what ever I wanted to say. Could you please help me to add this to my feature class check out my code let me know how could I implement this. require([
"esri/map",
"esri/tasks/GeometryService",
"esri/toolbars/edit",
"esri/graphic",
"esri/Color",
"esri/dijit/HomeButton",
"esri/dijit/BasemapGallery",
"esri/dijit/LocateButton",
"esri/dijit/Geocoder",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/FeatureLayer",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/dijit/editing/Editor",
"esri/dijit/editing/TemplatePicker",
"esri/config",
"dojo/i18n!esri/nls/jsapi",
"dojo/on",
"dojo/_base/array", "dojo/parser", "dojo/keys",
"dijit/layout/BorderContainer", "dijit/layout/ContentPane",
"dojo/domReady!"
], function(
Map, GeometryService, Edit,
Graphic, Color,
HomeButton, BasemapGallery, LocateButton,
Geocoder,
ArcGISDynamicMapServiceLayer, FeatureLayer,
SimpleMarkerSymbol, SimpleLineSymbol,
Editor, TemplatePicker,
esriConfig, jsapiBundle,
on,
arrayUtils, parser, keys
) {
parser.parse();
//This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications.
esriConfig.defaults.geometryService = new GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
map = new Map("map", {
basemap: "streets",
center: [-98.185272, 26.282376],
logo: false,
sliderStyle: 'large',
zoom: 9,
});
var home = new HomeButton({
map: map
}, "HomeButton");
home.startup();
geoLocate = new LocateButton({
map: map
}, "LocateButton");
geoLocate.startup();
var geocoder = new Geocoder({
arcgisGeocoder: false,
autoComplete: true,
zoomScale:1000,
geocoders: [ {
url: "http://maps.lrgvdc911.org:6080/arcgis/rest/services/Public_Outreach/SDE_ADDRESS_POINTS_130917_Create2/GeocodeServer",
name: "LRGVDC ",
placeholder: "Locate",
outFields: "*",
singleLineFieldName: "SingleLine"
}],
map: map
}, "search");
geocoder.on('select', function (candidate) {
for(var i = 0; i< 20; i++)
{
var geom = candidate.result.feature.geometry;
var symbol = new SimpleMarkerSymbol();
symbol.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);
symbol.setColor(new Color([155, 0, 61, 0.75]));
var graphic = new Graphic(geom, symbol);
map.graphics.clear();
map.graphics.add(graphic);
}
})
geocoder.on('clear', function(){
map.graphics.clear();
})
var basemapGallery = new BasemapGallery({
showArcGISBasemaps: true,
map: map
}, "basemapGallery");
basemapGallery.startup();
basemapGallery.on("error", function(msg) {
console.log("basemap gallery error: ", msg);
});
map.on("layers-add-result", initEditor);
//add boundaries and place names
var dynamic = new ArcGISDynamicMapServiceLayer("http://maps.lrgvdc911.org:6080/arcgis/rest/services/STEAR/STEAR_DYNAMIC/MapServer");
map.addLayer(dynamic);
var events = new FeatureLayer("http://maps.lrgvdc911.org:6080/arcgis/rest/services/Public_Outreach/EVENTS/FeatureServer/0",{
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ['EVENT_NAME', 'date','address', 'psap']
});
map.addLayers([events]);
function initEditor(evt) {
var templateLayers = arrayUtils.map(evt.layers, function(result){
return result.layer;
});
var templatePicker = new TemplatePicker({
featureLayers: templateLayers,
grouping: true,
rows: "auto",
columns: 1
}, "draggable");
templatePicker.startup();
var layers = arrayUtils.map(evt.layers, function(result) {
return { featureLayer: result.layer };
});
var settings = {
map: map,
templatePicker: templatePicker,
layerInfos: layers,
toolbarVisible: true,
createOptions: {
polylineDrawTools:[ Editor.CREATE_TOOL_FREEHAND_POLYLINE ],
polygonDrawTools: [ Editor.CREATE_TOOL_FREEHAND_POLYGON,
Editor.CREATE_TOOL_CIRCLE,
Editor.CREATE_TOOL_TRIANGLE,
Editor.CREATE_TOOL_RECTANGLE
]
},
toolbarOptions: {
reshapeVisible: true
}
};
var params = {settings: settings};
var myEditor = new Editor(params,'editorDiv');
//define snapping options
var symbol = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_CROSS,
15,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([255, 0, 0, 0.5]),
5
),
null
);
map.enableSnapping({
snapPointSymbol: symbol,
tolerance: 20,
snapKey: keys.ALT
});
myEditor.startup();
}
});
... View more
05-13-2014
04:51 PM
|
0
|
0
|
1338
|
POST
|
Can you post the code so I can read what are you calling? Do you have teamviewer? You can find me in this team viewer at hchapa@lrgvdc91.org. I can help you trouble shoot download the teamviewer and create an acccount from there I can see your computer. Is free.
... View more
05-09-2014
10:39 AM
|
0
|
0
|
601
|
POST
|
I dont mean unique field like an ID reference I mean could I have a default value in a field already insert into the field. Lets say in that picture that I posted the field name is PSAP I want to be able to have a default field to say Mission. I want to be able to have that value inserted through javascript.
... View more
05-09-2014
08:58 AM
|
0
|
0
|
229
|
POST
|
I currently have a feature layer that I am editing. Dropping points and editing the information. How could I have a unique info form? Could I enssetially have a pre value let say one of the text boxes asks to input information could I have already a value displaying if so how Can I do it? Does anyone one have a code that I could use to adopt mine to work. Thanks, Please see attachment for more explanations. [ATTACH=CONFIG]33662[/ATTACH]
... View more
05-07-2014
03:27 PM
|
0
|
2
|
678
|
POST
|
I have a feature class that is a multipoint and I am trying to create a address locator of it. I am using GENERAL single field. and the field I am using is name. I only have one information as a test. I know the value that is store in the multipoint layer is 17th. It creates it but when I try it out for testing purposes it doesnt find it. It tells me that no address match. What is wrong with this picture. I also tried using our streets feature using double ranges no luck nothing is happening. What is wrong with my address locator.
... View more
05-03-2014
06:22 PM
|
0
|
1
|
291
|
Title | Kudos | Posted |
---|---|---|
2 | 04-10-2019 06:47 AM | |
1 | 04-10-2019 06:47 AM | |
1 | 10-27-2014 06:48 AM |
Online Status |
Offline
|
Date Last Visited |
07-01-2022
03:24 PM
|