[OpenLayers-Users] Trouble changing mouse pointer on panZoomBar
mousover
aparker1969
andrew at source3.com
Sun Feb 20 15:13:44 EST 2011
I have copied the code from
http://ariasprado.name/2010/10/17/changing-mouse-pointer-style-in-openlayers.html.
And have tried various configurations and still cannot get the cursor to
change with mouseover on panZoomBar. I have even tried changing the css
like I did for my toolbar with no success.
When moving the code around I either get a function is undefined or array is
null. The problem map is at http://saturn.nmt.edu/tests/cursor.html. A
working map without this modification is at
http://saturn.nmt.edu/tests/test.html.
Below is a portion of my code js code.
...
map1 = new OpenLayers.Map(options);
...
mapPanel = new GeoExt.MapPanel({
//border: true,
region: "center",
center: [-11337475, 4090026],
zoom: 6,
/**************** DEFINE OpenLayers MAP *************/
map: map1,
//layers: [],
tbar: [toolbarItems]
});
map1.addLayers(layers);
...
map1.addControl(new OpenLayers.Control.Scale(mapscale));
map1.addControl(new OpenLayers.Control.PanZoomBar());
/// Change Cursor THIS IS NOT WORKING
var panZoomBarDivId =
map1.getControlsByClass('OpenLayers.Control.PanZoomBar')[0].div.id;
$(panZoomBarDivId).observe('mouseover', function(event) {
document.body.style.cursor = 'default';
// If the propagation of the mouseover event is not stopped, the
// mouse pointer shape will be changed again to the value stored
// in the global variable 'mousePointerStyle'.
Event.stop(event);
});
/// End Change Cursor NOT WOKRING
...
Appreciate any help.
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Trouble-changing-mouse-pointer-on-panZoomBar-mousover-tp6046466p6046466.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list