Skip to content

Instantly share code, notes, and snippets.

@Alex-Space
Last active March 31, 2016 05:01
Show Gist options
  • Save Alex-Space/a6ff9f9f0463577ccfbf8c3d5019c369 to your computer and use it in GitHub Desktop.
Save Alex-Space/a6ff9f9f0463577ccfbf8c3d5019c369 to your computer and use it in GitHub Desktop.
javascript-cheatsheet
<?php
/**
* Template name: Контакты
*/
get_header(); ?>
<!-- SECTION map begin -->
<section>
<div class="container section-container map-section-container">
<div class="map-section-area">
<div id="map"></div>
<div class="content">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
</div>
</div>
</div>
</section>
<!-- SECTION map end -->
<script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
<script type="text/javascript">
ymaps.ready(init);
var commonContent = ymaps.templateLayoutFactory.createClass('<div class="icn_content">$[properties.iconContent]</div>');
var hoverContent = ymaps.templateLayoutFactory.createClass('<div class="icn_content hover">$[properties.iconContent]</div>');
var myMap,
placemark;
function init(){
myMap = new ymaps.Map("map", {
center: [54.95400906068404, 73.27880021166989],
zoom: 16,
controls: []
});
placemark = new ymaps.Placemark([54.95475, 73.274852], {
balloonContent: 'улица 22 декабря, 100',
hintContent: 'улица 22 декабря, 100'
}, {
preset: 'islands#redDotIcon',
});
myMap.geoObjects.add(placemark);
}
</script>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment