Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've just recently started learning Google maps, JavaScript, etc., and have a few questions about a project that I'd like to do. I'm wanting to take some ESRI shapefiles, convert them to KML, and then make it so that they can be edited online through Google Maps. I'm okay getting them from shapefiles to KML, but unsure about what the best way is (or if it's possible) to make them editable.

Here are some more details:

  • I don't mind if the data are transmitted/stored on Google's servers--as they are not confidential.

  • I just need to be able to have polygons on an embedded Google map that can be saved/stored and edited on a monthly basis. The end goal is the be able to answer, "In which zone does this address fall?".

  • I want to be able to do a local search on the page, and then see in which polygon the address falls.

  • The ability to set up buttons that would allow me zoom to specific polygons and print them would be a plus.

I've checked out Google Map Maker, as well as Google My Places. I think My Places might work, but I would definitely need to make some tweaks.

Thanks!

share|improve this question
    
Definitely not a simple question, although there is not much detail provided. Can you tell us any more about this project and its purpose and goals? –  blah238 Feb 16 '13 at 14:41
    
The question may be too broad to be reasonably answered here without breaking it up into several, more focused questions once you have considered some basic but important details. For example, what do you want to happen once the KML features have been edited? Where are they stored? Are you okay with your data being transmitted to and stored on Google's servers, or is it sensitive and needs to be secured? Do you have a database somewhere this data needs to be stored in, and if so does it need to be "live", i.e. you edit a feature and it's updated in real time? –  blah238 Feb 16 '13 at 14:42
    
Here are some more details: –  b-rad-b Feb 16 '13 at 18:30
    
I don't mind if the data are transmitted/stored on Google's servers--as they are not confidential. I just need to be able to have polygons on an embedded Google map that can be saved/stored and edited on a monthly basis. The end goal is the be able to answer, "In which zone does this address fall?". I want to be able to do a local search on the page, and then see in which polygon the address falls. Additionally, the ability to set up buttons that would allow me zoom to specific polygons and print them would be a plus. –  b-rad-b Feb 16 '13 at 18:37
    
You can and should edit your question to add such details. This makes it easier for other readers to see all the important information at once instead of having to sift through comments. –  blah238 Feb 16 '13 at 19:39
add comment

2 Answers

Google Map Maker is for editing Google's map data, not your own. The My Maps feature under My Places is what you are probably looking for.

Once you have created a map in My Maps you can edit existing features: Edit map features

share|improve this answer
add comment

Once the Shapefile is in KML format you can edit polygons and polylines in Google Maps API v3:

This example uses javascript and php (not python)

// the php function simplexml_load_file() is used to load and read the kml-file
function addOverlayFromKML() {
    var jsfromphp = [[new GLatLng(-7,-38), new GLatLng(-5.26601,-44.29688), new GLatLng(-17.64402,-47.46094), new GLatLng(-15.2,-59.5), new GLatLng(-40,-68), new GLatLng(-40.6,-62.2), new GLatLng(-38.75408,-62.40234), new GLatLng(-38.16911,-57.87598), new GLatLng(-38.09998,-57.70020), new GLatLng(-36.73888,-56.51367), new GLatLng(-34.27084,-58.31543), new GLatLng(-34.70549,-54.88770), new GLatLng(-27.87793,-48.69141), new GLatLng(-23.60426,-48.03223), new GLatLng(-21.45307,-42.49512), new GLatLng(-7,-38)]];
    for (var i = 0; i<1; i++) {
        Shape[i] = new GPolyline(jsfromphp[i],lineColor,lineWeight,opacity);
        map.addOverlay(Shape[i]);
        Shape[i].id = i;
        // first time the mouse pointer touches a line, its coordinates will be written in the textarea
        GEvent.addListener(Shape[i], "mouseover", function() {
            if(polyPoints.length == 0){
                editing = true;
                var j = this.getVertexCount(); // get the amount of points
                for (var i=0; i<j; i++){
                    polyPoints[i] = this.getVertex(i); // update polyPoints array
                }
                polyShape = this;
                logCoordinates();
                polyShape.enableEditing();
                editlistener = GEvent.addListener(polyShape,'lineupdated',updateCoordinates);
                GEvent.addListener(polyShape, "click", function(latlng, index) {
                    if (typeof index == "number") {
                        polyShape.deleteVertex(index);
                        updateCoordinates();
                    }
                });
            }
        });
    }
    jsfromphp = [];

Example Source (documented well in the source code: http://www.birdtheme.org/useful/editkmlfile.php

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.