Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Maps lib class #45

Merged
merged 4 commits into from
Feb 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ Follow the steps below and you'll be in business with your own map.
4. Select __Browser key__
5. Leave the ACCEPT REQUESTS FROM THESE HTTP REFERERS __blank__ and click __Create__
6. Copy the API KEY, which should look something like `AIzaSyA3FQFrNr5W2OEVmuENqhb2MBB2JabdaOY`
1. In js/maps_lib.js, set your
1. At the bottom of index.html, set your
1. __fusionTableId__ to the encrypted ID of your Fusion Table. __Note__: Google is phasing out numeric IDs soon
1. __googleApiKey__ to the API key from your [Google API Console](https://code.google.com/apis/console/)
1. __locationColumn__ to the name of your location column in your Fusion Table
1. __map_centroid__ to the lat/long you want your map to center on
1. __locationScope__ to the area you want to limit searches to (set to 'Chicago' by default)
1. __map_center__ to the lat/long you want your map to center on
1. __locationScope__ to the area you want to limit searches to (set to 'chicago' by default)
1. __recordName__ and __recordNamePlural__ to the name of the items in your Fusion Table
1. Add/modify additional filters to maps_lib.js. This will depend on the data you are trying to map. Take a look at the [wiki](https://github.com/derekeder/FusionTable-Map-Template/wiki) for [filter examples](https://github.com/derekeder/FusionTable-Map-Template/wiki/Filter-examples) and [list views](https://github.com/derekeder/FusionTable-Map-Template/wiki/List-search-results) to get started. You can also take a look at these examples:
* [Connect Chicago Locator](http://locations.weconnectchicago.org)
Expand Down
27 changes: 16 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ <h4>Your JavaScript is disabled</h4>

<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jquery.address.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places&v=3.17"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"></script>
<script type="text/javascript" src="js/maps_lib.js"></script>
<script type='text/javascript'>
//<![CDATA[
Expand All @@ -118,39 +117,45 @@ <h4>Your JavaScript is disabled</h4>
}).resize();

$(function() {
MapsLib.initialize();
var myMap = new MapsLib({
fusionTableId: "1m4Ez9xyTGfY2CU6O-UgEcPzlS0rnzLU93e4Faa0",
googleApiKey: "AIzaSyA3FQFrNr5W2OEVmuENqhb2MBB2JabdaOY",
locationColumn: "geometry",
map_center: [41.8781136, -87.66677856445312],
locationScope: "chicago",
});

var autocomplete = new google.maps.places.Autocomplete(document.getElementById('search_address'));

$(':checkbox').click(function(){
MapsLib.doSearch();
myMap.doSearch();
});

$(':radio').click(function(){
MapsLib.doSearch();
myMap.doSearch();
});

$('#search_radius').change(function(){
MapsLib.doSearch();
myMap.doSearch();
});

$('#search').click(function(){
MapsLib.doSearch();
myMap.doSearch();
});

$('#find_me').click(function(){
MapsLib.findMe();
myMap.findMe();
return false;
});

$('#reset').click(function(){
$.address.parameter('address','');
MapsLib.initialize();
myMap.reset();
return false;
});

$(":text").keydown(function(e){
var key = e.keyCode ? e.keyCode : e.which;
if(key == 13) {
if(key === 13) {
$('#search').click();
return false;
}
Expand Down
28 changes: 17 additions & 11 deletions index_iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,41 +75,47 @@ <h4>Your JavaScript is disabled</h4>
<script type='text/javascript'>
//<![CDATA[
$(function() {
MapsLib.initialize();

var myMap = new MapsLib({
fusionTableId: "1m4Ez9xyTGfY2CU6O-UgEcPzlS0rnzLU93e4Faa0",
googleApiKey: "AIzaSyA3FQFrNr5W2OEVmuENqhb2MBB2JabdaOY",
locationColumn: "geometry",
map_center: [41.8781136, -87.66677856445312],
locationScope: "chicago",
});


var autocomplete = new google.maps.places.Autocomplete(document.getElementById('search_address'));

$(':checkbox').click(function(){
MapsLib.doSearch();
myMap.doSearch();
});

$(':radio').click(function(){
MapsLib.doSearch();
myMap.doSearch();
});

$('#search_radius').change(function(){
MapsLib.doSearch();
myMap.doSearch();
});

$('#search').click(function(){
MapsLib.doSearch();
myMap.doSearch();
});

$('#find_me').click(function(){
MapsLib.findMe();
myMap.findMe();
return false;
});

$('#reset').click(function(){
$.address.parameter('address','');
MapsLib.currentType = "";
$("#select_type").val("");
MapsLib.initialize();
myMap.reset();
return false;
});

$(":text").keydown(function(e){
var key = e.keyCode ? e.keyCode : e.which;
if(key == 13) {
if(key === 13) {
$('#search').click();
return false;
}
Expand Down
Loading