how to have live response from kml file in google map for drawing polygon?

i found out for having a polygon shape in google map we could use kml file ... there is good document for it ... official document ... i understood basic of kml ...we should create kml file and link or map to it ... for any change we should refresh the HTML page too see changes.right? then i found a web site that we could create polygon and circle without need any refreshing ... in this site ... i analyzed the source of that page ... it was not link to any kml file!!!!!!! how it happened ?? how could i create polygon like that whiteout need for refreshing?

Answers


Well you definitely should avoid doing full page reloads just to make small changes in your map/document. I suspect you want to do one of two things: 1) Pull map data in from some other source (preferably a database or a feed of some kind) and programmatically render features in the map. Or 2) allow users to manually "digitize" features so you can save them to a database.

Either way, the task requires JavaScript solutions.

Programmatically Drawing Features with JavaScript

This page from the Google maps documentation shows how you can take an array of points and instantiate a vector feature (i.e. points, polylines, and polygons), specifically a polygon, in a JavaScript function:

https://developers.google.com/maps/documentation/javascript/examples/polygon-arrays

Manually Drawing Features in the Map (i.e. Digitizing)

Here are two examples showing how to interact with the map by harnessing mouse events and manually draw features in the map. Once you have complete features, you can optionally save them to a database.

This one, from Google's documentation, shows how to interactively draw a polyline:

https://developers.google.com/maps/documentation/javascript/examples/polyline-complex

And this one, from a more obscure repository of Google maps examples, shows how to interactively draw polygons:

http://gmaps-samples-v3.googlecode.com/svn/trunk/poly/poly_edit.html


Need Your Help

Radio Button value retrieval using servlets

java servlets button radio

I'm quite new to the process of web development, so I apoligise if this seems a really silly question.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.