Comments (6)
I think the way to do this is with custom columns which can be returned for the rows. Maybe something like this:
select
photo_url || '?w=800&h=400&fit=crop' as popup_image,
name as popup_title,
substr(description, 0, 200) as popup_description,
'/browse/museums/' || id as popup_link,
latitude, longitude from museums
where id in (26, 27) order by id
Or bundle it into JSON like this:
select json_object(
'image', photo_url || '?w=800&h=400&fit=crop',
'title', name,
'description', substr(description, 0, 200),
'link', '/browse/museums/' || id
) as popup,
latitude, longitude from museums
where id in (26, 27) order by id
from datasette-cluster-map.
The JSON method is more aesthetically pleasing to me, so I'll go with that.
from datasette-cluster-map.
{
"image": "https://niche-museums.imgix.net/dodgems.heic?w=800&h=400&fit=crop",
"title": "Dingles Fairground Heritage Centre",
"description": "Home of the National Fairground Collection, Dingles has over 45,000 indoor square feet of vintage fairground rides... and you can go on them! Highlights include the last complete surviving and opera",
"link": "/browse/museums/26"
}
from datasette-cluster-map.
from datasette-cluster-map.
Documentation: https://github.com/simonw/datasette-cluster-map/blob/c1329b6edd85c2ecbb098d5bb3b6c2c22b2493ba/README.md#custom-marker-popups
from datasette-cluster-map.
From https://twitter.com/simonw/status/1263668857174020096
from datasette-cluster-map.
Related Issues (20)
- Cloudrun not loading SpatiaLite module? HOT 3
- Use new datasette.urls.static_plugins() method HOT 2
- Easy way to click a table row and see it on the map
- Support for multiple lat/lon columns HOT 1
- [object Object] displayed for labels HOT 1
- Depend on datasette-leaflet HOT 1
- Feature request: resize the map or pop it out HOT 2
- Feature request: render-images in pins HOT 3
- small maps using docker
- Loading gif or message
- Clustermap misinterprets SQL calculations
- Cluster-map not showing HOT 5
- Create cluster count based on the value of a column
- Latitude or longitude out of range results in display of blank map HOT 5
- Pick up more name pairs, e.g. `long,lat` HOT 8
- <button class="cluster-map-button">load all</button> does not show in Datasette 1.0 alpha HOT 2
- Compatibility with Datasette 1.0 alphas HOT 1
- This should work on both Datasette 1.0 and 0.x HOT 5
- Update Stamen example in README HOT 3
- Rogue print statement
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datasette-cluster-map.