Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load a map showing only Features that meets a specified Criteria #12

Open
superbrains opened this issue Aug 31, 2018 · 5 comments
Open
Assignees

Comments

@superbrains
Copy link

How do I load a map service with only specific features. Assuming I want to Load the Water Network Service Where Facility Identifier = 44750. That is, I want the map to show Only Facilities that has the ID of 44750, How do I achieve this?

@hnasr hnasr self-assigned this Sep 3, 2018
@superbrains
Copy link
Author

Thanks for your concern. Assuming I have a Service that Shows all assets (Oil Facilities) of a country and want to build a map application, such that each state in the country can Login and View ONLY the assets belonging to them at Logon/Load of the main interface(Map). It will be a very useful enhancement/ad-don. I'm building an application with your tool, I will share the screen/Application as soon as I'm done with phase 1. You are so so Generous to share this awesome tool. Thanks

@hnasr
Copy link
Owner

hnasr commented Sep 4, 2018

Glad your enjoying the content!

We will try to this, its tricky to build this in a generic abstract way...

meanwhile take a look this code, definitionExpression is what you want

var layer = new MapImageLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer",
sublayers: [
{
id: 3,
visible: false
}, {
id: 2,
visible: true
}, {
id: 1,
visible: true
}, {
id: 0,
visible: true,
definitionExpression: "pop2000 > 100000"
}
]
});

@superbrains
Copy link
Author

superbrains commented Sep 4, 2018 via email

@superbrains
Copy link
Author

superbrains commented Sep 5, 2018

This is perfect Hussein. It's been applied and working accordingly.

@hnasr
Copy link
Owner

hnasr commented Sep 7, 2018

@superbrains glad that worked for you! would be nice to make it as a bonus episode :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants