Load zoom/loading all locations not working

Permalink Browser Info Environment
I uploaded my locations and ran the geocoder. I then edited my view.php file to zoom to the center of Nebraska using the coordinates, then placed the js to load all of my locations on page load. Neither are working.

function load<?php   echo $controller->bID?>() {
       var latlng = new google.maps.LatLng(41.9347785, -99.9080043); // Nebraska Centered
var options = {
            zoom: 7,
             center: latlng,
             mapTypeId: google.maps.MapTypeId.ROADMAP
         };

$(document).ready(function (){
   load<?php echo $controller->bID?>();
        var address = $('#ccm-locator-search-<?php   echo $controller->bID?>  input[name=address]').val(69157);
         var radius = $('#ccm-locator-search-<?php   echo $controller->bID?>  #radius').val(1000);
       searchLocations();
});

Type: Discussion
Status: New
FatTony1952
View Replies:
GregJoyce replied on at Permalink Reply
GregJoyce
You might want to change that searchLocations to searchLocationsNear(latlng). and you would need to initialize latlng to your example in that load function.

searchLocations() just searches based on that address input, so that's going to be blank on load.
FatTony1952 replied on at Permalink Reply
FatTony1952
Thanks, that worked to get the map to initiate a search on page load, but since the form is set to 10 mile radius on page load, it's only giving me a 10 mile radius (I'm assuming this).

I added

var radius = $('#ccm-locator-search-<?php   echo $controller->bID?>  #radius').val(1000);
       searchLocations();


back into it to get a default radius on load, but it's still only giving me a 10 mile radius.

$(document).ready(function (){
   load<?php   echo $controller->bID?>();
   var latlng = new google.maps.LatLng(41.9347785, -99.9080043); 
   var radius = $('#ccm-locator-search-<?php   echo $controller->bID?>  #radius').val(400);
   searchLocationsNear(latlng);
});
GregJoyce replied on at Permalink Reply
GregJoyce
yeah I think you might have better luck just setting radius to an integer there.

$(...).val(500) is just going to set that selected element's value. val() gets the value of that element and assigns it to radius.
http://api.jquery.com/val/

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.