350 likes | 431 Views
Becoming a Miner. Session #2 Becoming a Miner. Features of the State Mobile Template Configuring Google Fusion Tables (GFT) Changing the Application. Home Page Features. “Set My Location” “Search by County/City” Location based map. Home Page Features. Top 3 results
E N D
Session #2Becoming a Miner • Features of the State Mobile Template • Configuring Google Fusion Tables (GFT) • Changing the Application
Home Page Features • “Set My Location” • “Search by County/City” • Location based map
Home Page Features • Top 3 results • Direct links to results
Home Page Features • Social media links
Home Page Features • “Contact Us” • “Regular Site”
Contact Us • Location and address • Working phone link
Select a County • “Back” • “CA.GOV” • “Home” • County List • Counts
Select a County • “Back to Top”
Select a City • Empty spaces at end
Results • Details CSS class • Bold text <span>
Map Result • Full screen map
Map Result • Address and location • Working phone link
Map Result • Google street view
Create a Google Fusion Table • Can be done from Google Drive
Assign Location columns • Latitude/Longitude required for mapping
Get Fusion Table ID • Encrypted ID from “File->About this table”
Enable Services • https://code.google.com/apis/console/ • “Fusion Tables API” • “Google Maps API v3” (Not v2)
Template Contents • ASP version • C# version • PHP version • VB.Net version
What you will work with • ApiKeys.resx • Dataset (dsMain.xsd) • MyData class • Default Page • Detail Page • Mobile.master • ContactUs Page • SqlQueries.resx
Update API Keys Resource File • Replace “GoogleApiKey” with API Key • Replace “TablePrimary” with Encrypted ID • Leave “TableCity”
Update Dataset • Match your columns
Update Classes • Update typed dataset column names
Update Text • Change text in ASPX and master pages to match your department
Update ContactUs Class • Change the “lat” and “lng” to your office location.
Executing Queries • sqlGenericList: Returns the top X rows by distance.SELECT * FROM {0} ORDER BY ST_DISTANCE({1}, LATLNG({2},{3})) LIMIT {4}
SqlQueries Resource File • sqlCityLookup: Used to query a single city by distance from the shared city table.SELECT CITY FROM {0} ORDER BY ST_DISTANCE(LATITUDE, LATLNG({1},{2})) LIMIT 1 • sqlGenericDetail: Bring all columns for a single row by a single key value.SELECT * FROM {0} WHERE {1} = '{2}' LIMIT 1 • sqlGenericList: Returns the top X rows by distance.SELECT * FROM {0} ORDER BY ST_DISTANCE({1}, LATLNG({2},{3})) LIMIT {4} • sqlGroupByOne: Group by one column. (ex, county)SELECT {1}, COUNT() FROM {0} GROUP BY {1} ORDER BY {1} • sqlGroupByTwo:Group by two columns filtered by one. (ex, county/city where county=X)SELECT {1}, {2}, COUNT() FROM {0} WHERE {2} = '{3}' GROUP BY {1}, {2} ORDER BY {1} • sqlWhereTwo: Returns all rows matching two filters ordered by one column.SELECT * FROM {0} WHERE {1} = '{2}' AND {3} = '{4}' ORDER BY {5} • sqlZipLookup: Return City/LAT/LON where zip code matches.Select CITY, LATITUDE, LONGITUDE from {0} where ZIP_CODE = '{1}' Limit 1
How Map Script is Added • litInitScript.Text += GetMapScript(dt, 1, dt.LATITUDEColumn, dt.LONGITUDEColumn);
Questions? • Carter.medlin@state.ca.gov