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

I have a map inside a Confluence wiki page, and using PocketQuery I get the addresses I want to display from my DB.

What's the most direct way to do the Nominatim request and the Leaflet marker placement?

I can generate code that looks like this:

    #foreach($person in $result)
    $.getJSON('$person.strasse $person.hausnummer ,$person.plz?format=json', cbMarker);
    function cbMarker(data){
      L.marker([, data.lon], {title: '$'}).addTo(map);
but something is wrong, it seems to crash the template and it falls back to just showing me $result as a table.

asked 06 Nov '15, 10:13

HeaDCase's gravatar image

accept rate: 0%

edited 14 Nov '15, 22:08

aseerel4c26's gravatar image

aseerel4c26 ♦


Is Conluence supposed to be Confluence?

(14 Nov '15, 08:51) scai ♦

Yeah, my typo there. Got it sorted in the meantime, the suggestion about using only the first element of the returned array is right on the money. Thanks!

(14 Nov '15, 20:58) HeaDCase

Your question is difficult to understand (what is Conluence and where does PocketQuery come into it - are we supposed to know?) but your JavaScript looks like it assumes that the Nominatim response will be a hash when indeed it will be an array of search results; you probably need something like data[0].lat instead of Which will of course fail if the result set is empty.

permanent link

answered 13 Nov '15, 23:00

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
accept rate: 23%

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: 06 Nov '15, 10:13

question was seen: 5,253 times

last updated: 14 Nov '15, 22:08

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