{"id":166215,"date":"2013-01-18T12:03:02","date_gmt":"2013-01-18T08:03:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=166215"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=166215","title":{"rendered":"<span class=\"post_title\">\u0413\u0435\u043e\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 OpenLayers<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u043d\u043e \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043f\u043e\u0438\u0441\u043a \u043c\u0435\u0441\u0442\u0430 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 \u043f\u043e \u0435\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0443, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412\u0441\u0435 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenLayers 2.<\/p>\n<p>  \u042f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u0430\u0437\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 OpenLayers \u0438 \u043a\u0430\u0440\u0442\u0430 \u0441\u043e \u0441\u043b\u043e\u044f\u043c\u0438 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0430. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0432\u0441\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0441\u0442\u043e\u0438\u0442 <b>\u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u044f<\/b>. IMHO, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f OL \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0440\u0443\u0434\u043e\u0435\u043c\u043a\u0438\u043c.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442:<\/p>\n<pre><code class=\"javascript\">var control = new OpenLayers.Control.Geolocate(            bind: false,            watch: true,            geolocationOptions: {                     enableHighAccuracy: true,                     maximumAge: 0,                     timeout: 15000                 }); <\/code><\/pre>\n<p>  \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u043a\u0430\u0440\u0442\u0443 (OpenLayersMap \u2014 \u044d\u0442\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u0430\u0440\u0442\u044b \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 OpenLayers.Map(options)):<\/p>\n<pre><code class=\"javascript\">OpenLayersMap.addControl(control); <\/code><\/pre>\n<p>  \u0421 \u044d\u0442\u0438\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u043d\u043e \u0447\u0442\u043e \u0436\u0435 \u0434\u0430\u043b\u044c\u0448\u0435. \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0443\u0436\u043d\u043e \u0435\u0433\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041e\u043f\u044f\u0442\u044c-\u0442\u0430\u043a\u0438, \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"javascript\">control.activate(); <\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0447\u0442\u043e \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u2014 \u044d\u0442\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f:<\/p>\n<pre><code class=\"javascript\">control.events.on({ &quot;locationupdated&quot;: function(e) {                 OpenLayersFunc.Events.GeolocateOnLocationUpdated(e);                 } }) <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0441\u043b\u043e\u0439 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">var layer = new OpenLayers.Layer.Vector('Geolocate', {            styleMap: new OpenLayers.StyleMap(                     new OpenLayers.Style({                                   fillColor: '#000',                                   fillOpacity: 0.1,                                   strokeWidth: 0})                     ) }); OpenLayersMap.addLayer(layer); <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e OpenLayersFunc.Events.GeolocateOnLocationUpdated. \u0421\u0430\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u0430\u043a\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u00ablocationupdated\u00bb, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f event \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u0410 \u0443\u0436\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u0438\u0437\u0433\u0430\u043b\u044f\u0435\u043c\u0441\u044f \u043d\u0430\u0434 \u043d\u0438\u043c, \u043a\u0430\u043a \u0445\u043e\u0442\u0438\u043c. \u041a\u043e\u0434 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043c\u043e\u0442\u0440\u0438\u043c:<\/p>\n<pre><code class=\"javascript\">var vector = OpenLayersMap.getLayersByName('Geolocate')[0]; vector.removeAllFeatures(); \/\/\u043e\u0447\u0438\u0441\u0442\u0438\u043b\u0438 \u0441\u043b\u043e\u0439 \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438 (\u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u0434\u0443\u0431\u043b\u044f\u0436\u0435\u0439) var polygon = OpenLayers.Geometry.Polygon.createRegularPolygon(new OpenLayers.Geometry.Point(e.point.x, e.point.y), e.position.coords.accuracy \/ 2, 40, 0); var circle = new OpenLayers.Feature.Vector(polygon); \/\/\u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u044e \u043a\u0440\u0443\u0433\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043b\u043e\u044f var point = new OpenLayers.Feature.Vector(e.point, {}, {             graphicName: 'cross',             strokeColor: '#f00',             strokeWidth: 1,             fillOpacity: 0,             pointRadius: 8         }); \/\/\u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0430\u043c\u0443 \u0442\u043e\u0447\u043a\u0443 vector.addFeatures([point, circle]); \/\/\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0440\u0443\u0433 \u0441 \u0442\u043e\u0447\u043a\u043e\u0439 \u043d\u0430 \u0441\u043b\u043e\u0439 if (OpenLayersFunc.Events.GeolocateFirstRun) { \/\/\u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043b\u0438 \u043c\u044b \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437             pulsate(circle); \/\/\u0430 \u044d\u0442\u043e \u0443\u0436\u0435 \u043a\u0440\u0430\u0441\u043e\u0442\u0430, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0430\u043b\u044c\u0448\u0435             OpenLayersFunc.Events.GeolocateFirstRun = false;         } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f pulsate \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u043f\u0443\u043b\u044c\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u043a\u0440\u0443\u0433. \u0412 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u0440\u0443\u0433\u0430 \u2014 circle. \u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u043d\u043e:  <\/p>\n<pre><code class=\"javascript\">var pulsate = function(feature) {             var point = feature.geometry.getCentroid();             var bounds = feature.geometry.getBounds();             var radius = Math.abs((bounds.right - bounds.left) \/ 2);             var count = 0;             var grow = 'up';             var resize = function() {                 if (count &gt; 16) {                     clearInterval(window.resizeInterval);                 }                 var interval = radius * 0.03;                 var ratio = interval \/ radius;                 switch (count) {                     case 4:                     case 12:                         grow = 'down';                         break;                     case 8:                         grow = 'up';                         break;                 }                 if (grow !== 'up') {                     ratio = -Math.abs(ratio);                 }                 feature.geometry.resize(1 + ratio, point);                 vector.drawFeature(feature);                 count++;             };             window.resizeInterval = window.setInterval(resize, 50, point, radius);         }; <\/code><\/pre>\n<p>  \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0413\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var layer = new OpenLayers.Layer.Vector('Geolocate', {            styleMap: new OpenLayers.StyleMap(                     new OpenLayers.Style({                                   fillColor: '#000',                                   fillOpacity: 0.1,                                   strokeWidth: 0})                     ) }); OpenLayersMap.addLayer(layer); var control = new OpenLayers.Control.Geolocate(            bind: false,            watch: true,            geolocationOptions: {                     enableHighAccuracy: true,                     maximumAge: 0,                     timeout: 15000                 }); OpenLayersMap.addControl(control); control.activate(); OpenLayersFunc.Events.GeolocateFirstRun = true; OpenLayersFunc.Events.GeolocateOnLocationUpdated = function(e) {         var vector = OpenLayersTools.Layers.GetLayerByName('Geolocate');         var pulsate = function(feature) {             var point = feature.geometry.getCentroid();             var bounds = feature.geometry.getBounds();             var radius = Math.abs((bounds.right - bounds.left) \/ 2);             var count = 0;             var grow = 'up';             var resize = function() {                 if (count &gt; 16) {                     clearInterval(window.resizeInterval);                 }                 var interval = radius * 0.03;                 var ratio = interval \/ radius;                 switch (count) {                     case 4:                     case 12:                         grow = 'down';                         break;                     case 8:                         grow = 'up';                         break;                 }                 if (grow !== 'up') {                     ratio = -Math.abs(ratio);                 }                 feature.geometry.resize(1 + ratio, point);                 vector.drawFeature(feature);                 count++;             };             window.resizeInterval = window.setInterval(resize, 50, point, radius);         };         OpenLayersTools.Layers.ClearLayers(['Geolocate']);         var polygon = OpenLayers.Geometry.Polygon.createRegularPolygon(new OpenLayers.Geometry.Point(e.point.x, e.point.y), e.position.coords.accuracy \/ 2, 40, 0);         var circle = new OpenLayers.Feature.Vector(polygon);         var point = new OpenLayers.Feature.Vector(e.point, {}, {             graphicName: 'cross',             strokeColor: '#f00',             strokeWidth: 1,             fillOpacity: 0,             pointRadius: 8         });         vector.addFeatures([point, circle]);         if (OpenLayersFunc.Events.GeolocateFirstRun) {             pulsate(circle);             OpenLayersFunc.Events.GeolocateFirstRun = false;         }     }; control.events.on({ &quot;locationupdated&quot;: function(e) {                 OpenLayersFunc.Events.GeolocateOnLocationUpdated(e);                 } }) <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u043a \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435\u0439 \u0432\u0435\u0449\u0438 \u2014 <b>\u0433\u0435\u043e\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/b>. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0430\u043f\u0438 \u043e\u0442 \u0433\u0443\u0433\u043b\u043e\u0432 \u0438 \u043d\u0435 \u0436\u0430\u043b\u0435\u044e. \u041d\u0430\u0447\u043d\u0435\u043c:<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u043b\u043e\u0439 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u0430\u0440\u043a\u0435\u0440\u0430 \u0441 \u043f\u043e\u043f\u0430\u043f\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">var layer = new OpenLayers.Layer.Vector('Geocoder', {            styleMap: new OpenLayers.StyleMap(                     new OpenLayers.Style({                                  externalGraphic: '..\/images\/geocoder_marker.png',                                  graphicWidth: 32,                                  graphicHeight: 32,                                  graphicYOffset: -32                     ) }); <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435. \u041e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438 \u0442\u0430, \u043e\u0442 jQuery, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0433\u0435\u043e\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0433\u0443\u0433\u043b\u0430\u043c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u043f\u0430\u0440\u0441\u0438\u043c \u0434\u043b\u044f jquery-ui.autocomplete \u043d\u0430 source. \u0410 \u043d\u0430 select \u0432\u0435\u0448\u0430\u0435\u043c \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u044b \u043d\u0430 \u044d\u0442\u043e\u0442 \u0430\u0434\u0440\u0435\u0441 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0440\u043a\u0435\u0440 \u0441 \u043e\u043a\u043e\u0448\u043a\u043e\u043c \u0430\u0434\u0440\u0435\u0441\u0430:<\/p>\n<pre><code class=\"javascript\">var geocoder = new google.maps.Geocoder(); \/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0433\u0435\u043e\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f     $('#top-search-field').autocomplete({ \/\/\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u043e\u043b\u044e \u0432\u0432\u043e\u0434\u0430         source: function(request, response) { \/\/\u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432             geocoder.geocode({'address': request.term}, function(results, status) { \/\/\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442                 response($.map(results, function(item) { \/\/\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0430\u0434\u0440\u0435\u0441\u043e\u0432                     return { \/\/\u043a\u0430\u043a\u0443\u044e \u043c\u044b \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f autocomplete                         label: item.formatted_address,                         value: item.formatted_address,                         latitude: item.geometry.location.lat(),                         longitude: item.geometry.location.lng()                     };                 }));             });         },         select: function(event, ui) { \/\/\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u043d\u0435\u043a\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430             var layer = OpenLayersMap.getLayersByName('Geocoder')[0];             layer.removeAllFeatures(); \/\/\u043e\u0447\u0438\u0449\u0430\u0435\u043c \u0441\u043b\u043e\u0439 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432             var point_popup = new OpenLayers.LonLat(ui.item.longitude, ui.item.latitude); \/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0434\u043b\u044f \u043f\u043e\u043f\u0430\u043f\u0430             point_popup.transform(new OpenLayers.Projection(&quot;EPSG:4326&quot;), OpenLayersMap.getProjectionObject()); \/\/\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u044e             var point = new OpenLayers.Geometry.Point(ui.item.longitude, ui.item.latitude); \/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u043e\u0447\u043a\u0443             point.transform(new OpenLayers.Projection(&quot;EPSG:4326&quot;), OpenLayersMap.getProjectionObject());             var feature = new OpenLayers.Feature.Vector(point); \/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u043e\u0447\u043a\u0438             var popup = new OpenLayers.Popup.FramedCloud('geocoder_marker', point_popup, new OpenLayers.Size(200, 50), ui.item.label, null, false, true); \/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043f\u0430\u043f             OpenLayersTools.BaseFunc.CenterMap(ui.item.longitude, ui.item.latitude, 'EPSG:4326'); \/\/\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u0445 \u0430\u0434\u0440\u0435\u0441\u0430             popup.closeOnMove = true; \/\/\u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043f\u0440\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u0430\u0440\u0442\u044b \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u043f\u043e\u043f\u0430\u043f             OpenLayersMap.addPopup(popup);             layer.addFeatures(feature); \/\/\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430 \u043a\u0430\u0440\u0442\u0443 \u0438 \u0441\u043b\u043e\u0439         }     }); <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u0430\u0436\u0435 \u043d\u0435\u0437\u0430\u0447\u0435\u043c \u0432\u0435\u0448\u0430\u0442\u044c, \u043e\u043d \u0438 \u0442\u0430\u043a \u0432\u0435\u0441\u044c \u0441\u0432\u0435\u0440\u0445\u0443 \ud83d\ude42<\/p>\n<p>  P.S. \u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u043d\u0435 \u0437\u043d\u0430\u044e, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438\u043b\u0438 \u043d\u0435\u0442. \u041d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0436\u0434\u0443 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043a\u0440\u0438\u0442\u0438\u043a\u0438, \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f \ud83d\ude42    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/166215\/\"> http:\/\/habrahabr.ru\/post\/166215\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u043d\u043e \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043f\u043e\u0438\u0441\u043a \u043c\u0435\u0441\u0442\u0430 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 \u043f\u043e \u0435\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0443, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412\u0441\u0435 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenLayers 2.<\/p>\n<p>  \u042f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u0430\u0437\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 OpenLayers \u0438 \u043a\u0430\u0440\u0442\u0430 \u0441\u043e \u0441\u043b\u043e\u044f\u043c\u0438 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0430. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0432\u0441\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-166215","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/166215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=166215"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/166215\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=166215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=166215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=166215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}