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

153
Views
When we click on search, it should zoom into the area selected. The area is highlighted on the map and zooms

This is the site https://www.space-intelligence.com/scotland-landcover/# When you click on the regional statistics it open a dropdown and then when you click select region it open a pop up and here you select the city and after that you click search button. But it is doing nothing. When you click on search, it should zoom into the area selected. The area is highlighted on the map and zooms in when you click search.

This is the function:

function areasearch(modalid) {
    var fid = $("#areasearch" + modalid).val();
    $("#exampleModal" + modalid).modal('toggle');
    map.data.forEach(function(feature) {
        if (fid != 0) {
            if (feature.i.ID != fid) {
                map.data.overrideStyle(feature, {
                    visible: false
                });
                feature.setProperty('visible', 'false');
            } else {
                var bounds = new google.maps.LatLngBounds();
                feature.getGeometry().forEachLatLng(function(latlng) {
                    bounds.extend(latlng);
                });
                map.fitBounds(bounds);
                map.data.overrideStyle(feature, {
                    visible: true
                });
                google.maps.event.trigger(map.data, 'click', feature.getId());
                feature.setProperty('visible', 'true');
            }
        } else {
            map.data.overrideStyle(feature, {
                visible: true
            });
            feature.setProperty('visible', 'true');
        }
        $('#exampleModal').modal('hide');
    });
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

use setZoom()

if you experiment some trouble with map.fitBounds(), try to use setZoom() method with your desire level of zoom (int is needed). Also you need to center the map where you want to have a focus with the method setCenter() (latLng object is needed).

Try insert the following lines with the value desired :

map.setCenter({lat:YOUR_LATITUDE, lng:YOUR_LONGITUDE});
map.setZoom(6);

you can also read the this section of the documentaion

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!