• Hi there,
    I really like the functions of this plugin and would love to use it as a store locator for our fashion brand. It works with the default template of wordpress, but not with the custom template that I bought. I think its a clash of JQuery Javascript, but as I am no programmer I cannot really say.. the themplate programmer will not help, so I am stuck here… please take a look at my website here.. there is some fancy padding boxes, the second marker does not show up and the map itself is not displayed correctly… any help would be great!
    http://www.urbangorilla.net/store-finder/

    http://wordpress.org/extend/plugins/basic-google-maps-placemarks/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ian Dunn

    (@iandunn)

    DK is already loading an instance of the Google Maps API, which is probably what’s causing the problem. You can only have one instance of the API per page. Check if there’s an option to disable it, and if not, just rename the gmap.js file in the /wp-content/themes/dk/js/ directory to _gmap.js.

    Thread Starter Thorworx

    (@thorworx)

    THX, I tried that but nothing changed at all.. tried with several browsers as well.. always the same 3 problems from above… any other suggestions?

    Plugin Author Ian Dunn

    (@iandunn)

    Try renaming the entire ‘js’ directory to ‘_js’. That will prevent all of the theme’s JavaScript from loading. If it works then we’ll know that one of the JavaScript files it causing the problem. Then you can rename each file individually until you narrow it down to a specific file.

    Thread Starter Thorworx

    (@thorworx)

    The whole template works on JQuery, as basically this is just a single huge slideshow… so it just killed the whole site and I could not check anything at all… any other suggestions?

    Although I did not see any Google Maps support at all, here is the code from that gmap.js theme file:

    */
    (function($){$.fn.gMap=function(options){var opts=$.extend({},$.fn.gMap.defaults,options);return this.each(function(){var googlemaps=google.maps;var $this=$(this);var LatLng=new googlemaps.LatLng(opts.latitude,opts.longitude);var mapOptions={zoom:opts.zoom,center:LatLng,mapTypeControl:opts.mapTypeControl,zoomControl:opts.zoomControl,panControl:opts.panControl,scaleControl:opts.scaleControl,streetViewControl:opts.streetViewControl,mapTypeId:opts.maptype,scrollwheel:opts.scrollwheel};var $gmap=new googlemaps.Map(this,mapOptions);$this.data(“$gmap”,$gmap);var $geocoder=new googlemaps.Geocoder();if(opts.address){$geocoder.geocode({address:opts.address},function(result,status){if(status==google.maps.GeocoderStatus.OK){$gmap.setCenter(result[0].geometry.location);}else{if(opts.log)console.log(“Geocode was not successful for the following reason: “+status);}});$gmap.setZoom(opts.zoom);}
    else{if(opts.latitude&&opts.longitude){$gmap.setCenter(new googlemaps.LatLng(opts.latitude,opts.longitude),opts.zoom);}
    else{if($.isArray(opts.markers)&&opts.markers.length>0){if(opts.markers[0].address){$geocoder.geocode({address:opts.markers[0].address},function(result,status){if(status==google.maps.GeocoderStatus.OK){$gmap.setCenter(result[0].geometry.location);}else{if(opts.log)console.log(“Geocode was not successful for the following reason: “+status);}});}
    else{$gmap.setCenter(new googlemaps.LatLng(opts.markers[0].latitude,opts.markers[0].longitude));$gmap.setZoom(opts.zoom);}}
    else{$gmap.setCenter(new googlemaps.LatLng(opts.latitude,opts.longitude));$gmap.setZoom(opts.zoom);}}}
    if(opts.controls.length!=0){for(var i=0;i<opts.controls.length;i++){map.controls[opts.controls[i].pos].push(opts.controls[i].div);}}
    for(var j in opts.markers){var marker=opts.markers[j];if(opts.log)console.log(“putting marker no “+j+” at “+marker.latitude+’, ‘+marker.longitude+” with address “+marker.address+” and html “+marker.html);var _gicon={};_gicon.image=opts.icon.image;_gicon.iconSize=($.isArray(opts.icon.iconsize))?new googlemaps.Size(opts.icon.iconsize[0],opts.icon.iconsize[1]):opts.icon.iconsize;_gicon.iconAnchor=($.isArray(opts.icon.iconanchor))?new googlemaps.Point(opts.icon.iconanchor[0],opts.icon.iconanchor[1]):opts.icon.iconanchor;_gicon.infoWindowAnchor=($.isArray(opts.icon.infowindowanchor))?new googlemaps.Size(opts.icon.infowindowanchor[0],opts.icon.infowindowanchor[1]):opts.icon.infowindowanchor;var _gshadow={};_gshadow.shadow=opts.icon.shadow;_gshadow.shadowSize=($.isArray(opts.icon.shadowsize))?new googlemaps.Size(opts.icon.shadowsize[0],opts.icon.shadowsize[1]):opts.icon.shadowsize;if(marker.icon){_gicon.image=marker.icon.image;_gicon.iconSize=($.isArray(marker.icon.iconsize))?new googlemaps.Size(marker.icon.iconsize[0],marker.icon.iconsize[1]):marker.icon.iconsize;_gicon.iconAnchor=($.isArray(marker.icon.iconanchor))?new googlemaps.Point(marker.icon.iconanchor[0],marker.icon.iconanchor[1]):marker.icon.iconanchor;_gicon.infoWindowAnchor=($.isArray(marker.icon.infowindowanchor))?new googlemaps.Size(marker.icon.infowindowanchor[0],marker.icon.infowindowanchor[1]):marker.icon.infowindowanchor;_gshadow.shadow=marker.icon.shadow;_gshadow.shadowSize=($.isArray(marker.icon.shadowsize))?new googlemaps.Size(marker.icon.shadowsize[0],marker.icon.shadowsize[1]):marker.icon.shadowsize;}
    var gicon=new googlemaps.MarkerImage(_gicon.image,_gicon.iconSize,null,_gicon.iconAnchor);var gshadow=new googlemaps.MarkerImage(_gshadow.image,_gshadow.iconSize,null,_gicon.iconAnchor);if(marker.address){if(marker.html==’_address’){marker.html=marker.address;}
    if(opts.log)console.log(‘geocoding marker: ‘+marker.address);(function(marker,gicon,gshadow){$geocoder.geocode({‘address’:marker.address},function(results,status){if(status==google.maps.GeocoderStatus.OK){var gmarker=new googlemaps.Marker({position:results[0].geometry.location,icon:gicon,title:marker.html,map:$gmap});var infowindow;if(marker.html){var infoOpts={content:opts.html_prepend+marker.html+opts.html_append,pixelOffset:_gicon.infoWindowAnchor};if(opts.log)console.log(‘setup popup with data’);if(opts.log)console.log(infoOpts);infowindow=new googlemaps.InfoWindow(infoOpts);googlemaps.event.addListener(gmarker,’click’,function(){if(opts.log)console.log(‘opening popup ‘+marker.html);infowindow.open($gmap,gmarker);});}
    if(marker.html&&marker.popup){if(opts.log)console.log(‘opening popup ‘+marker.html);infowindow.open($gmap,gmarker);}}else{if(opts.log)console.log(“Geocode was not successful for the following reason: “+status);}});})(marker,gicon,gshadow);}
    else{(function(marker,gicon,gshadow){if(marker.html==’_latlng’){marker.html=marker.latitude+’, ‘+marker.longitude;}
    var gpoint=new googlemaps.LatLng(marker.latitude,marker.longitude);var gmarker=new googlemaps.Marker({position:gpoint,icon:gicon,title:marker.html,map:$gmap});var infowindow;if(marker.html){var infoOpts={content:opts.html_prepend+marker.html+opts.html_append,pixelOffset:_gicon.infoWindowAnchor};infowindow=new googlemaps.InfoWindow(infoOpts);googlemaps.event.addListener(gmarker,’click’,function(){if(opts.log)console.log(‘opening popup ‘+marker.html);infowindow.open($gmap,gmarker);});}
    if(marker.html&&marker.popup){if(opts.log)console.log(‘opening popup ‘+marker.html);infowindow.open($gmap,gmarker);}})(marker,gicon,gshadow);}}});}
    $.fn.gMap.defaults={log:false,address:”,latitude:0,longitude:0,zoom:10,markers:[],controls:{},scrollwheel:true,maptype:google.maps.MapTypeId.ROADMAP,mapTypeControl:true,zoomControl:true,panControl:false,scaleControl:false,streetViewControl:true,html_prepend:'<div class=”gmap_marker”>’,html_append:'</div>’,icon:{image:”http://www.google.com/mapfiles/marker.png&#8221;,shadow:”http://www.google.com/mapfiles/shadow50.png&#8221;,iconsize:[20,34],shadowsize:[37,34],iconanchor:[9,34],infowindowanchor:[9,2]}}})(jQuery);

    Plugin Author Ian Dunn

    (@iandunn)

    It sounds like you’ve got a pretty bad theme. The developer won’t support it, and it’s dependent on JavaScript in order to work, which is a violation of web standards.

    Try renaming these specific files and seeing if the theme will work enough to test.

    /wp-content/themes/dk/js/colorpicker.js
    /wp-content/themes/dk/js/fancybox/jquery.fancybox-1.3.0.js
    /wp-content/themes/dk/js/gmap.js
    /wp-content/themes/dk/js/jquery.validate.js
    /wp-content/themes/dk/js/video.js
    /wp-content/themes/dk/js/jquery.flip.min.js
    /wp-content/themes/dk/js/jquery-mousewheel-3.0.4/jquery.mousewheel.min.js
    /wp-content/themes/dk/js/jquery.jplayer.min.js

    If it doesn’t, leave gmap.js renamed so that I can look at the site while it’s disabled.

    Thread Starter Thorworx

    (@thorworx)

    Hi… I left gmap.js renamed and even tried to remove all relations to gmap out of header.php but nothing worked.. its still the same 3 problems.. now I am starting to guess that it may not be related to the template … what now?

    Best regards…

    Plugin Author Ian Dunn

    (@iandunn)

    At this point I’m not sure what else to tell you. I don’t really have the time to dig into it any further. I’d suggest trying a different maps plugin or a different theme.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Basic Google Maps Placemarks] Broken Map with DK Template’ is closed to new replies.