-1

I have tried to change the language of my map from hebrew to english. can someone help?

<html>
  <head>
    <title>OpenLayers Demo</title>
    <style type="text/css">
      html, body, #basicMap {
          width: 100%;
          height: 100%;
          margin: 0;
      }
    </style>
    <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
    <script>
      function init() {
        OpenLayers.Lang.setCode("en");
        map = new OpenLayers.Map("basicMap",{ controls: [] });

        map.addControl(new OpenLayers.Control.PanZoomBar());
        map.addControl(new OpenLayers.Control.LayerSwitcher());

        var wms = new OpenLayers.Layer.OSM();

        map.addLayer(wms);
        map.setCenter(new OpenLayers.LonLat(34.78049,32.08012).transform(
            new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
            new OpenLayers.Projection("EPSG:900913") // to Spherical Mercator Projection
          ), 15);

      }
    </script>
  </head>
  <body onload="init();">
    <div id="basicMap"></div>
  </body>
</html>

asked 15 Dec '10, 23:05

loren2978's gravatar image

loren2978
0111
accept rate: 0%

edited 16 Dec '10, 15:25

TomH's gravatar image

TomH ♦♦
3.2k83541


2 Answers:
2

If you mean that you want the names on the map to appear in a different language then the answer is that you can't if you're using our tiles (which the OpenLayers OSM layer does) as we only render one set of tiles and the names are part of the tile images.

So you would need to render your own tiles, or find somebody that has rendered some in the language you want and is prepared to let you use them, and then configure OpenLayers to display them.

permanent link

answered 16 Dec '10, 15:24

TomH's gravatar image

TomH ♦♦
3.2k83541
accept rate: 20%

-5

There used to be maps in many languages on http://cassini.toolserver.org/tile-browse/ - Does anybody know what has happened to them?

permanent link

answered 07 Jan '11, 14:45

Kartograefin's gravatar image

Kartograefin
577178
accept rate: 0%

1

This isn't answer to the original question, it's a new question.

(07 Jan '11, 14:56) TomH ♦♦
1

They have moved to http://toolserver.org/~osm/locale/

I am not sure though what their (wikimedia's) tile usage policy is with respect to using in external projects, and if their english tiles ( http://toolserver.org/~osm/locale/en.html ) could be used in the case of this question

(09 Jan '11, 12:56) apmon

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:

×117
×64
×1

question asked: 15 Dec '10, 23:05

question was seen: 13,734 times

last updated: 09 Jan '11, 12:56

powered by OSQA