Jump to content
Дизайн и модификация Invision Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
ljuter

Как вставить на страницу яндекс или google карту?

Recommended Posts

Как на страницу IP.Content вставить google map или yandex map? Например сгенерировал код карты на яндексе, вставил на страницу (в режиме редактирования кода), но в итоге получил только последнюю строку с сылкой на яндекс. При проверке кода оказалось что остальной код попросту исчез :(

 

Пример кода карты яндекса:

<!-- Этот блок кода нужно вставить в ту часть страницы, где вы хотите разместить карту  (начало) -->
<script src="http://api-maps.yandex.ru/1.1/?key=API_Key&modules=pmap&wizard=constructor" type="text/javascript"></script>
<script type="text/javascript">
   YMaps.jQuery(window).load(function () {
       var map = new YMaps.Map(YMaps.jQuery("#YMapsID-2234")[0]);
       map.setCenter(new YMaps.GeoPoint(45.110914,147.85208), 17, YMaps.MapType.MAP);
       map.addControl(new YMaps.Zoom());
       map.addControl(new YMaps.ToolBar());
       YMaps.MapType.PMAP.getName = function () { return "Народная"; };
       map.addControl(new YMaps.TypeControl([
           YMaps.MapType.MAP,
           YMaps.MapType.SATELLITE,
           YMaps.MapType.HYBRID,
           YMaps.MapType.PMAP
       ], [0, 1, 2, 3]));

       YMaps.Styles.add("constructor#pmlbmPlacemark", {
           iconStyle : {
               href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmlbm.png",
               size : new YMaps.Point(28,29),
               offset: new YMaps.Point(-8,-27)
           }
       });

      map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(45.110914,147.85208), "constructor#pmlbmPlacemark", "Наш офис"));

       function createObject (type, point, style, description) {
           var allowObjects = ["Placemark", "Polyline", "Polygon"],
               index = YMaps.jQuery.inArray( type, allowObjects),
               constructor = allowObjects[(index == -1) ? 0 : index];
               description = description || "";

           var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
           object.description = description;

           return object;
       }
   });
</script>

<div id="YMapsID-2734" style="width:450px;height:350px"></div>
<div style="width:450px;text-align:right;font-family:Arial"><a href="http://api.yandex.ru/maps/tools/constructor/" style="color:#1A3DC1">Создано с помощью инструментов Яндекс.Карт</a></div>
<!-- Этот блок кода нужно вставить в ту часть страницы, где вы хотите разместить карту (конец) -->

Share this post


Link to post

Создайте блок - custom

Засуньте туда свой код. И выводите на страницу уже код блока.

 

Видео - как добавить блок

  • Upvote 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...