# How to get rid of unwanted lines appearing in tilemap when used in cocos2d js

**URL:** <https://discourse.mapeditor.org/t/how-to-get-rid-of-unwanted-lines-appearing-in-tilemap-when-used-in-cocos2d-js/1040>\
**Category:** Questions\
**Created:** [January 19, 2016, 6:40am UTC](https://discourse.mapeditor.org/t/how-to-get-rid-of-unwanted-lines-appearing-in-tilemap-when-used-in-cocos2d-js/1040 "2016-01-19T06:40:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prachi\_Joshi](https://avatars.discourse-cdn.com/v4/letter/p/c67d28/32.png) [@Prachi\_Joshi](https://discourse.mapeditor.org/u/Prachi_Joshi)\
**Post date:** [January 19, 2016, 6:40am UTC](https://discourse.mapeditor.org/t/how-to-get-rid-of-unwanted-lines-appearing-in-tilemap-when-used-in-cocos2d-js/1040/1 "2016-01-19T06:40:27Z")

</div>

Hi I have created a tilemap in cocos2d js. but when i run my project unwanted black lines appear in the map. no matter how many times i edited my tileset. how to get rid of these lines?

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [January 19, 2016, 8:51pm UTC](https://discourse.mapeditor.org/t/how-to-get-rid-of-unwanted-lines-appearing-in-tilemap-when-used-in-cocos2d-js/1040/2 "2016-01-19T20:51:24Z")

</div>

Usually this has something to do with OpenGL texture filtering, if you’re not rendering your tiles 1:1 or exactly on pixel positions.

If you can’t fix it by adjusting the scale or rounding the position to whole pixels, you can usually still work it around by modifying your tileset so that the tiles have 2 pixels of spacing in between, where each pixel in this spacing should match its color with the nearest neighbour pixel on a tile. This is something you’ll want to automate, or find a tool that can do it for you. In Tiled, you can either keep using your original tileset or use the one with spacing added and set the spacing in the tileset properties.

In general, this is not Tiled’s issue and you may receive a more specific or relevant answer by asking in the [cocos2d-js community](https://forum.cocosengine.org/c/cocos2d-x/javascript/10). See:

> **[How can I avoid lines between tiles after I modify the scale of TileMap?](https://forum.cocosengine.org/t/how-can-i-avoid-lines-between-tiles-after-i-modify-the-scale-of-tilemap/535)**
>
> I have attached the screenshot. What can I do? 未命名.PNG (48.4 KB)

> **[Weird grid lines on tilemap](https://forum.cocosengine.org/t/weird-grid-lines-on-tilemap/4158/2)**
>
> Does anyone know of a way to fix this? (Or why it happens?)
