Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Map Component addIn that uses a marker defined in the resultset
function(){
this.markerImageGetter = "urlMarker2";
this.setAddInOptions("MarkerImage", "urlMarker2", {
iconUrlColIdx: 4 // column where the marker urls are
});
}
define([
"cdf/AddIn",
"cdf/Dashboard.Clean"
], function(AddIn, Dashboard) {
"use strict";
var custom = {
name: "urlMarker2",
label: "An alternative urlMarker addIn",
defaults: {
iconUrlColIdx: null
},
implementation: function(tgt, st, opt) {
var style = {
"icon-url": st.data[opt.iconUrlColIdx]
};
if(st.width != null) style.width = st.width;
if(st.height != null) style.height = st.height;
return style;
}
};
Dashboard.registerGlobalAddIn("NewMapComponent", "MarkerImage", new AddIn(custom));
return custom;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.