Sunday, August 3, 2014

The control of provincial and district Start by creating alice friedland Kendo data source with loa

Location Picker created by KendoUI + GoogleMap | KendoUI.in.th.
Nowadays, if we have the coordinates of the place where the Lat and Lng with Navigation. Regards to that location. Do not worry, it's easy to get lost as before. If your friends want to do. The type of people to enter the location. It would look great User Interface to allow users to specify the position we have available. So today I would like to begin by creating a UI for the first article to get information and road district, and coordinates as latitude and longitude using Google Maps it KendoUI with web developers. I try to study
Kendoui alice friedland GoogleMap Location picker Features information 5 at the province, district, street, Latitude, Longitude with Google Map, right-click the map to select location. Select the name of the province and district forms a Dropdown List, select the form name, province and district. Allows users to type with. Select a province Load the list, select a district alice friedland with Ajax Autocomplete now complete with street names to enter text. Select a province or district Or enter your street Zoom in the map with a search box to help users find their place in GoogleMap.
Components that we need to be on file with the Kendo UI and Jquery jquery-1.7.1.js kendo.core.js kendo.data.js kendo.popup.js kendo.list.js kendo.autocomplete.js kendo.combobox. . js php file for loading the province and district names database province.php amphur.php Google Map API v3 database name, province and district names Download at http://www.thaicreate.com/free-web-script/. alice friedland thailand-province-database.html
The default value of the lat and lng coordinates defined as 13.79,100.92 which is the center of the country. Default values of a map
The control of provincial and district Start by creating alice friedland Kendo data source with loading alice friedland the province of url defined by the data is in the form json (the array is written with the syntax of javascript), then create alice friedland Kendo Combobox alice friedland binding to province_id and to be on there. changes To send the query to google map then make amphur_id become Kendo combobox and load a list and put in the same district var data_province = new kendo.data.DataSource ({transport: {read: {url: "http://. kendoui.in.th / example / locationpicker / province.php ", dataType:" json "}}}); alice friedland $ (" # province_id "). kendoComboBox ({index: -1, dataTextField:" province_name ", dataValueField:". province_id ", dataSource: data_province, filter:" contains ", change: function () {document.getElementById ('searchmap'). value = $ (" # province_id "). data (" kendoComboBox "). text (); showAddress. (); / / my Google map search function var data_amphur = new kendo.data.DataSource ({transport: {read: {url: "http://kendoui.in.th/example/locationpicker/amphur.php?pid =. "+ $ (" # province_id "). val (), dataType:" json "}}}); $ (" # amphur_id "). kendoComboBox ([]); $ (" # amphur_id "). kendoComboBox ({index. : -1, dataTextField: "amphur_name", dataValueField: "amphur_id", dataSource: data_amphur, filter: alice friedland "contains", change: function () {document.getElementById ('searchmap'). value = $ ("# province_id"). . data ("kendoComboBox"). text () + '' + $ ("# amphur_id"). data ("kendoComboBox"). text (); showAddress alice friedland (); / / my Google map search alice friedland function}});}. });
In the text input box to enter the street name is common, but this is not a autocomplete using ajax, but the method of determining the name of the road into a javascript variable instead, but the same. When the value changes It provides a road name to search in google map as well / / road var road_data = ["Phet", "Ngam", "Khao", "Soi", "Pracha", "Borom", "param 1". , "Rama 2", "Rd. alice friedland 3 "," Rama 4 "," Rama 5 "," Rama 6 "," Rd "," C "," Bangkok "," Friendship "," Ram "," Rajvithi "," Lat "," Fl "," Bangkok "," Bank "," Bangkok "," windmill ". , "Bangkok", "Rd", "Bangkok - Bang", "Kan Rd", "Bangkok - Chonburi", "position", "initiative", "Bangkok", alice friedland "C"]; $ ("# Road"). KendoAutoComplete ({dataSource: road_data, change: function () {document.getElementById ('searchmap'). Value = $ ("# province_id"). Data ("kendoComboBox"). Text (). + '' + $ ("# amphur_id"). data ("kendoComboBox"). text () + '' + $ ("# road"). val (); showAddress alice friedland (); / / my Google map search function}. }); $ ("# road"). change (function () {document.getElementById ('searchmap'). value = $ ("# province_id"). data ("kendoComboBox"). text () + '' +. $ ("# alice friedland amphur_id"). data ("kendoComboBox"). alice friedland text () + '' + $ ("# road"). val (); showAddress (); / / my Google map search function});
6th., And indispensable is function initialize () to control the functions of googlemap In this section, insert an explanation in comment here var map; var marker; var geocoder; / / start functions. The function initialize () {/ / retrieve the lat, lng, starting from a lat, lng var latlng = new google.maps.LatLng (document.getElementById ('lat'). value, document.getElementById ('lng'). value); / / set the style google map var myOptions = {disableDefaultUI: alice friedland true, panControl: true, mapTypeControl: true, zoomControl: true, zoomControlOptions: {style: google.maps.ZoomControlStyle.SMALL,}, zoom: 5, center. alice friedland : latlng, mapTypeId: google.maps.MapTypeId.ROADMAP}; / / bind Google map with div map_canvas map = new google.maps.Map (document.getElementById ("map_canvas"), myOptions.

MORE



No comments:

Post a Comment