How zainaali/solar-api works
This is a browser-based solar-potential viewer. A user searches for a location, the app resolves it and requests Google Solar data, then displays the location and roof information on a satellite map. Users can inspect roof segments and adjust a panel configuration to see panel counts and energy estimates. The main runtime logic is concentrated in script.js; the README documents the user-facing capabilities, while the excerpts show only parts of their implementation.
Main entry points: script.js Result processing · index.html Search input
Components 16
Location search
- Search input
index.html - Place autocomplete
script.js - Address geocoding
script.js
Solar data
- Solar data request
script.js - Result processing
script.js
Map and configuration
- Satellite map
script.js - Roof segments
script.js - Location marker
script.js - Solar details
script.js - Panel controls
script.js - Panel polygons
script.js - Energy estimate
script.js
Other components
- User
- Google Places
- Google Geocoder
- Google Solar API
Connections 16
- User → Search input: enters location
README.md - Search input → Place autocomplete: offers suggestions
README.md - Place autocomplete → Google Places: uses Places API
script.js - Place autocomplete → Address geocoding: resolves address
script.js - Address geocoding → Google Geocoder: geocodes address
script.js - Address geocoding → Solar data request: passes coordinates
script.js - Solar data request → Google Solar API: requests insights
script.js - Solar data request → Result processing: passes response
script.js - Result processing → Satellite map: renders results
script.js - Result processing → Roof segments: creates markers
script.js - Result processing → Location marker: creates marker
script.js - Roof segments → Solar details: shows segment data
script.js - Location marker → Solar details: shows location data
script.js - Result processing → Panel controls: creates slider
script.js - Panel controls → Panel polygons: adjusts layout
README.md - Panel controls → Energy estimate: updates estimate
script.js