POST
|
is this what you meant? i also added the requirements but the console.info\renderer returns as undefined. var serviceUrl = "https://ags.iplan.gov.il/arcgisiplan/rest/services/PlanningPublic/Xplan_2039/MapServer/1";
var layer = new ArcGISDynamicMapServiceLayer(serviceUrl);
if (featureLayer.graphics) {
layer.on('load', function(evt){
console.info(evt.target.renderer);
featureLayer.setRenderer(evt.target.renderer)
});
... View more
08-31-2020
06:17 AM
|
0
|
1
|
580
|
POST
|
Robert, the original service is not mine, its already up and working on the web with all the symbology present, there is nothing im trying to use that is not already working on the service as it is. this is the service on a webapp with the symbology working perfectly, using this supported and already published service in the code to extract renderer still results in bad partial symbology when i try and replicate it. how can i extract the already working renderer to my layer without losing the data?
... View more
08-31-2020
05:30 AM
|
0
|
3
|
580
|
POST
|
im trying to do the same with a uniqeValue renderer from a public service, and the code seems to get me the renderer and the attribute field, but on rendering i get a bad result. this is the code: var serviceUrl = "https://ags.iplan.gov.il/arcgisiplan/rest/services/PlanningPublic/Xplan_2039/MapServer/1";
var layer = new FeatureLayer(serviceUrl);
if (featureLayer.graphics) {
layer.on('load', function(evt){
console.info(evt.target.renderer);
featureLayer.setRenderer(evt.target.renderer)
});
it gets me: instead of: im trying to get why the original service im taking the renderer from has a different symbology than mine, from service: from the code:
... View more
08-31-2020
02:37 AM
|
0
|
5
|
2182
|
POST
|
Robert, does this solution works only with simple symbology? I tried this with my current code and it returned the same result i have here: renderer from an existing service fails to return the full symbology with the symbology as you can see in the pictures not fully operational when its "complicated". any ideas?
... View more
08-30-2020
12:54 AM
|
0
|
7
|
2182
|
POST
|
i want to use a renderer from an exsisting service for a feature set of the same schema(using add data widget) service link: https://ags.iplan.gov.il/arcgisiplan/rest/services/PlanningPublic/Xplan_2039/MapServer/1 i used "copy(json.stringify(layer.renderer.toJSON())" in console to get the renderer* deleting the delimiter attribute that prevented me from seeing the symbology. now i get the layer but with only partial symbology: *I tried getting the renderer with copy(layer.renderer) but it didnt work when i set it. the symbology is hardcoded in my code,and now that i have the json i dont request the original service. is that the reason? is there a better way to get OGlayer.renderer set as newLayer.renderer? code: https://codepen.io/segev-salman/pen/bGpERqG only additions to the base code is the renderer and the setrenderer plus the requiring of them.
... View more
08-13-2020
02:18 AM
|
0
|
0
|
440
|
POST
|
so here some of the answers to my questions; instead of copying it with 'copy(layer.renderer)' i used copy(json.stringify(layer.renderer.toJSON()) do i need to delete something from the renderer? the object has a delimeter attribute that should be deleted. cycle through like a graphic layer symbology? no, at least i don't think so setting the renderer worked for changing the symbology when getting the graphics. now the problem is the symbology, the add data layer is losing some of the not simple symbols:
... View more
08-13-2020
01:46 AM
|
0
|
0
|
782
|
POST
|
good catch, the renderer from the original layer seems to be a uniquevalue, with the value field already inside. adding it to the function undid the error but the layer is still 'invisble'*. asking for a console.log of the featureLayer renderer after setting it returns a renderer object with undefined in every field. do i need to delete something from the renderer or cycle through like a graphic layer symbology? does a 'raw' renderer object from a layer needs to be changed before being set? in the sample they made the renderer from scratch but i seem to have everything inside the object. *the add data widget as shp works and i can highlight the polygons through the table attrubute table they just have no symbology now. full file V2 as txt: https://codepen.io/segev-salman/pen/gOrayBR?editors=1000
... View more
08-12-2020
04:55 AM
|
0
|
1
|
782
|
POST
|
Im creating a widget to upload a specific shp file. using the add data widget with only the 'file' enabled. I have added a renderer to the code from the output of a service of the same layer extracting it using layer.renderer, i get the error "getFieldsUsedInExpressions is not a function". this is the code from AddFromFilePane file inside /search of add data widget added line 15 end the renderer _addFeatures: function(job,featureCollection) {
//var triggerError = null; triggerError.length;
var fullExtent, layers = [], map = job.map, nLayers = 0;
var loader = new LayerLoader();
if (featureCollection.layers) {
nLayers = featureCollection.layers.length;
}
array.forEach(featureCollection.layers,function(layer) {
var featureLayer = new FeatureLayer(layer, {
id: loader._generateLayerId(),
outFields: ["*"]
});
featureLayer.xtnAddData = true;
if (featureLayer.graphics) {
featureLayer.renderer = {
"_cache": {
"rotationInfo": null,
"colorInfo": null,
"opacityInfo": null,
*only the start of the renderer for comfort full file as txt: https://codepen.io/segev-salman/pen/NWNGpOz?editors=1000
... View more
08-11-2020
05:48 AM
|
0
|
3
|
869
|
POST
|
I am trying to build an app that when gets a point(for now by click), adds all intersecting items from other layers in a 1 KM radius to the map(via graphic layer). Attached is an example I made with only 2 layers. I don't want the layers to appear on the map in the final version(only added them to make sure it works smoothly) because ill have 7 or 8 of them. In the example I am creating a query and querying each layer individually. it works but in my final version with all the layers and symbols I don't think its the right way to do it. Is it possible to query all/multipe layers at the same time? In this example the graphic layer returns default geometry. In the final version I want to keep the original symbols when adding the featureSets to the graphic layer. Is it possible to keep them while querying or do I have to set the symbols upfront and iterate through the features adding them one by one? CODE: https://codepen.io/segev-salman/pen/WNrRLLJ?editors=1000
... View more
06-20-2020
08:48 AM
|
0
|
0
|
346
|
POST
|
This is exactly right, I should have clarified that the layer is just a filler. The real layer has building groups as id (the input) and i want the avg of their price. I dont expect outStatistics to return geometry, and wrote the right query(using ObjectID just as a filler expecting to get the same result entered as avg) but in the same query i ask for geometry and outfields. dont i get them all as part of the featureSet? can it look like this? var avgPricePerMeter = {
onStatisticField: "PricePerMeter", // field that has price information?
outStatisticFieldName: "PricePerMeter_avg",
statisticType: "avg"
};
var query = pointService.createQuery();
query.returnGeometry = true;
query.outFields = ["*"];
query.where = gushHelka + " = " + input
query.outStatistics = [avgPricePerMeter]
giving me the geometry stats and fields all of them essential to my popupTempalte at the same time I made this new pen : https://codepen.io/segev-salman/pen/YzPPPNo Assuming i cant get it all in the same query i made nquey just for the statistics and featureUpdate as a function that builds a new popuptemplate with the basic fields and the stats using only the featureSet from the nquery, problem was that i got the avg stat but not the name or objectid even tho i had the outfields inside nquery too. I scraped it after timing issues getting the avg after the template was already made and thinking about making a promise that waits for the stats and then makes the layer. This has got to be the wrong way to go about it right? I already have a query with the right results do i need to make the same one from 0 and wait for then again just to avg a field? *sorry for the formatting im using a phone
... View more
12-03-2019
11:06 AM
|
0
|
1
|
1034
|
POST
|
So i have a working query that returns a featureSet that is made into a layer. I want to add some stats about the query and add them to a feature. i added a simple statistic query that works but when its time to create a new layer after the query is returned i get : name: "feature-layer:missing-property", message: "geometryType not set and couldn't be inferred from the provided features" this error is automaticly fixed when i cross the query.outStatistics line from my query. do i really need to create two identical querys for stats and for visual display? heres a pen with the query.outStatistics crossed out: https://codepen.io/segev-salman/pen/OJPJGxX
... View more
12-03-2019
12:44 AM
|
0
|
3
|
1318
|
POST
|
thank you! the new layer was a bad call on my parts o Im trying to call queryFeatures and zoom on the pointservice without creating a new featurelayer. I am not entirely sure how to do it, I transfered the popup to the pointservice featurelayer, and now trying to applyedits to .the layer heres the edited pen if you can take a look : https://codepen.io/segev-salman/pen/povoyoQ?editors=1010 thank you again!
... View more
12-02-2019
12:44 AM
|
0
|
1
|
763
|
POST
|
this is the sample I am working on https://codepen.io/segev-salman/pen/xxxjpaX?editors=1000 this demo finds a feature by input id creates a new layer with only that feature and zooms in on it. i want to add a popup with the features details(i want them all but I am using 2 for the demo). when creating the feature set I am using outFields = ["*"] to get all the fields for use in the popup but I am failing on the part of inserting them into the layer and maybe to the popup graphic.
... View more
11-20-2019
01:52 PM
|
0
|
3
|
944
|
POST
|
and is it possible to access them through the "map. ..." function. I have widgets/gp that create temporary layers and adds them to the webmap for viewing and analysys by other widgets. The gp services can access the temporary layers just fine with the input option but for a widget Im making I want to be able to get the layer just like a service(in json). I used the "myMap._layers.mylayer._json" but my widget requires a GPFeatureRecoredSetLayer or GpRecoredSet datatype . Using the getLayer function I seem to get the data I want. For example, for GpRecoredSet fields and features(inside graphics.attributes) i can sort of builed the JSON but is there an easier way to get it?
... View more
09-04-2019
04:48 AM
|
0
|
0
|
234
|
POST
|
I want to return the query result inside the popup. I thought LayerView is the way to loop through features in your layer. querying the points inside the polygon geometry seems like a much better way, thank you for that.
... View more
06-15-2019
11:18 PM
|
0
|
1
|
1538
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|