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

173
Views
Access geometry coordinates with Mapbox expressions somehow?

Every now and then I encounter a code like this:

var mapboxDrawStylesCustom = [
    {
      'id': 'custom-point-inactive',
      'type': 'circle',
      'filter': ['all',
        ['==', 'active', 'false'],
        ['==', '$type', 'Point'],
        ['==', 'meta', 'feature'],
        ['!=', 'mode', 'static']
      ],
      'paint': paintPropertyPoint
    }
]

I wonder about '$type' accessor here. Like obviously it allows to grab the type of geometry. But I haven't seen it mentioned anywhere in the docs. I personally need to access latitude/longitude of the Point geometry. According to documentation it is not something that Mapbox supports. However is it maybe possible somehow using this kind of dollar-sign syntax?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

$type is an older, deprecated expression. Its modern successor is ['geometry-type']: https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/#geometry-type

AFAIK the older syntax doesn't give you extra access to anything. So, no, you can't access geometry coordinates that way.

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!