EagerNoob
EagerNoob

Reputation: 101

Google Static MAPS API url resulting in 500 error

I am using the google static maps API and have the following url:

http://maps.googleapis.com/maps/api/staticmap?sensor=false&size=400x400&markers=icon:http://localhost/SimpleApp/images/SubjectIcon.png%7c44.942065,-93.66287&markers=icon:http://localhost/SimpleApp/images/BlueIcon.png%7c41.9922652,-87.7832879&markers=icon:http://localhost/SimpleApp/images/BlueIcon.png%7c44.0221363,-92.4666658

The problem is, I get a 500 error using this url. Could anyone help me see what I am missing?

TIA

Upvotes: 1

Views: 2413

Answers (1)

Mano Marks
Mano Marks

Reputation: 8819

The URL in your sample is looking for icons hosting locally via http://localhost which Google Maps can't find. Changing those URLs to publicly available images should work fine. As an example, the following URL works fine:

http://maps.googleapis.com/maps/api/staticmap?sensor=false&size=400x400&markers=icon:http://upload.wikimedia.org/wikipedia/en/f/f4/Blue_icon.png%7c44.942065,-93.66287&markers=icon:http://upload.wikimedia.org/wikipedia/en/f/f4/Blue_icon.png%7c41.9922652,-87.7832879&markers=icon:http://upload.wikimedia.org/wikipedia/en/f/f4/Blue_icon.png%7c44.0221363,-92.4666658

Upvotes: 2

Related Questions