We help IT Professionals succeed at work.
Get Started

changing cursor ( mouse pointer ) on Marker in Google Maps

sigmatec_pk asked
Last Modified: 2012-05-09

I have an application where I show custom Markers on google Map. By default google shows Hand sign cursor in markers. How can I change this to some other cursor?
Here is my JS code

<script language="javascript">

	var gmarkers = [];

	var point = new GLatLng(74,31);	
	var marker = createMarker(point,1);	
	var map;
	function showmap(lat,long)
			// create the map
			if (GBrowserIsCompatible()) {
				map = new GMap2(document.getElementById("map"));
				//map.addControl(new GLargeMapControl());
				//map.addControl(new GSmallMapControl());
				//map.addControl(new GMapTypeControl());
				map.addControl(new GLargeMapControl3D());
				map.setCenter(new GLatLng(lat,long), 15);
				// Add GHierarchicalMapTypeControl
				var hControl = new GHierarchicalMapTypeControl();
				hControl.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", false);
	onresize = function()
	// this variable will collect the html which will eventually be placed in the side_bar
	function createMarker(point,i,html, bullet) {
		// Create our "tiny" marker icon
		var Icon = new GIcon(G_DEFAULT_ICON);
		Icon.image = "<?php echo TEMPLATE_PATH; ?>/images/alphabets/a.png";
		// Set up our GMarkerOptions object
		markerOptions = { icon:Icon };
		var marker = new GMarker(point,markerOptions);
		// save the info we need to use later for the side_bar
		gmarkers[0]= marker;
		// add a line to the side_bar html
		var mark = (gmarkers.length-1);
		return marker;


Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE