troubleshooting Question

Anybody ever heard of "leaflet.js" or "heatmap.js"?

Avatar of Bruce Gust
Bruce GustFlag for United States of America asked on
Node.jsJavaScript
5 Comments3 Solutions67 ViewsLast Modified:
Here's a screenshot of my page:

leaflet.js
Here's what you're looking at:

This particular company doesn't have any address information .Within the code, there's a piece that's looking for some relevant data based on the postal code. If that info doesn't exist, the page will just sit there until it finally times out leaving the user confused and bewildered.

To solve that dilemma, once I found the relevant syntax, I just qualified things by engaging that query only if there were some postal codes to query.

So, now for the first time in days, I'm actually able to look at some data on the page that, beforehand was simply timing out with no real explanation, at least as far as the user was concerned.

However...

As you can tell by the screenshot, while the page is firing, beneath the hood there's an error message that references "leaflet.js."

Upon closer inspection, "heatmap.js" is involved as well.

So, here's my dilemma...

Although there's only one row in my database at this point, there will most certainly be multiple rows, most of which will represent a complete array of information. In other words, they will have some postal codes.

But in those instances where you've got a renegade row with no postal codes, I want to prevent "heatmap" from firing.

Here's the twig file:

<table id="main-dt" class="table custom make-datatable table-bordered table-striped dataTable no-footer" data-route="/companies/datatable" data-layout="tlipr" data-callback="initHeatMap();">
      <thead>
        <tr>
          <th scope="col" data-field=":checkbox" data-searchable="0" data-sortable="0">
            <div class="pretty p-default">
                <input type="checkbox" class="table-all" />
                <div class="state p-primary">
                  <label>All</label>
                </div>
            </div>
          </th>
          <th scope="col" data-field="name" data-searchable="0" data-sortable="1">Company</th>
          <th scope="col" data-field="owner" data-searchable="0" data-sortable="1">Lead Owner</th>
            <th scope="col" data-field="contacts" data-searchable="0" data-sortable="1">Contacts</th>
          <th scope="col" data-field="addresses" data-searchable="0" data-sortable="1">Location</th>
          <th scope="col" data-field="meta.ftes" data-searchable="0" data-sortable="1">FTE's</th>
          <th scope="col" data-field="meta.premium" data-searchable="0" data-sortable="1">Premium</th>
          <!-- th scope="col" data-field=":actions">&nbsp;</th -->
        </tr>
      </thead>
      <tbody></tbody>
    </table>

I'm looking for a "for" loop and I don't see one.

How can I evaluate each hypothetical row and prevent any attempt on the part of the system to try and plot that on the map?

BTW: I'm more than happy to provide as much code as you want or need in order to comment intelligently, but I thought I would start with the basics first - especially since both heatmap.js is a third party thing and I'm hoping there's some ninjas who've worked with it before that can point me in the right direction.

Thanks!
ASKER CERTIFIED SOLUTION
leakim971
Multitechnician
Join our community to see this answer!
Unlock 3 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros