Sunday, June 5, 2011

Text images without (much) coding

Wednesday, April 02, 2008at8:48:00 PM

Posted by Mano Marks, Google Geo APIs Team

Valery Hronusov has created a cool visual interface for his Text to Image service. This service allows you to easily create a text image, control its color, add shadow effects, and then place it on directly a map. It outputs to KML, Maps API JavaScript code, or just a plain URL to an image. This is really useful to creating, for instance, road labels or text based ScreenOverlays. All you have to do is copy the output into your own code. The interface is pretty simple:

Here's a sample of the KML output:

... http://text2image.ning.com/TextToImage.php?text=San+Francisco%2C+here+we+come%21&LabelType=2&FontSize=24&casing=asis&alignment=1&font=arial&fontStyle=bold&LabelLocation=topleft&dX=11&dY=0&FontColor=00ff00f9&ShadowColor=00000000&depth=3&effect=0&LabelHeight=35&LabelWidth=438&IconHeight=18&IconName=http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png

Here's a sample of the JavaScript code it creates:

var pointCenter = new GLatLng(37.775196,-122.419204);var map = new GMap2(document.getElementById("map"));map.setCenter(pointCenter, 10);var pointSW = new GLatLng(37.741743,-122.470044);var pointNE = new GLatLng(37.786659,-122.272387);var groundOverlay = new GGroundOverlay( "http://text2image.ning.com/TextToImage.php?text=San+Francisco%2C+here+we+come%21&LabelType=2&FontSize=24&casing=asis&alignment=1&font=arial&fontStyle=bold&LabelLocation=topleft&dX=11&dY=0&FontColor=00ff00f9&ShadowColor=00000000&depth=3&effect=0&LabelHeight=35&LabelWidth=438&IconHeight=18&IconName=http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png", new GLatLngBounds(pointSW, pointNE));map.addOverlay(groundOverlay);

And here's what it looks like:

Permalink

Labels:Google Maps,Images,KML

Newer PostOlder PostHome Site Feed
Add to Google

More Blogs from GoogleVisit our directory for more information about Google blogs.ArchivesArchivesMay (9)April (6)March (6)February (7)January (7)December (6)November (5)October (7)September (7)August (6)July (9)June (11)May (7)April (8)March (7)February (5)January (4)December (1)November (5)October (3)September (6)August (3)July (3)June (5)May (4)April (7)March (5)February (3)January (1)December (3)November (2)We Love Feedback

Discuss the Maps API in the official discussion group, or contact us if you have any questions about this blog.

LinksGoogle CodeGoogle Maps APIDocumentationDiscussion GroupWhat We're ReadingGoogle Maps ManiaGoogle SightseeingGoogle Earth BlogMore Google Dev Blog PostsRead more...
Google Maps API Blog is powered by Blogger. Start your own weblog.

Powered By Blogger Copyright © 2008 Google Inc. All rights reserved.
Privacy Policy | Terms of Service

No comments:

Post a Comment