| | | | Browse by category |
Question
How to force Map Builder to support relative path for the points image source property?
Answer
In its default version, the Map Builder will save an absolute path for the
image source property in ivl files.To override this, the default editor for the
image source property must be replaced with custom file editor or a simple
string editor.
Add the following static block in the Map Builder to replace the default editor
with the undocumented ilog.views.util.beans.editor.IlvStringEditor
:
static {
try {
IlvMapStyleBeanInfo.setAdvancedMode(true);
BeanInfo info = Introspector.getBeanInfo( IlvPointStyle.class );
for (PropertyDescriptor pd : info.getPropertyDescriptors() ) {
if( pd.getName().equals("imageSource") ){
pd.setPropertyEditorClass(IlvStringEditor.class);
}
}
IlvMapStyleBeanInfo.setAdvancedMode(false);
} catch (IntrospectionException e) {
e.printStackTrace();
}
}
Note: Starting in JViews Maps 8.7, IlvStringEditor
has been deprecated and should be replaced with ilog.views.util.beans.editor.IlvStringEditorWithNull.NoNull
class.