POST
|
Hi all, is it possible to easily create Heat Maps in ArcGIS for JavaScript 4.5? In older versions like 3.x it was possible with the HeatMapRenderer I think. Kind Regards, Michael
... View more
12-05-2017
08:00 AM
|
0
|
1
|
441
|
POST
|
OK, that means - we need a virtual/dedicated server to configure there PHP Apache/Java ApacheTomcat/DotNet IIS - app (javascript application files) has to be executed on the same server Kind Regards, Michael
... View more
12-05-2017
07:29 AM
|
0
|
3
|
511
|
POST
|
Thank you Robert for your answer. We don't have acces to a dedicated/virtual server. We just have a ftp and a mysql database hosted on strato.de. Can we use the so called CORS on PHP (by adding " <?php header("Access-Control-Allow-Origin: *");" to the php script)? Or do we have to get a server for that? Best Regards, Leo
... View more
12-05-2017
06:31 AM
|
0
|
5
|
511
|
POST
|
Hi, i got some questions regarding the customizability of widgets. Whats the easiest way to set for example layout options. Specifically im interested in changing the printwidgets output layout. Thx for ur help, Leo.
... View more
11-14-2017
10:12 AM
|
0
|
2
|
371
|
POST
|
There is one Point feature in the layer. It was added to the layer by the push()-method. This one feature is displayed in map, so the layer can't be null (or what do you mean with "being ready"?).
... View more
11-01-2017
08:47 AM
|
0
|
1
|
1526
|
POST
|
Hi Thomas, your solution works great on the upper code snippet. I integrated your solution into my whole code and realized that it still doesn't work. I think it has something to do with the projection of my points with GeometryService and then pushing them into the layer. Can you say where the problem is? <script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/Graphic",
"esri/geometry/Point",
"esri/symbols/SimpleMarkerSymbol",
"esri/tasks/GeometryService",
"esri/tasks/support/ProjectParameters",
"esri/geometry/SpatialReference",
"esri/widgets/Compass",
"esri/widgets/BasemapGallery",
"esri/widgets/Track",
"esri/renderers/SimpleRenderer",
"esri/geometry/SpatialReference",
"esri/widgets/Search",
"esri/widgets/Expand",
"esri/widgets/LayerList",
"dojo/domReady!"
], function (Map, MapView, FeatureLayer, Graphic, Point, SimpleMarkerSymbol, GeometryService, ProjectParameters, SpatialReference, Compass, BasemapGallery, Track, SimpleRenderer, SpatialReference, Search, Expand, LayerList
) {
var geoSvc = new GeometryService({
url: 'https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer'
});
//define mapCenter (by default in admin.xml. If map should center a certain point (get zoomToObject parameter from URL), zoom to given x and y values
var mapZoom = 10;
var mapCenter = [10.734112, 48.174298];
var map = new Map({
basemap: "osm"
});
var view = new MapView({
center: mapCenter,
container: "viewDiv",
map: map,
zoom: mapZoom
});
// renderer
var sr = new SimpleRenderer({
symbol: new SimpleMarkerSymbol({
color: [226, 119, 40],
size: "15pt",
outline: { // autocasts as new SimpleLineSymbol()
color: [255, 255, 255],
width: 2
}
})
});
// create new layer, starts emtpty
var lyr = new FeatureLayer({
fields: [
{
name: "ObjectID",
alias: "ObjectID",
type: "oid"
}
],
objectIdField: "ObjectID",
geometryType: "point",
title: "Hundestation",
spatialReference: { wkid: 102100 },
source: [],
popupTemplate: {
title: "Title",
content: "Test"
},
minScale: 1000000,
maxScale: 1,
renderer: sr //custom renderer
});
lyr.createQuery = function(){
let q = lyr.__proto__.createQuery.call(lyr);
q.outFields = null;
q.where = null;
return q;
}
// bugfix for not displaying several popUpTemplates
var sizeCrownSymbol = 0;
var feature = [
new Point({
x: 4408069.551,
y: 5338730.568,
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature, lyr, "10", "Lagebeschreibung: Kroengelände", sizeCrownSymbol);
var feature = [
new Point({
x: 4408681.069,
y: 5338984.143,
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature, lyr, "11", "Lagebeschreibung: Holzheystraße", sizeCrownSymbol);
var feature = [
new Point({
x: 4408132.398,
y: 5339858.609,
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature, lyr, "12", "Lagebeschreibung: Breitlehenstraße", sizeCrownSymbol);
map.add(lyr);
// project each geomtry, then add to layer's source
function projectPoints(geoSvc, geometries, lyr, primarykey, popUpAttributes, sizeCrownSymbol){
geoSvc.project({
geometries: geometries,
outSpatialReference: SpatialReference.WebMercator
}).then(geometries => {
let features = geometries.map((geometry, idx) => {
return new Graphic({
geometry: geometry,
attributes: {
objectID: idx - 1,
sizeCrownSymbol: sizeCrownSymbol
}
});
});
features.forEach(f => lyr.source.push(f));
});
}
});
</script> Best Regards Michael
... View more
11-01-2017
07:46 AM
|
0
|
1
|
680
|
POST
|
Hello together, I tried to zoom on a layer (containing 1 single point) in my MapView and got an error in the web console: #goTo() MapView cannot be used before it is ready See a code snippet below. Where's the problem? var zoomLayer = new FeatureLayer({...});
var view = new MapView({...});
view.then(goToLayer(zoomLayer));
function goToLayer(zoomLayer) {
view.goTo(zoomLayer.graphics);
} Thank you, Best Regards Michael
... View more
11-01-2017
07:08 AM
|
0
|
6
|
4127
|
POST
|
Hi all, I am working with JavaScript 4.4. With a FeatureLayer from URL clicking on overlapping graphics, the popUpTemplate shows all popUps (1 to 4... for example). Using a FeatureLayer with client side graphics ("source: features"), the popUpTemplate shows just the information about the feature lying on the top of them. Is it a bug? You can see my code below. Compare the two layers defined in my code by commenting and uncommenting please. Best Regards, Michael require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/renderers/SimpleRenderer",
"esri/symbols/SimpleMarkerSymbol",
"esri/geometry/Point",
"dojo/domReady!"
], function(
Map, MapView, FeatureLayer, SimpleRenderer, SimpleMarkerSymbol, Point
) {
var features = [
{
geometry: new Point({
latitude: 38.726941,
longitude: -101.883768
}),
attributes: {
ObjectID: 1
}
},
{
geometry: new Point({
latitude: 38.711841,
longitude: -101.883668
}),
attributes: {
ObjectID: 2
}
},
{
geometry: new Point({
latitude: 38.781641,
longitude: -101.883968
}),
attributes: {
ObjectID: 3
}
},
{
geometry: new Point({
latitude: 38.726991,
longitude: -101.883748
}),
attributes: {
ObjectID: 4
}
}
];
var renderer = new SimpleRenderer({
symbol: new SimpleMarkerSymbol({
color: [139,69,19],
size: "15pt",
outline: { // autocasts as new SimpleLineSymbol()
color: [255, 255, 255],
width: 2
}
})
});
// var layer = new FeatureLayer({
//
// url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/US_counties_employment_2016/FeatureServer/0",
// outFields: [ "CIVLBFR_CY", "NOT_LABORFORCE_16", "COUNTY", "STATE", "POP_16UP", "UNEMPRT_CY", "UNEMP_CY", "EMP_CY" ],
// renderer: renderer,
// popupTemplate: {
// title: "Title",
// content: "Test"
// }
// });
var layer = new FeatureLayer({
fields: [
{
name: "ObjectID",
alias: "ObjectID",
type: "oid"
}
],
objectIdField: "ObjectID",
geometryType: "point",
source: features,
renderer: renderer,
popupTemplate: {
title: "Title",
content: "Test"
}
});
var map = new Map({
basemap: "gray",
layers: [ layer ]
});
var view = new MapView({
container: "viewDiv",
map: map,
center: [-101.883768, 38.726941],
zoom: 6
});
});
... View more
09-21-2017
05:57 AM
|
0
|
5
|
1208
|
POST
|
Hi, could you solve the problem? I am working with JavaScript 4.4 and have the same issue. With a FeatureLayer from URL clicking on overlapping features, the template shows all popUps (1 to 4... for example). Using a FeatureLayer with client side features, the popUp shows just the feature which lies on the top of all. Is it a bug? Best Regards, Michael
... View more
09-21-2017
04:19 AM
|
0
|
1
|
665
|
POST
|
Hi Thomas, what is happening now - when I execute my code (token from your sample), no objects are displayed in browser. When I refresh website, sometimes all objects are displayed, sometimes just a handful of objects. In your code you are using the then()-function. So what can be the problem? I think it's the GeometryService. It seems to be arbitrary hhow many objects are displayed. Is there no possibility to project whole FeatureLayers? Isn't loading each point into the project()-function very expensive? You can see my code below.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Test</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.4/esri/css/main.css">
<script src="https://js.arcgis.com/4.4/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/Graphic",
"esri/geometry/Point",
"esri/symbols/SimpleMarkerSymbol",
"esri/tasks/GeometryService",
"esri/tasks/support/ProjectParameters",
"esri/geometry/SpatialReference",
"esri/widgets/Compass",
"esri/widgets/BasemapToggle",
"esri/widgets/Track",
"esri/renderers/SimpleRenderer",
"esri/geometry/SpatialReference",
"dojo/domReady!"
], function (Map, MapView, FeatureLayer, Graphic, Point, SimpleMarkerSymbol, GeometryService, ProjectParameters, SpatialReference, Compass, BasemapToggle, Track, SimpleRenderer, SpatialReference
) {
var mapCenter = [10.734112, 48.174298];
var map = new Map({
basemap: "streets"
});
var geoSvc = new GeometryService({
url: 'https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer'
});
var view = new MapView({
center: mapCenter,
container: "viewDiv",
map: map,
zoom: 15
});
// renderer
var sr = new SimpleRenderer({
symbol: new SimpleMarkerSymbol({
style: "square",
color: "blue",
size: "8px", // pixels
outline: { // autocasts as esri/symbols/SimpleLineSymbol
color: [ 255, 255, 0 ],
width: 3 // points
}
})
});
// create new layer, starts emtpty
var lyr = new FeatureLayer({
fields: [
{
name: "ObjectID",
alias: "ObjectID",
type: "oid"
}
],
objectIdField: "ObjectID",
geometryType: "point",
spatialReference: { wkid: 102100 },
source: [],
renderer: sr //custom renderer
});
var feature = [
new Point({
x: "4408069.551",
y: "5338730.568",
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature, lyr);
var feature1 = [
new Point({
x: "4408681.069",
y: "5338984.143",
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature1, lyr);
var feature2 = [
new Point({
x: "4408132.398",
y: "5339858.609",
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature2, lyr);
var feature3 = [
new Point({
x: "4407338.453",
y: "5340594.881",
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature3, lyr);
var feature4 = [
new Point({
x: "4407532.633",
y: "5340506.362",
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature4, lyr);
var feature5 = [
new Point({
x: "4403489.605",
y: "5340682.593",
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature5, lyr);
var feature6 = [
new Point({
x: "4402731.486",
y: "5342881.800",
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature6, lyr);
var feature7 = [
new Point({
x: "4402384.333",
y: "5339734.656",
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature7, lyr);
var feature8 = [
new Point({
x: "4401578.794",
y: "5342314.299",
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature8, lyr);
var feature9 = [
new Point({
x: "4402966.449",
y: "5339372.039",
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature9, lyr);
var feature10 = [
new Point({
x: "4407610.834",
y: "5338804.822",
spatialReference: { wkid: 31468 }
})
];
projectPoints (geoSvc, feature10, lyr);
// add layer to map
map.add(lyr);
// project each geomtry, then add to layer's source
function projectPoints(geoSvc, geometries, lyr){
geoSvc.project({
geometries: geometries,
outSpatialReference: SpatialReference.WebMercator
}).then(geometries => {
let features = geometries.map((geometry, idx) => {
return new Graphic({
geometry: geometry,
attributes: {
objectID: idx - 1
}
});
});
lyr.source = lyr.source.concat(features);
});
}
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
Best Regards, Michael
... View more
09-18-2017
06:20 AM
|
0
|
1
|
1405
|
POST
|
Hi all, I have a problem with touching my points in the map. The problem occurs in all sample codes from esri I tested (for example Reference Arcade expressions in PopupTemplate | ArcGIS API for JavaScript 4.4 ). I want to open a popUp of a point object but when touching it with my finger/with a pen, the map shifts a bit. It shifts just a little bit despite concentrating on doing a "steady" touch movement. Doing 4-5 concentrated touches, the popUp opens sometimes. Working outdoor makes it additionally difficult. This problem just occurs on the Samsung Tab Active!!! On all other tested smartphones/pc with mouse there is no problem. I already searched in android settings of the device to lower touch sensitivity but found nothing. Is there any possibility to lower the touch sensitivity of the map itself?
... View more
09-17-2017
09:05 AM
|
0
|
3
|
933
|
POST
|
Thank you very much for the example code. That worked for me perfectly. To come back to the offline issue - Is there another possibility to transform/project features? The success of my application depends amongst others on the possibility to use it offline. Could I do that for example with python in background?
... View more
09-16-2017
04:29 AM
|
0
|
0
|
1405
|
POST
|
Tank you for your fast answers. @Thomas Solow, does this mean I have to outsource my javascript code from html/php file to .json and do there the projection? Could I do that also offline?
... View more
09-15-2017
07:42 AM
|
0
|
4
|
1405
|
POST
|
Hi, I want to reproject my FeatureLayer with client side Point features (wkid: 31468) into my streets basemap (default wkid: 4326). How can I do this. See me code below, there is one point in "features". There will be several thousand points in future to be displayed. var map = new Map({
basemap: "streets"
});
var view = new MapView({
center: [10.757158, 48.181567],
container: "viewDiv",
map: map,
zoom: 15
});
var features = [
{
geometry: new Point({
x: 4408681.069,
y: 5338984.143
})
}
];
var lyr = new FeatureLayer({
fields: [
{
name: "ObjectID",
alias: "ObjectID",
type: "oid"
}
],
objectIdField: "ObjectID",
geometryType: "point",
spatialReference: { wkid: 31468 },
source: features,
renderer: baumRenderer //custom renderer
});
map.add(lyr); Thank you very much for your help. Michael
... View more
09-15-2017
05:21 AM
|
0
|
7
|
2194
|
POST
|
I additionally want to show point specific attributes in that popupTemplate 🙂
... View more
08-24-2017
05:53 AM
|
0
|
0
|
673
|
Title | Kudos | Posted |
---|---|---|
1 | 03-29-2019 11:08 AM | |
1 | 04-26-2018 04:23 AM | |
1 | 04-17-2018 05:24 AM | |
1 | 07-18-2017 07:01 AM | |
2 | 07-14-2017 12:53 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|