Last active
June 29, 2017 14:20
-
-
Save carlosrusso/079a98db26394f7054bda4678f716406 to your computer and use it in GitHub Desktop.
Map Component addIn that uses a marker defined in the resultset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(){ | |
this.markerImageGetter = "urlMarker2"; | |
this.setAddInOptions("MarkerImage", "urlMarker2", { | |
iconUrlColIdx: 4 // column where the marker urls are | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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