Javascript throws errors for all G*MAP mapTypes : G_PHYSICAL_MAP is not defined
opts.mapTypes.push(G_PHYSICAL_MAP);

Line 281 and below:

// Load google map types.
if (obj.vars.baselayers.Map) {
opts.mapTypes.push(G_NORMAL_MAP);
opts.mapTypeNames.push('Map');
}
if (obj.vars.baselayers.Satellite) {
opts.mapTypes.push(G_SATELLITE_MAP);
opts.mapTypeNames.push('Satellite');
}
if (obj.vars.baselayers.Hybrid) {
opts.mapTypes.push(G_HYBRID_MAP);
opts.mapTypeNames.push('Hybrid');
}
if (obj.vars.baselayers.Physical) {
opts.mapTypes.push(G_PHYSICAL_MAP);
opts.mapTypeNames.push('Physical');
}

the file is js/gmap.js

* @file
* Drupal to Google Maps API bridge.
*/
/*global jQuery, Drupal, GLatLng, GSmallZoomControl, GLargeMapControl, GMap2 */
/*global GMapTypeControl, GSmallMapControl, G_HYBRID_MAP, G_NORMAL_MAP */
/*global G_PHYSICAL_MAP, G_SATELLITE_MAP, GHierarchicalMapTypeControl */
/*global GKeyboardHandler, GLatLngBounds, GMenuMapTypeControl, GEvent */
/*global GOverviewMapControl, GScaleControl, GUnload */ 

Drupal 7.9

Comments

Refineo’s picture

Title: Javascript error: G_*_MAP matTyes are not defined » Javascript error: G_*_MAP matTypes are not defined
Refineo’s picture

Title: Javascript error: G_*_MAP matTypes are not defined » GMap Javascript error: G_*_MAP mapTypes are not defined
Refineo’s picture

Issue summary: View changes

minor corrections

m.abdulqader’s picture

Status: Active » Fixed

Hello,
I was miss a lot of how to use JQuery in Drupal 7 and my problem solved now, I will share my solution to all.

(function($) {
  Drupal.behaviors.[BEHAVIOR-NAME] = {
    attach:function(context, settings){
	  Drupal.gmap.addHandler('gmap', function(elem) {
		var obj = this;  	
		obj.bind("init", function () {
		  var map = obj.map;
	          GEvent.addListener(map, 'click', function(overlay,point) {
		    // YOU CODE
		  });
		});	
	  });
    }
  }
})(jQuery);

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Refineo’s picture

Status: Closed (fixed) » Needs review

Is the patch #3 included in the latest dev ?

podarok’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Needs work

please, provide patch against latest dev

podarok’s picture

Issue summary: View changes

the file is js/gmap.js