Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8841729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:47:35+00:00 2026-06-14T10:47:35+00:00

In my script for leaflet.js I have an array of locations which I have

  • 0

In my script for leaflet.js I have an array of locations which I have successfully created markers for. I would also like to use the bind.Popup function to display content stored in the array. To code the bind.Popup content, it seems to only work with an HTML paragraph tag, but I was hoping to reference the third item in my array. I’m not sure if this has to be done in HTML instead, but any help would be appreciated as I am new to Java! Here is the piece of code for reference, (I plan to add more locations and content, but want to first figure out the code):

var locations = [
["Warren", 43.059908,-89.442229, "Barn"],
["Brunsell", 43.058618,-89.442032, "House"],
["Jacobs", 43.058618,-89.441726, "Jacobs/Usonia 1"]
];

var marker, i
for (i = 0; i < locations.length; i++){

    var markerLocation = new L.LatLng(locations[i][1], locations[i][2]);
    marker = new L.Marker(markerLocation);
    westmorland.addLayer(marker);

};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:47:36+00:00Added an answer on June 14, 2026 at 10:47 am

    Perhaps I’m misunderstanding you here, but I’m pretty sure that the following should work.

    var marker, i;
    
    for (i = 0; i < locations.length; i++){
      var markerLocation = new L.LatLng(locations[i][1], locations[i][2]);
      marker = new L.Marker(markerLocation);
      marker.bindPopup(locations[i][3]);
      westmorland.addLayer(marker);
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My script run successfully on original version of Ubuntu 10.10 after installing the lxml
This script shows and positions a div like: function myfunction() { obj.style.visibility = visible;
My script, let's call it execute.php, needs to start a shell script which is
Script: $(document).ready(function() { //Change these values to style your modal popup var align =
The script below applies random colours from an array to a div id, and
I am developing fairly complex webapps/dashboards, mostly in Javascript. I like to use mongo
Script which executes commands in infinite loop in background <SOMETHING ELSE AT START OF
One script we have asks the user for a few values via successive JavaScript
by script or programmatically ? I have a bunch of files that need to
After script/generate authenticated user sessions users_controller.rb is created with def new @user = User.new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.