Is it possble to customize the look and feel of the standard zoom, pan, and layer adornment layers?
Is there an Style api that addresses these items, or can the specific adornment layer be customized or subclassed directly?
Customization of standard adornment layers
Hi Jeremy,
Technically, we can customizing them but with a bit complex. For the adornment layers, we just need to inherit an adornment layer and then override the DrawCore method in the server side, but for the PanZoomBar, since it builds based on OpenLayers, we need to override them in the client side. In my opinions, the latter is much complex.
Also, if you can provide more details about how to customize them, that would be helpful for us to evaluate.
Regards,
Johnny
Hi Johnny -
Are there any examples of customizing and overriding the adornment layers in the samples?
In the Pan Control, I want to replace the images used by the North/South/East/West button, and conditionally control whether the element in the center of the buttons is displayed.
In the zoom control, I want to replace the ZoomIn/ZoomOut button, the track style, and the style of the thumb on the image.
For the other adornment controls like the Layers and Minimap, I would like the ability control the display and placement of the minimize button, and the display of the button when the adornment layer is hidden.
Jeremy
Hi Jeremy,
For the custom adornment layers, please refer to the sample wiki.thinkgeo.com/wiki/Map_S…_Scale_Bar
For the PanZoomControl, I think you just need to replace the related images in folder “Content\theme\default\img”.
As for the MiniMap, I guess you can change the placement by its Div element whose ID named “overviewMap”. More details please refer to dev.openlayers.org/releases/…ap-js.html
We can get the openlayers map instance by:
<
script
type
=
“text/javascript”
>
OnMapCreated = function (map) {
var openlayerMap = map;
}
</
script
>
Any questions please feel free to let us know.
Regards,
Johnny
Thanks Johnny - these comments are helpful getting me pointed in the right direction.
Could you tell me where the list of hooks like OnMapCreated are located in the documentation?
Thanks.
Jeremy
Hi Jeremy,
Good to hear it’s helpful for you.
For the MVC Client Api, we can find from download.thinkgeo.com/docs/mvc/clientapi/.
For the OnMapCreated method,it seems it is forgotten, but still can find it in WebEdition client Api documentation. thinkgeo.com/forums/MapSuite/tabid/143/aft/5616/Default.aspx#OnMapCreated
Hope it helps.
Regards,
Johnny