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 8157225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:12:33+00:00 2026-06-06T17:12:33+00:00

I am trying to display multiple Pushpin objects on an EntityLayer for Bing Maps.

  • 0

I am trying to display multiple Pushpin objects on an EntityLayer for Bing Maps. While the Pushpins are retrieving data correctly and the EntityLayer is storing the Pushpins properly, the MapView is not displaying the EntityLayer.

JSONObject json = retrieveJSON();
JSONArray array = json.getJSONArray("Sites");

Coordinate closestGauge;

fooLayer = new EntityLayer("foos");


for(int i = 0; i < array.length(); i++)
{
    JSONObject site = array.getJSONObject(i);
    double lon = site.getDouble("Longitude");
    double lat = site.getDouble("Latitude");
    Pushpin foo = null;
    fooCoordinate = new Coordinate(lat, lon);
    PushpinOptions fooData = new PushpinOptions();
    fooData.Text = Double.toString(site.getDouble("Data"));
    fooData.Icon = Constants.PushpinIcons.RedFlag;
    foo = new Pushpin(fooCoordinate, fooData);
    _FWSGPSLayer.add(foo);
}

fooMap.getLayerManager().addLayer(fooLayer);
fooLayer.updateLayer();

Going by the Debug perspective, I noted that the EntityLayer never links to the MapView as its _map parameter/value is always set to null. I’ve tried various ways of displaying the layer, such as calling the setBingMapsView method from EntityLayer but nothing has worked so far.

Is there something I’m doing wrong? I tried to match things up with the sample Bing Maps application, it hasn’t been helping.

EDIT: I’ve done some debugging and this is what I’ve found out so far: When I comment out the for loop and simply add a single Pushpin, it works. This leads me to believe that Bing Maps has a limit for the number of Pushpins that can be added. However, my array only contains ~200 data points whereas I have been led to believe that the upper limit is in the thousands.

  • 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-06T17:12:35+00:00Added an answer on June 6, 2026 at 5:12 pm

    Well, silly me. Scouring through my JSONArray, I noticed that, interspersed throughout my array, a couple of Doubles were actually returning null. Of course, since I was debugging on an Android device with a near-constant stream of Location updates, I could hardly spot the NullPointerException in my LogCat.

    Lesson learned, always check for nulls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to display multiple bing maps on the same page, with each
I am trying to display a route with multiple points in the provided Maps
I have a repeater trying to get multiple data to display. which includes a
I need to display multiple pieces of data in a combobox, but I can't
I have being trying to display the filenames for the multiple files that have
I'm trying to display multiple, static jQuery Progress Bars on a single page, all
I'm trying to display the following code only once while the rest of the
I am trying to display a multiple select that is disabled and has some
I'm trying to have multiple values for profFName and profLName display on a map
I'm trying to make a paging UIScrollView display multiple pages at the same time,

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.