Why not ask your question on the new OpenStreetMap Community Forum?

When i display a map in a div called venuemap, the map is displayed with gaps.



This is the code i use for displaying the map

        /* Open map */
            map = new OpenLayers.Map("venuemap");
            map.addLayer(new OpenLayers.Layer.OSM());

            var lonLat = new OpenLayers.LonLat( venue.location.lng ,venue.location.lat )
                    new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
                    map.getProjectionObject() // to Spherical Mercator Projection

            var zoom=16;

            var markers = new OpenLayers.Layer.Markers( "Markers" );

            markers.addMarker(new OpenLayers.Marker(lonLat));

            map.setCenter (lonLat, zoom);
            /* end open map */

What is wrong with my code? Kind regards brantje

asked 20 Jul '12, 12:40

brantje's gravatar image

accept rate: 0%

The example url seems wrong : no map there.

(20 Jul '12, 13:23) Vincent de P... ♦

Probably your JS code is right, but your HTML style is wrong ? Make sure you set margin and padding to 0 on your map div and the tag surrounding the div.

permanent link

answered 20 Jul '12, 13:26

Vincent%20de%20Phily's gravatar image

Vincent de P... ♦
accept rate: 19%

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](http://url.com/ "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: 20 Jul '12, 12:40

question was seen: 3,063 times

last updated: 20 Jul '12, 13:26

powered by OSQA