how to display google maps with javascript

You should place that code in an HTML block, not a text block.

You can create a new block, type HTML in the search bar and select it. Then paste above code in that new block.