Skip to content

brandoncopeland/knockout-esri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knockout ESRI Bindings

Custom knockout.js bindings for ESRI Javascript API widgets (currently just the map widget).

Usage

<div id="map" data-bind="esriMap: { mapObject: mapWidget, isLoaded: isMapLoaded,
	extent: currentMapExtent, layers: mapLayers, onClick: doSomething }"></div>
 
<script type="text/javascript">
    var viewModel = {
    	mapWidget: ko.observable(),
    	isMapLoaded: ko.observable(),
    	currentMapExtent: ko.observable(),
    	mapLayers: ko.observableArray([]),
    	doSomething: function () {
    		alert('i did it');
    	}
    };
</script>

Parameters

Parameters are all optional.

mapObject: esri.Map, ESRI map widget

isLoaded: boolean, true if map has successfully loaded with at least 1 layer

extent: esri.geometry.Extent, current map extent (intended for reading only)

layers: array of esri.layers.Layer, current map layers, push to array to add layers to the map

onClick: command to fire on map click, args are identical to esri.map onClick event

Requirements

About

knockout.js custom bindings for ESRI Javascript API widgets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published