POST
|
but i m using the same feature layer in both. 1. Add the url in feature layer and add the layer in the map. 2. add the same feature layer in search widget sources.
... View more
06-08-2016
11:38 PM
|
0
|
1
|
391
|
POST
|
feeling that the search widget is pointing to some other points and the feature layer is pointing to some other point for the same. How we can sync both so that they will point to the same.
... View more
06-08-2016
11:35 PM
|
0
|
0
|
391
|
POST
|
this is the result when we search anything using search widget(using the same feature layer) and again click on same point. this is the result when we click on feature layer.
... View more
06-08-2016
10:59 PM
|
0
|
0
|
391
|
POST
|
Javascript API 4.0 I am wondering that why i am not able to get layer from graphic object when i clicked on searched item using search widget. Here are the scenario. 1. Create Map, View and add a feature layer 2. Add on click event in view and implement some features on click event 2. Create search widget assign view in constructor. 3.Push sources i.e. sources.push( assign feature later with popup template and other features) 4. Add search widget and startup. 5. Search Something, Search widget searched and zoom to that point. Now when we click on same searched point then in response of view click event we are not getting the graphic.layer info, whereas when we click on other point of feature layer then we gets graphic.layer object. But not getting the same object when we clicked on searched point. view.on("click", function (event) { //debugger; // get the returned screenPoint and use it // with hitTest to find if any graphics were clicked // (using promise chaining for cleaner code and error handling) view.hitTest(event.screenPoint).then(function (response) { // we're only interested in the first result var result = response.results[0]; if (result && result.graphic) { return result.graphic; } }).then(function (graphic) { var layer = graphic.layer; in above code , var layer = graphic.layer; we are not getting graphic.layer; info when we click on search item searched by search widget, but when we click on other feature on feature layer then we gets graphic.layer info. Is there any clue on this ? I am doing normal things like /*** Initalize Map ***/ map = new Map(); /*** Initalize MapView ***/ view = new MapView({ container: "map", map: map, constraints: { minZoom: 2, maxZoom: 11 } }); //Add Search Widget var searchWidget = new Search({ view: view }); var sources = searchWidget.get("sources"); sources.push({ featureLayer: new FeatureLayer({ url: lyr.url , popupTemplate: lyr.popupTemplate , opacity: lyr.opacity , outFields: ["*"] }), searchFields: ["somefield"], displayField: "somefiled", exactMatch: true/false, outFields: ["*"], name: "somestring", placeholder: "somestring", maxResults: 8, maxSuggestions: 6, popupEnabled: true, popupOpenOnSelect: true, minSuggestCharacters: 0 }); something like that...
... View more
06-08-2016
10:39 PM
|
0
|
4
|
2542
|
POST
|
Thanks for the solution. (Heirchical level is solved by your response but search issue is still remains) But the issue remains the same, when i tried to push a source then it won't search on pushed source. and when i assign the same code in the constructor of search() widget then it searches perfectly. I think i am lacking somewhere, let me check once again. or if you have any other clue on that ?
... View more
05-23-2016
05:19 AM
|
0
|
1
|
648
|
POST
|
if the heirchical level is correct then why i m not able to search on added (pushed) sources, whereas when i add the same source at the constructor level of Search() widget then it works perfectly.
... View more
05-23-2016
05:02 AM
|
0
|
0
|
648
|
POST
|
05-23-2016
04:51 AM
|
0
|
0
|
648
|
POST
|
Hi, Just would like to confirm that, the search widget is pushing search layer at right level or not ? because when i try to push a source then it gets added in wrong heirchical level. var sources = [ { declare only one source } ] // Add to source(s) var searchWidget = new Search(); searchWidget.sources.push(sources); //new source searchWidget.startup(); Then it shows heirchy like items [0] [1] [0] and here is my source (underneath of [1][0]) I believe my source should be at [1] level of heirchy. Please correct me if i am missing anything.
... View more
05-23-2016
04:49 AM
|
0
|
7
|
2784
|
POST
|
I am trying to customized the zoom widget, i.e. i have created my own zoom in/out template, and now i want to invoke the zooming functionalities, but when i looked into the codes for zoom widget(zoom.js) the code is refererring this.viewModel.zoomOut();, so just would like to know that, from where it will get the reference of this.viewModel , i didnot find anywhere, in my case it comes as "undefined". any clue/pointer on this.
... View more
05-13-2016
05:24 AM
|
0
|
1
|
1350
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|