Map Input (Forms)

Map Input is a plugin used for adding a map input into html forms. It’s useful for situations when you need to get geographical position from the user by alllowing selection of a position on the map (google maps). The map input field has 3 hidden inputs used for latitude, longitude, and map zoom level. Following is a sample call to the plugin (including all the options with their default values):

$(function(){
    $('.mapinput').mapinput({
        width:'600px', // map width
        height:'450px', // map height
        latInput:"map_lat", // latitude input name
        lngInput:"map_lng", // longitude input name
        zoomInput:"map_zoom", // zoom level input name
        initPos:[0,0], // initial position as [latitude,longitude]
        initZoom:1, // initial zoom level
        navigationControl:true, // navigation control showing option
        scaleControl:true, // scale control showing option
        pointerTitle:"Drag or click new position" // text used for position pointer (when mouse is over)
    });
});


Download Map Input (Forms)

Leave a Reply

Your email address will not be published. Required fields are marked *