osm-in/osm-in.github.io

Can We add a marker to the particular position.

Opened this issue · 1 comments

Can We add a marker to the particular position.

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>