Comments (12)
@nullart documentation to use Mapbox GL is here https://mapbox.com/mapbox-gl-js/examples . There are tutorials here https://www.mapbox.com/help/
Please reopen if you have specific issues with the flood map
from flood-map.
I have seen these and have tried this, but the current example does not help as I'm getting an error when clicking a road:
using the example from here: https://mapbox.com/mapbox-gl-js/examples
var map = new mapboxgl.Map({ container: 'map', // container id style: 'mapbox://styles/mapbox/streets-v9', //stylesheet location center: [-74.50, 40], // starting position zoom: 9 // starting zoom });
Clearly, your mapbox style is configured differently than the mapbox styles out of the box. Maybe you can shed a light on this?
from flood-map.
PS: I cannot re-open this issue
from flood-map.
@nullart can you share your full html or js? Its not possible to debug without seeing the rest of the code.
from flood-map.
this is the only change i made in chennai.js:
`
// Define map locations
var mapLocation = {
'reset': {
'center': [124.6458,8.4776],
'zoom': 13.8,
'pitch': 0,
'bearing': 0
}
};
// Simple map
mapboxgl.accessToken = 'pk.eyJ1IjoibnVsbGFydCIsImEiOiJjaXkwbHV2eGkwMGEwMzNsbXcxYzcyb2YwIn0.o1Mv6BothDFsg8E9uDsCcA';
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/mapbox/streets-v9', //stylesheet location
hash: true
});
`
from flood-map.
anyway, just to inform you that I'm planning to deploy this for my city. As we recently have been hit by flood.
from flood-map.
@nullart just checked with your code and i'm seeing it work as expected. Can you please push your code to a branch or share your repository?
from flood-map.
hi @planemad I have updated the the forked repository. The settings are in js/cdeo.js and the above code has been commented. I'm using your style atm so I can deploy it for my city.
The problem with using custom mapbox style, when clicking a road (in color white). With yellow or gold colored road, it works sometimes.
from flood-map.
@nullart got it.
You need to make sure the road layer ids match the road related layer id's in your custom style. You can verify this by opening the style you are using in Mapbox Studio.
If you click on the road in the Studio map, it should list the layer ids you need to be able to query.
from flood-map.
hi @planemad I tried it but it doesn't work. I think that the issue is with (correct me if I'm wrong) map.featuresAt. The new styles saved at mapbox does not seem to support featuresAt anymore.
featuresAt has been removed since version 0.16.0
from flood-map.
@nullart thats right, you need to use the old Mapbox GL. Have yet to port this to the new version. But if you want a pointer on how it can be done with the new map.queryRenderedFeatures function see https://github.com/osmlab/fieldnotes/blob/master/index.js#L81
from flood-map.
Thanks, I'm working on it, will try to port it to the new mapboxgl. Will inform you of my progress.
Cheers!
from flood-map.
Related Issues (20)
- Optimize data geojson
- just an idea HOT 2
- Design feedback HOT 3
- Please update the wiki page!
- mapHighlightReset doesn't always work HOT 1
- Full project restructure HOT 2
- Map not avilable HOT 6
- Add additional features
- Easier way to retrieve the latest geo data? HOT 1
- Information Required HOT 4
- Redeploying flood map for St. Louis HOT 3
- Allow users to selectively mark flooded areas HOT 1
- Handle accidental submissions
- Remote Storage Support
- Redeploying FloodMaps for Kerala's floods! HOT 4
- Turn this repository into a pipeline
- Deploying FloodMaps in Odisha
- Mapbox secret key leaked in js.config.js
- Helpline Numbers HOT 3
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 flood-map.