Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
Obtain Image From Json File and Display it as ImageOverlay in Leafleat

I'm trying to obtain an image from my json file and I want to display it on the map.

This is what the Json looks like:

{
  "type": "Feature",
  "id": 0,
  "properties": {
    "NAME": "Building",
    "FLOOR_IMG_1": "assets/img/floor-plan1.svg",
    "FLOOR_IMG_2": "assets/img/floor-plan2.svg"
  },
  "geometry": {
    "type": "Point",
    "coordinates": [100, 10]
  }
}

I want to display the "FLOOR_IMG_1" and "FLOOR_IMG_2".

I tried this code but it's not working

$.getJSON("data/building.geojson", function (data) {
    var imageUrl = feature.properties.FLOOR_IMG_1,
    imageBounds = [
      [0, 0],
      [250, 250],
    ];
    image = L.imageOverlay(imageUrl, imageBounds).addTo(map);
    map.fitBounds(imageBounds);
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Add jQuery, $.getJSON is jQuery method

<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!