This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function initialize() { | |
map = new google.maps.Map(document.getElementById("your_map_canvas")); | |
// example => geocoding('China Beijing') | |
function geocoding(address){ | |
geocoder.geocode( {'address': address }, function(results, status) { | |
if(status == google.maps.GeocoderStatus.OK){ | |
$.map(results, function(item) { | |
map.setCenter(new google.maps.LatLng(item.geometry.location.lat(),item.geometry.location.lng())); | |
map.setZoom(item.address_components.length * 2 + 3); | |
marker.setPosition(map.getCenter()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# useage: | |
#copy code to your .vimrc | |
#when you edit text in line > I`m a title | |
#command :H h1 | |
#<h1>I`m a title</h1> | |
function! HtmlTag(tag) | |
normal $ | |
execute "normal! a</".a:tag.'>' | |
normal ^ |