5

I'm trying to get google map image with the following code:

<img src="http://maps.googleapis.com/maps/api/staticmap?center=#{profile.latitude},#{profile.longitude}&zoom=14&size=400x400&sensor=false"/>

but I get exception in my browser which says:

Error Parsing /content/profile.xhtml:
Error Traced [line: 48] The reference to entity "zoom" must end with the ';' delimiter.

How can I avoid interpreting & in URL as XML?

1 Answer 1

11

Replace & with &amp; as the markup is being parsed as XML and &zoom is being parsed as an HTML entity which does not exist in XML.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.