Hi,
I have recently upgraded my app from Ovi Map Api to the new Nokia.map api and noticed that the zoomBar is actually being placed on the right side of the map instead of left. Is there a way to customize that?
Thanks
Printable View
Hi,
I have recently upgraded my app from Ovi Map Api to the new Nokia.map api and noticed that the zoomBar is actually being placed on the right side of the map instead of left. Is there a way to customize that?
Thanks
Currently you'll have to do this by manipulating the CSS of the appropriate DOM element.
There are two levels of control you might want to use whilst doing this. If you need absolute control, you could find the element you want to use (by using FireBug for instance). For the zoombar this is held in[B] nm_zoomWrap[/B] You could then programmatically alter the CSS style yourself
[CODE]document.getElementsByClassName("nm_zoomWrap")[0].style.top = "0"
document.getElementsByClassName("nm_zoomWrap")[0].style.left = "-1000px"
document.getElementsByClassName("nm_zoomWrap")[0].style.position = "relative"[/CODE]
The API already defines two style classes [B]nm_left[/B] and [B]nm_right[/B], so you can also shift the zoom bar through updating the style [I]class [/I]of the zoombar element.
[CODE]document.getElementsByClassName("nm_zoomWrap")[0].className = "nm_zoomWrap nm_wrap nm_left"
document.getElementsByClassName("nm_zoomWrap")[0].className = "nm_zoomWrap nm_wrap nm_right"[/CODE]
As you have noticed there are currently no methods [B]in the API itself[/B] to move the zoom bar component around. It is expected that the API will be introducing a convenience method to do this in a version in the near future.
Thank you very much. Hopefully the method will be implemented soon.
Any more news on when this might get added to the api? Also I seem to get a different zoom control in IE compared to Firefox, the IE one appears on the left and is larger, whilst in Firefox I am just getting simple + and - buttons on the right. The IE zoom bar is positioned quite far from the left edge so I would like to move it further left.
[QUOTE=islands;908707]The IE zoom bar is positioned quite far from the left edge so I would like to move it further left.[/QUOTE]
The current +/- zoom bar is displayed on the right in current browsers, but the old legacy zoom bar on the left is used by older browsers such as IE7
to maintain backward compatibility where possible. IE7 currently represents under 3% of browser usage.
To use the current zoom bar, ensure that you have the following [B]<meta>[/B] tag in the [B]<head>[/B] of your page
[CODE]<meta http-equiv="X-UA-Compatible" content="IE=7; IE=EmulateIE9"/>[/CODE]
If you have IE8 also ensure that you are not forcing the page to render as IE7 through invoking developer tools (F12) -> browser mode.
The "trick" to move the current zoom bar has been described earlier in the thread.