Hi,
I'm a new user to zoho, I'm having some issues working out how to get my addresses to show as a placemarker in googlemaps (my address is formatted as 1 field is the number of the house, 1 field is the address and 1 field is the surburb).
I have seen this in the forum - but where do I enter this info? Do I have to create a new HTML view? if someone could please walk me thru where I type this code and get it to work, that would be much appreciated.
Will this code pull in other fields info? (such so info that I want to show up in the google map)
---------------------------------
Function for generating
authoization header
Copy code
- string googlemap.getGoogleAuthToken(string email, string passwd, string GoogleService)
- {
- accountType = "HOSTED_OR_GOOGLE";
- url = "https://www.google.com/accounts/ClientLogin?accountType=" + accountType + "&Email=" + email + "&Passwd=" + passwd + "&service=" + input.GoogleService; // Check GDATA API for service codes
- response = getUrl(url);
- authToken = response.getSuffix("Auth=").trim(); // Store this Authorization for subsequent request
- return authToken;
- }
Function to retrive the latitude and langitude for address (
Geocoding requests).
Copy code
- map googlemap.getLatitudeAndLangitudeMap(string address)
- {
- latandlngXml = getUrl("http://maps.google.com/maps/api/geocode/xml?address=" + input.address + "&sensor=true"); // Retriving xml containing latitude and langitude xml
- latitude = latandlngXml.executeXPath("/GeocodeResponse/result/geometry/location/lat/text()");
- langitude = latandlngXml.executeXPath("/GeocodeResponse/result/geometry/location/lng/text()");
- return { "latitude" : latitude, "langitude" : langitude};
- }
Function for adding PlaceMarks to GoogleMap.
Copy code
- void googlemap.createMapAndAddPlaceMark(string mapName, string placeTitle, string address)
- {
- GoogleAuthToken = thisapp.googlemap.getGoogleAuthToken("xxx@gmail.com", "yyy", "local");
- //HeaderParams included
- headerMap = { "Authorization" : "GoogleLogin auth=\"" + GoogleAuthToken + "\"", "Content-Type" : "text/csv", "Slug" : input.mapName };
- latAndLanMap = thisapp.googlemap.getLatitudeAndLangitudeMap(address);
- latitude = latAndLanMap.get("latitude");
- langitude = latAndLanMap.get("langitude");
- //CSVMap Data Generating
- title = input.placeTitle;
- placeDesc = (input.address).replaceAll(","," ");
- csvMapData = "name,latitude,longitude,description\n" + title + "," + latitude + "," + langitude + "," + placeDesc;
- //Adding GoogleMap into MyMaps to the AuthenticatedUser.
- result = postUrl("http://maps.google.com/maps/feeds/maps/default/full", csvMapData, headerMap,false);
- info result.get("responseText");
- info result.get("responseCode");
- }
--
Thanks