Comments (3)
@ebenenglish Can you confirm what the expected return values are for set_viewpoint
? Also is the anticipated behavior to return something to set the map location in the UI?
from blacklight-maps.
@mejackreed set_viewpoint
is used to set the Leaflet map bounds in the UI when there are a diverse set of locations being passed to the map. The function loops through all the coordinates in the GeoJSON FeatureCollection and returns a bounding box or coordinate set that is passed to the Leafleft fitBounds
method, which determines the correct center point and zoom level. The result it that all the locations are visible in the map window in the UI (with a little bit of padding), and the zoom is as deep as possible where all the locations can still be seen on the initial load.
set_viewpoint
should either return:
- (a) an array with one coordinate point
- (b) an array with two members, where each member is a coordinate point array
For example (pseudo code warning!):
set_viewpoint(FeatureCollection with 1 item) => [29.646923, 91.117212]
set_viewpoint(FeatureCollection with >1 item) => [[20.593684, 78.96288], [35.86166, 104.195397]]
It could probably be broken down into several smaller functions or moved into a class.
from blacklight-maps.
Thanks for the great reply. I'm working on it
Sent from my iPhone
On Apr 16, 2015, at 8:20 AM, Eben English [email protected] wrote:
@mejackreed set_viewpoint is used to set the Leaflet map bounds in the UI when there are a diverse set of locations being passed to the map. The function loops through all the coordinates in the GeoJSON featureCollection and returns a bounding box or coordinate set that is passed to the Leafleft fitBounds method, which determines the correct center point and zoom level. The result it that all the locations are visible in the map window in the UI (with a little bit of padding), and the zoom is as deep as possible where all the locations can still be seen on the initial load.
set_viewpoint should either return (a) an array with one coordinate point; or (b) an array with two members, where each member is a coordinate point array :
point => [29.646923, 91.117212]
bbox => [[20.593684, 78.96288], [35.86166, 104.195397]]
It could probably be broken down into several smaller functions or moved into a class.—
Reply to this email directly or view it on GitHub.
from blacklight-maps.
Related Issues (20)
- Handle bbox that crosses international dateline
- Display number of mapped items next to pagination
- allow for using any fields for lat/lng HOT 1
- Make map object accessible HOT 6
- Update rspec tests to 3.x
- Automatically configure application using install generator HOT 2
- Add specs for show view
- Can we agree on a JavaScript style to use? HOT 1
- move add_spatial_search_to_solr method to a Blacklight::SearchBuilder subclass module HOT 2
- replace facet_by_field_name with aggregations HOT 1
- show bbox bounds on hover
- map doesn't zoom to bounds if only feature is a bbox HOT 3
- Is there sample data? HOT 2
- catalog#map view should show the application name in the page title
- incompatibility with Blacklight >= 5.16.0 HOT 6
- coordinate search constraints should show in page title
- initialview config property not working HOT 1
- Problems leaflet-markercluster-rails and Rails 5 HOT 1
- release for blacklight >=7.0, < 7.8
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 blacklight-maps.