Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm using Oracle Mapviewer. I want to switch mouse pointer from default to crosshair when user enters "Interactive mode". I'm developing in GWT and tried do do something like this:

public static void setCursorCrosshair() {
    removeCursorStyles();
    getMapWidget().addStyleName("cursorCrosshair");
}

But it changes mouse pointer only in few parts of map, it looks like it omits map tiles and change cursor to crosshair on FOI's that I've added just before. How can I make it to display crosshair over the whole map?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

I've figured this out. I had to grab all children nodes of mapWidget with name "img" and having string "gettile" in "src" attribute, then change theirs style as well as in case of MapWidget. This way you can change stylesheet only for the map and map tiles and leave other images alone (such as map zoom bar, navigator, scale line, ect...).

XDOM is a class from Sencha GXT, but you can use anything other to find and iterate through nodes.

NodeList<Element> elements = XDOM.getElementById("mapViewWidget").getElementsByTagName("img");
    for (int i = 0; i < elements.getLength(); i++) {
        if (elements.getItem(i).getAttribute("src").indexOf("gettile") != -1)
            elements.getItem(i).addClassName(style);
    }
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.