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

Can We add a marker to the particular position. #20

Open
rajatagarwal23 opened this issue Jul 31, 2017 · 1 comment
Open

Can We add a marker to the particular position. #20

rajatagarwal23 opened this issue Jul 31, 2017 · 1 comment

Comments

@rajatagarwal23
Copy link

Can We add a marker to the particular position.

@rajatagarwal23
Copy link
Author

Hi Concern,

Please help. Below is my code.

<script src='https://api.tiles.mapbox.com/mapbox.js/v2.3.0/mapbox.js'></script> <script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-hash/v0.2.1/leaflet-hash.js'></script>
Edit map <script> // Lock to India bounds var southWest = L.latLng(7.319, 61.523), northEast = L.latLng(36.774, 100.635), bounds = L.latLngBounds(southWest, northEast); // Provide your access token L.mapbox.accessToken = 'pk.eyJ1Ijoib3BlbnN0cmVldG1hcCIsImEiOiJhNVlHd29ZIn0.ti6wATGDWOmCnCYen-Ip7Q'; // Definte tile urls of each layer var indiaMap = L.mapbox.tileLayer('openstreetmap.1b68f018'), bhuvanSatellite = L.tileLayer('http://tile1.nrsc.gov.in/tilecache/tilecache.py/1.0.0/bhuvan_imagery2/{z}/{x}/{y}.jepg', { attribution: 'NRSC/ISRO' }), postalMap = L.mapbox.tileLayer('planemad.9acc2036'),
    highwaysMap = L.mapbox.tileLayer('planemad.66359ac0'),
    connectivityGraph = L.mapbox.tileLayer('planemad.5504651b'),
    railwayMap = L.mapbox.tileLayer('planemad.e5dd1290');

var baseLayers = {
    "Railway Map": railwayMap,
    "Bhuvan Satellite": bhuvanSatellite,
    // "NASA Satellite": truemarbleSatellite,
    "OpenStreetMap India": indiaMap
};

var overlayMaps = {
    "Highway": highwaysMap,
    "Postal Codes": postalMap,
    "Connectivity": connectivityGraph
};

// Create a map in the div #map
var map = L.map('map', {
        layers: indiaMap
    }, {
        maxBounds: bounds,

    })
    .addControl(L.mapbox.geocoderControl('mapbox.places', {
        autocomplete: true
    }))
    .setView([21.166, 72.9270],13);

L.hash(map);

//Add layer control
L.control.layers(baseLayers, overlayMaps, {
    position: 'topleft'
}).addTo(map);
</script> <script src="//code.jquery.com/jquery-1.11.2.min.js"></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant