fbpx
  1. chrigu
  2. ADVANCED GUTENBERG
  3. Thursday, May 14 2020
  4.  Subscribe via email
Hi,

I use the Map Block a lot on one of my pages (https://bilder.tracks4africa.de/). I have now realized there is a problem with the block. I get the sometimes the information "The block contains unexpected or invalid content." This is only happened, when I move the marker by hand on the map, save the post and open the post again in the edit mode.

If I check the block in the editor, it looks like this.


<!-- wp:advgb/map {"mapID":"advgbmap-899b748e-e7fe-4130-b077-c40de2c91cd6","useLatLng":true,"address":"palmwag konzession","currentAddress":"Palmwag, Namibia","markerTitle":"Palmwag Konzession","markerDesc":"Damaraland - Namibia","changed":true} -->
<div class="wp-block-advgb-map advgb-map-block" style="margin:10px auto"><div class="advgb-map-content" id="advgbmap-899b748e-e7fe-4130-b077-c40de2c91cd6" style="height:350px" data-default="https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png" data-lat="-19.781478791710498" data-lng="13.76632294123537" data-zoom="14" data-title="Palmwag Konzession" data-desc="Damaraland - Namibia" data-shown="true" data-style=""></div></div>
<!-- /wp:advgb/map -->


To have a correct block, I need to add lat and lng in the parameter as well. Then it looks like:


<!-- wp:advgb/map {"mapID":"advgbmap-899b748e-e7fe-4130-b077-c40de2c91cd6","useLatLng":true,"address":"palmwag konzession","currentAddress":"Palmwag, Namibia","lat":"-19.781478791710498","lng":"13.76632294123537","markerTitle":"Palmwag Konzession","markerDesc":"Damaraland - Namibia","changed":true} -->
<div class="wp-block-advgb-map advgb-map-block" style="margin:10px auto"><div class="advgb-map-content" id="advgbmap-899b748e-e7fe-4130-b077-c40de2c91cd6" style="height:350px" data-default="https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png" data-lat="-19.781478791710498" data-lng="13.76632294123537" data-zoom="14" data-title="Palmwag Konzession" data-desc="Damaraland - Namibia" data-shown="true" data-style=""></div></div>
<!-- /wp:advgb/map -->


I hope you can fix this.

Thanks
Christoph
Responses (5)
Accepted AnswerPending Moderation
I could solve the problem. Just change the following lines in block.js at line 16842.

from:

marker.addListener('dragend', function () {
var newLocation = marker.getPosition();
var newLat = newLocation.lat();
var newLng = newLocation.lng();

that.props.setAttributes({ lat: newLat, lng: newLng });
});



to:

marker.addListener('dragend', function () {
var newLocation = marker.getPosition();
var newLat = newLocation.lat().toString();
var newLng = newLocation.lng().toString();

that.props.setAttributes({ lat: newLat, lng: newLng });
});



Kind regards
Christoph
  1. more than a month ago
  2. ADVANCED GUTENBERG
  3. # 1
Accepted AnswerPending Moderation
Hi,

Thanks for contacting us here about this extension.

Yes, thanks for your feedback, our developer will check this issue.

Thanks a lot!
Cheers,
  1. more than a month ago
  2. ADVANCED GUTENBERG
  3. # 2
Accepted AnswerPending Moderation
Unfortunately, the bug is still there. After the last update I had to change the two lines again. Actually a small quick solution that does not cost the developer any time.
  1. more than a month ago
  2. ADVANCED GUTENBERG
  3. # 3
Accepted AnswerPending Moderation
After the last Update to 2.4.0 the bug is still in. It is so easy to fix it on your side. Just follow my instructions some posts ago. You now have to check the line number 17048 at blocks.js
  1. more than a month ago
  2. ADVANCED GUTENBERG
  3. # 4
Accepted AnswerPending Moderation
Hi,

Thanks for your response.

Advanced Gutenberg plugin ownership is currently being transferred to a new team that handles the support (the team behind publish press plugin).
You can post any request you have to the plugin repository, and the support team will reply within a day.

Here is the direct link: https://wordpress.org/support/plugin/advanced-gutenberg/

Of course all our extensions will remain compatible with the Advanced gutenberg plugin.

Thanks a lot!
Cheers,
  1. more than a month ago
  2. ADVANCED GUTENBERG
  3. # 5
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!