npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

arcgis-server-store

v1.1.1

Published

An implementation of the dojo/store API for ArcGIS Server REST services

Downloads

9

Readme

#arcgis-server-store

An implementation of the dojo/store API for ArcGIS Server REST services.

Features

  • Add, delete, update and query feature services.
  • Easily integrates with store-backed components, such as dgrid and FilteringSelect.

Usage

Install

Download, clone, or fork from GitHub, or install using a package manager.

Bower:

bower install --save arcgis-server-store

NPM:

npm install --save arcgis-server-store

Setup

Configure the Dojo loader for use with the ArcGISServerStore.

var dojoConfig = {
	packages: [{
		name: 'ArcGISServerStore',
		location: 'path/to/store',
		main: 'ArcGISServerStore'
	}]
};

See the Configuring Dojo with dojoConfig tutorial for more details on configuring the AMD loader.

Create a Store

Create a store using an ArcGIS REST service. See the properties section for more details on the available options.

require([
	'ArcGISServerStore'
], function(
	ArcGISServerStore
) {
	var url = 'http://example.com/path/to/service/FeatureServer/0';

	var store = new ArcGISServerStore({
		url: url,
		idProperty: 'OBJECTID',
		flatten: true,
		outFields: ['NAME', 'CATEGORY'],
		returnGeometry: false
	});
});

Use a Cache Store as needed to improve performance:

var memStore = new Memory();
var cachedStore = new Cache(store, memStore);

Use the store

Use it in a dijit:

var filteringSelect = new FilteringSelect({
	store: store,
	searchAttr: 'NAME'
});

or to manage data:

// Add an object
store.add({NAME: 'New', CATEGORY: 'Sample Data'});

// Retrieve an object
store.get(1);

// Update an object
store.put({OBJECTID: 1, NAME: 'Edited'});

// Query for objects
store.query({NAME: 'Edited'});

var q = new Query();
q.where = 'OBJECTID < 4';
store.query(q);

// Remove an object
store.remove(1);

// Batch updates
var trans = store.transaction();
store.add({NAME: 'New', CATEGORY: 'Sample Transaction'});
store.put({OBJECTID: 2, NAME: 'Edited', CATEGORY: 'Transaction'});
trans.commit();

Refer to the ArcGISServerStore documentation for more information.

Reporting Issues

Find a bug or want to suggest an improvement? Please submit an issue.

Contributing

Your contributions are welcome!

Although there is no formal styleguide, please be careful to match the existing style. Please include unit tests with any changed or new functionality, and use grunt to lint your code.

To contribute:

  1. Fork the repository on GitHub
  2. Commit changes to a branch in your fork
  3. Merge the latest from "upstream"
  4. Pull request "upstream" with your changes

Testing

Testing is done in the browser with Intern.

Setting Up

  1. Run npm install to install local dependencies.
  2. Run grunt setup to download the ArcGIS API for JavaScript libraries.

Note: Commands listed in this section are all written assuming they are run inside the repositories root directory.

Running via the browser

  1. Open a browser to http://hostname/path_to_repository/tests/runIntern.html
  2. View the console

License

This project is available under the MIT License.