POST
|
I finally solved it by myself using dojo/request. Nice and easy to work with it, almost as much as with jQuery. Thanks anyway.
... View more
03-10-2017
04:42 AM
|
0
|
0
|
391
|
POST
|
Hello. Do you have any idea how to display data from local database in the popup? I'm using some FeatureLayer and PopupTemplate from ArcGIS examples and that displays only data stored on arcgis server. I figured out how to get the ObjectID from the 'clicked' area. So now when I sync this ID with some ID on my database, I'd like to show some additional info in the popup. Ajax might work for this, but I'm not sure how to use it within dojo. So the whole process should be like this: Click the area of FeatureLayer -> get the OBJECTID, for example 450 -> search for an object (row) in Class (table) where its ID equals 450 and return some data stored in the local database -> show these data in the popup. Even though it's not a common task as I can see, I think it would be very useful as you don't have to be directly limited with that only data from geo table on ArcGIS server. I'm just looking for some fresh ideas from more esri-friendly developers, how to get this feature work. Thanks in advance.
... View more
03-10-2017
12:26 AM
|
0
|
2
|
832
|
POST
|
I was facing similiar problem. I used the code from the example and it didn't work. The problem was that when view.on("click", function(evt){...}) was fired, it was trying to store properties x and y of object env into variable screenPoint. But there were no properties like this, so the x, y in screenPoint was 'undefined'. But object env has a whole property screenPoint, which already holds the x, y values. So if you keep getting returned empty results, try to check if the properties are in the object. If not, then you can easily replace this: var screenPoint = {
x: evt.x,
y: evt.y
}; with this: var screenPoint = evt.screenPoint;
... View more
02-26-2017
01:44 PM
|
1
|
1
|
963
|
POST
|
Hey. I'm working on a web application for displaying invasive plants on map and I'm trying to work with ArcGIS API for JavaScript 4 and I need a help about displaying data stored in my local database into popup using popupTemplate. Example is HERE. Basically I want to reproduce something very similiar to this. But the data that are being displayed on that example are stored in a table on ArcGIS server and are connected to the layer and objects in it, if I understand right. So the "print" into the popup is quite easy using brackets { } and attribute name. But what if want to display additional data, which I don't have or I don't want to have on ArcGIS server with the layout, but I have them stored in my local MySQL database? I was trying to do something on event 'click'. But how can I get the {ObjectID} or something that I can take and find a match in my database? I was thinking about a solution, that I would get the ObjectID which relates to the position where I clicked, send it through ajax to a controller, which would find the matched row and send result back so it could be displayed. But that means that on every click there would be an ajax call. But I can't figure out how to get it work. There're some ajax calls only when the map and the layer are rendered. All the data from table are loaded when the map is initializing. That means that when I click on some object in the layer, no ajax calls is being processed, just the popup shows but the data are already here for every object. So I don't know how to get the {ObjectID} that I have clicked on. As you know, in the template it's pretty easy to print some attribute just using this syntax - {ObjectID}. But how to get it outside the template, I mean, how to get the ObjectID on click so I can store it in a var and send it to controller to handle it. Then I think it's possible to print out additional data about the plants - like description, dimensions, url to its profile, etc. from my own database in the popup, which will be related to the object I clicked. I hope you understand, if not I will try to clarify it again. And of course, if you have any other idea how to do something like this or have your own solution or suggestion how this could be done, feel free to comment. I would be glad. Thank you very much.
... View more
02-07-2017
07:08 AM
|
0
|
0
|
689
|
Title | Kudos | Posted |
---|---|---|
1 | 02-26-2017 01:44 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|