Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Plugin conflict - Leaflet Maps marker & Google Analytic for WP WordPress

  • SOLVED

I am developer of the plugin mapsmarker.com and my plugin doesnt show maps if the plugin Google Analytics for WordPress from Yoast is active. I use php classes and unique function names and checked the GA plugin files what could cause the error but didnt succeed. I would like to fix this error in my plugin without having to wait for an update of GA for WP.

For more info about this bug please see the following post: http://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-plugin-conflict-with-leaflet-maps-marker-google-analytics-plugin-break-map-vie

Answers (4)

2012-01-11

Julio Potier answers:

Hello

i'm on the

And i can see this line (#131 in source code of the page) :

wms3 = new L.TileLayer.WMS("http://discomap.eea.europa.eu/ArcGIS/services/Air/EPRTRDiffuseAir_Dyna_WGS84/MapServer/WMSServer", {wmsid: "wms3", layers: "24", styles: "", format: "image/png", attribution: "WMS: <a href=&quot;http://www.eea.europa.eu/code/gis&quot; target=&quot;_blank&quot;>European Environment Agency</a> (<a href="http://discomap.eea.europa.eu/ArcGIS/services/Air/EPRTRDiffuseAir_Dyna_WGS84/MapServer/WMSServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=1" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','http://discomap.eea.europa.eu']);" target='_blank'>Legende</a>)", transparent: "TRUE", errorTileUrl: "http://beta.mapsmarker.com/wp-content/plugins/leaflet-maps-marker/img/error-tile-image.png", version: "1.3.0"});

This is in the <script> block tag in source code from <em>/* Maps created with MapsMarker.com (WordPress Plugin powered by Leaflet from Cloudmade) - version 1.1 */</em>

This line got a bad <strong>attribution</strong> property, look at that one :
attribution: "WMS: <a href=&quot;http://www.eea.europa.eu/code/gis&quot; target=&quot;_blank&quot;>European Environment Agency</a> (<a href="http://discomap.eea.europa.eu/ArcGIS/services/Air/EPRTRDiffuseAir_Dyna_WGS84/MapServer/WMSServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=1" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','http://discomap.eea.europa.eu']);" target='_blank'>Legende</a>)",
Logically it would be kind of :
attribution: "this is some text",
but not
attribution: "this is "some" text",
do you understand ?

You got too many <strong>"</strong> instead of <strong>&quot;</strong>

Also this line contains some GA code, this is maybe the error of the cause, can you check why you line 131 is not correct ?

See you soon

2012-01-11

Christianto answers:

Its syntax problem, try to escaping the double quote on "attribution:" value
for example
attribution: "WMS: <a href=&quot;http://www.eea.europa.eu/code/gis&quot; target=&quot;_blank&quot;>European Environment Agency</a> (<a href=\"http://discomap.eea.europa.eu/ArcGIS/services/Air/EPRTRDiffuseAir_Dyna_WGS84/MapServer/WMSServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=1\" onclick=\"javascript:_gaq.push(['_trackEvent','outbound-article','http://discomap.eea.europa.eu']);\" target='_blank'>Legende</a>)\",


Christianto comments:

Oh crap, my code above is automatically change by wpquestion.. :-)

But basically its a double quote problem..
if the "attribution" value is going to be printed then you can use &quot; as replacement of "

2012-01-11

Peter Michael answers:

You seem to have syntax errors in your JavaScript(s):

missing } after property list
http://beta.mapsmarker.com/
Line 131

and

missing } after property list
http://beta.mapsmarker.com/
Line 178

2012-01-11

Francisco Javier Carazo Gil answers:

As Julio says,

In Firefox you can look an error from this line but attribution is also incorrect in more lines of this part: wms5, wms6...

In <a> you have the href between brackets with this same error. Please use &quot; or \" or maybe '.