Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added new design #33

Merged
merged 12 commits into from
May 31, 2018
258 changes: 215 additions & 43 deletions css/main.css

Large diffs are not rendered by default.

Binary file added img/custom-marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions img/topography1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
340 changes: 154 additions & 186 deletions index.html

Large diffs are not rendered by default.

34 changes: 30 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
mapboxgl.accessToken = "pk.eyJ1IjoidHJpZGlwMTkzMSIsImEiOiJjajVobTc1c3MxeXNyMnFucXV5cnVyOWhvIn0.xAsGvnYs57UMqlwdAQP5nA";

/* Map: This represents the map on the page. */
var map = new mapboxgl.Map({
container: "map", // container id
style: "mapbox://styles/tridip1931/cjeb8qivf31se2snvzdz9s3b9", // stylesheet location
center: [77.631, 12.973], // starting position [lng, lat]
zoom: 13.33 // starting zoom
container: "map",
style: "mapbox://styles/mapbox/outdoors-v10",
zoom: 14.0,
center: [77.60255, 12.89562]
});

map.on("load", function () {
/* Image: An image is loaded and added to the map. */
map.loadImage("../img/custom-marker.png", function (error, image) {
if (error) throw error;
map.addImage("custom-marker", image);
/* Style layer: A style layer ties together the source and image and specifies how they are displayed on the map. */
map.addLayer({
id: "markers",
type: "symbol",
/* Source: A data source specifies the geographic coordinate where the image marker gets placed. */
source: {
type: "geojson",
data: {
type: "FeatureCollection",
features: [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": ["77.602547", "12.8956152"] } }]
}
},
layout: {
"icon-image": "custom-marker"
}
});
});
});
map.scrollZoom.disable();