GithubHelp home page GithubHelp logo

custom mapbox styles about flood-map HOT 12 CLOSED

nullart avatar nullart commented on August 19, 2024
custom mapbox styles

from flood-map.

Comments (12)

planemad avatar planemad commented on August 19, 2024

@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.

nullart avatar nullart commented on August 19, 2024

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:

screen shot 2017-01-18 at 8 11 41 am

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.

nullart avatar nullart commented on August 19, 2024

PS: I cannot re-open this issue

from flood-map.

planemad avatar planemad commented on August 19, 2024

@nullart can you share your full html or js? Its not possible to debug without seeing the rest of the code.

from flood-map.

nullart avatar nullart commented on August 19, 2024

@planemad

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.

nullart avatar nullart commented on August 19, 2024

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.

planemad avatar planemad commented on August 19, 2024

@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.

nullart avatar nullart commented on August 19, 2024

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.

planemad avatar planemad commented on August 19, 2024

@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.

screenshot 2017-01-19 10 23 43

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.

nullart avatar nullart commented on August 19, 2024

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.

planemad avatar planemad commented on August 19, 2024

@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.

nullart avatar nullart commented on August 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.