NOTICE: is being shutdown on 1st March 2024. Please use the OpenStreetMap Community Forum

hello I am following leaflet tutorial to edit simple map ( just doing a testing to make sure it works)

i see the map but its Blue screen and then i need to navigate it. but should not the right lat/long be shown when i open the page ? Please see the picture,

Can any one please tell me what i am doing wrong ? I have added the code here aswell.

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
      <title>my first map</title>
      <link rel="stylesheet" href="leaflet.css"/>
      <script src="leaflet.js"></script>

      <style type="text/css">
    #mapid { width: 960px;
        height:500px; }

    <div id="mapid"> </div>


    var mymap ='mapid').setView([90.4125,
23.8103], 8);

        attribution: 'Map data &copy; <a href="">OpenStreetMap</a> contributors, <a href="">CC-BY-SA</a>, Imagery © <a href="">Mapbox</a>',
        maxZoom: 12





Thanks for the help.

asked 28 May '18, 11:28

fosiul's gravatar image

accept rate: 50%

Try swapping latitude and longitude in setView.

The example has

var mymap ='mapid').setView([51.505, -0.09], 13);

which is 51.505 North, 0.09 West. I'm not sure you can have 90.4125 North.

permanent link

answered 28 May '18, 11:49

EdLoach's gravatar image

EdLoach ♦
accept rate: 22%

edited 28 May '18, 11:50


Thanks Edloach , I am sure i changed that and tryed but did nto work, but now its working.. now sure what i was doing wrong, but yes its works


(28 May '18, 12:12) fosiul
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 28 May '18, 11:28

question was seen: 2,387 times

last updated: 28 May '18, 12:12

NOTICE: is being shutdown on 1st March 2024. Please use the OpenStreetMap Community Forum