NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I'm making an http get request this way, in angular:

data => {

but the following error is given:

Cannot read property 'toString' of null

I've also tried mapping the result this way:

.map(res => res.toString())
data => {

but the error remains. The xapi file I get if I go to*[amenity=hospital][bbox=13.20524,43.70861,13.22842,43.72338] is not null, so I'm supposing the method can't read the xapi file. Is there a way I can convert it to xml file?

asked 11 Aug '17, 17:32

PachiEPap's gravatar image

accept rate: 0%

The resulting file is a XML file. Just open the URL in your browser, save the file and open it in you favorite editor. Either a bug in your code. Or you have too many requests against this Overpass API server. In the latter case an error message will be returned. Either way, take a look at the content of the file.

permanent link

answered 12 Aug '17, 08:59

scai's gravatar image

scai ♦
accept rate: 23%

The content of the file is ok as said, so I don't know why the method can't read it. I've tried using interpreter for obtaining a json output, using this:[out:json];node[amenity=bar](43.70861,13.20524,43.72338,13.22842);out%20meta; Even now, in the browser the result is ok, but the same error is shown

(12 Aug '17, 12:27) PachiEPap

You need to ask somebody with angular.js as it is nearly sure that your code is broken.

(12 Aug '17, 15:08) SimonPoole ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 11 Aug '17, 17:32

question was seen: 1,695 times

last updated: 12 Aug '17, 15:08

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum