I know there a fixed position for the zoomControl, but they are not enough for where I need to put it.
Can I style it with CSS? Such as top:80px; right:20px;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you can do it with jQuery. If you see the HTML source for the map generated, it can be observed that the various controls the map provides don’t have a ID attribute to manipulate them. However we can use the title attribute of each element to modify them as per our need. See this solution where in a click on the map div adds a
top:50pxto the bar in zoom control –**DEMO
jQuery-
Similarly you can capture other controls in the map and add css to them as per your need.
One point to note here is that you can’t us the
$(document).ready()to change the css on page load since the map actually takes time to load and by then the zoom bar isn’t in theDOM. So I used a mapclickevent to add the css. You can use other events to manipulate the css of the zoom control or other controls.