Google Maps API with a Django Website - javascript

I am building a small website and am using the Django framework for my development. Parts of the site also includes using Google Maps APIs (V3), which includes using MySQL to add and save marker information as shown within the official Google documentation here: https://developers.google.com/maps/articles/phpsqlinfo_v3
I have the basic maps working fine with being able to add a marker when it is clicked, but am having difficulties to get it to work since trying to implement the MySQL into it - the map does not load within the canvas on the page. I have copied the code exactly from the link above just to see if i could get it working basic but no joy.
Before I go posting up snippets of code here and there, I'm just wondering if maybe there might be a problem in the MySQL working within the Django development - I have a MySQL database synced with Django and have it running.
If there is any other way around getting markers and information to save to a map, like the example above, it would be great but I cant find anything anywhere.
I also looked at this guide but with similar results:
http://www.sanwebe.com/2013/10/google-map-v3-editing-saving-marker-in-database

Related

What technology/strategy should I use to render big GeoJSON files within google maps

I'm currently working on a project to display enriched geographical data within an interactive map. For example, I have housing blocks with additional information added, and I want to display this data within an interactive map. I chose google maps, because I don't have any experience in building a map-based webservice and google seemed to be easy accessible and working.
The problem comes with the amount of information i have. A single town like Berlin has about 450.000 geometrys, which results in a GeoJSON file roughly 170MB big. I know, that this isn't anywhere near to working.
Do you guys can give me a hint on how to structure the project? What kind of technology can I use to dynamically query the needed data? Are there any libraries or working solutions that I should give a try?
How I solved this issue:
I used mapnik to pre-render the tiles and displayed them in google maps using getTileURL. I used this tutorial, which explains the basics on how to use mapnik for google map tiles.

Edit a google spreadsheet using javascript/client side code

I am new to google spreadsheets.
I am trying to use them for a small website where instead of maintaining a DB, I am storing and fetching data from sheets using APIs.
I found this library - https://github.com/mikeymckay/google-spreadsheet-javascript , for fetching data from a published sheet.
It serves my purpose of doing everything in the browser.
But I am not able to figure out how can I write data to same/different spreadsheet.
Do I use Sheet APIs? Can I also do it using App Script ? Is there a ready to use library for the same ?
Can someone please help?
You'd likely want to check out the Google Drive API, rather than Google Apps Scripts. I don't have much experience with it, especially in regards to using it on a website, but that's the best direction to head in.

App script to insert Google Form data into Cloud SQL table (Google Developer's Console)

I am very new to Java and scripts in general, but I am trying to create an app that takes the data from a sites.google website form and places the data into a table within Cloud SQL.
I have successfully created 3 tables (linked with foreign keys) in a database within a Cloud SQL instance on Google's developer console.
The entries in the form correspond to the different headers in the database table, so the data should drop into the appropriate column.
I have tried many of the quickstart and other tutorials within the developer's console documentation links and on the web, but none of them really help me with what I am trying to accomplish..
I have been playing around with code in scripts.google, but haven't really gotten anywhere. Because I am unfamiliar with scripts, I don't know whether I should be using JavaScripts, PHP, python. I've seen tutorials using eclipse and maven but have not been successful/found them helpful.
Hoping someone can steer me in the right direction..
Any feedback or examples I can refer to would be greatly appreciated!

How can I get a client location using the Google Map (Geocoding) Javascript API using pure javascript?

There are plenty of examples all over the internet, including stakoverflow, of getting location information. But every single one that I find uses HTML to include the library (<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>) and display the information. I need to get the client location from a script, not a web page. I just need to get the location information - I don't need to display it. No HTNML - just javascript.
I've tried several of the examples found on this site, but they all use the navigator.geolocation or google.maps classes, neither of which are recognized by Google Scripting. I've tried to include a resource, but maps nor navigator or any of the required APIs are in the list. I've even attempted to find a RESTful way to use the API and get a JSON response; found nothing even close.
The example used in several places is this one on developers.google.com, including several appearances in stackoverflow like this one.
I suppose it could be a very "newbie" issue, but I'm flummoxed!

Google APIs JS File

In building a Google Commerce Search search form, one of the pieces of code Google instructed us include was located at this address:
http://ajax.googleapis.com/ajax/libs/googleapis/0.0.4/googleapis.min.js
I'm getting a javascript error that seems to be emanating from this javascript file and I was wondering if this is the latest version of said javascript file? If not, can someone direct me as to where the latest version of this google api JS file lies?
P.S. I have been unable to get any conclusion from Google that this is the correct, most-up-to-date version of the file.
If you are looking after google search API - this is the location to find the latest:
https://developers.google.com/custom-search/v1/overview
In case you need some other APIs checkout their new location at:
https://developers.google.com/ you will have there a list of all the (many) APIs.

Categories