(English translation is at the end)

自从我“发现”Leaflet Maps Marker并把它作为自己最喜欢的WordPress地图插件,以及与原作者Robert Harm联系并光荣的参与了插件汉化工作一直到现在以来,这款插件就以其专业的设计、经常的更新、功能的完善牢牢占据了我的心。使用至今,曾出现过的一些小问题都已被勤奋的作者Robert一一订正。但是有一个问题一直无法解决:在中国,我们伟大的墙把谷歌的很多服务ban掉了,Maps Marker提供的一些服务也未能幸免,哪怕不使用Google Maps,其在加载地图时依旧出现等待时间巨长(一般超过40秒)的情况。症状:

Leaflet Maps Marker
Leaflet Maps Marker


<a href=https://chart.useso.com/chart?chs=150x150&amp;cht=qr&amp;chl=/wp-content/plugins/leaflet-maps-marker/leaflet-fullscreen.php?layer=1 target="_blank" title="在全屏模式创建QR代码图片"><img src=/wp-content/plugins/leaflet-maps-marker/inc/img/icon-qr-code.png width="14" height="14" alt="QR-code-logo" class="lmm-panel-api-images" /></a>


Leaflet Maps Marker
Leaflet Maps Marker
Leaflet Maps Marker
Leaflet Maps Marker


另外,建议中国大陆用户把默认地图设为“Mapquest (OSM)”或“必应地图”(必应地图要API key),并且不要将谷歌地图设为可选地图(设置→地图默认值→控制台提供的基础地图→将所有谷歌地图反选)。



A Tip To Solve Slow Loading Of Leaflet Maps Marker For Mainland China Users

Since I ever "discovered" Leaflet Maps Marker and set it as my personal favorite WordPress plugin, then contacted with Robert Harm and took part in the translation job, the plugin stays in my heart for its professional design, frequent updates, and multiple functions. Till now, the appeared small problems had been solved by its diligent author Robert. But, there is one problem leaving unsolved: In our great Mainland China, our great firewall by Ministry of Industry and IT had banned or slowed down a lot of Google services including Google Maps because of disputes and distrusts with Google. So is Maps Marker's map services. Even I don't use Google Maps in Maps Marker, it takes super long loading time (generally more than 40 seconds) when maps are loaded. (See above screenshot 1)

After some research, I found the reason is because chart.useso.com was used when loading QR code "Create QR code image for standalone map in full-screen mode". (See above HTML codes)

So all we have to do is just banning this code. Go to "Map defaults" ->"Default values for new layer maps"->uncheck "QR code". (See above screenshot 2 & 3)

If APIs are not used, I suggest uncheck all API links, exclude XML and Full-screen mode for others to download your markers.

Moreover, I suggest all Mainland China users change the default map to "Mapquest (OSM)" or "Bing Map" (API key needed). I also suggest not to use Google Maps (Settings->Map defaults->Available basemaps in control box->uncheck all Google map services) if you wish to speed up map loading time.

My test shows that after these changes, map loading time is shortened a lot: At least 20 seconds faster!






support for conditional SSL loading of Javascript for Google Maps

So far, the Google javascript need for Google Maps to displayed properly was loaded by default via https. John from China found out, that this was causing performance issues on his server, resulting in a notable lag when using Google Maps as basemap (thanks for the report!). I am not sure if this is an issue specific to China, as I also learned that with certain webserver configurations loading mixed ressources via https can result in poorer performance.

Anyway I changed this now with pro v1.5.6 and load Google Javascript only via https, if the site is also loaded via https.

共有 5 条评论

    1. @chojemmy 不专业啊,没有涉及编程,只是汉化以及软件设置而已。


      p.s. 去过你的博客,只能说,翻墙太累了,我表示评论无能。何不搞个提供国内外主机的国内服务商呢?

      Google Chrome 23 Google Chrome 23 Windows 7 Windows 7


您的电子邮箱地址不会被公开。 必填项已用*标注