Building extensive google maps based application - php

I'm working now on google maps, I'm trying to build something not even half as extensive but something on the lines of http://wikimapia.org/. Ok I'm not going to be building the whole app haven't got that much time on my hands. However the application I'm working on has users signing up and they would be able to pin point and create locations on a google map which would be stored in my back-end database.
Plus there would be a search option whereby a user could search for a specific place and all list of matching entries would be displayed as an 'overlay' to the map and all places would be highlighted on the map.
Also if you've noticed how wikimapia works - you can add a place by virtually clicking and dragging on the map itself as opposed to adding in coordinates on some complicated form and the search is embedded within the map and not outside.
Now I have an idea of integrating basic google maps - no biggie there but this is not just a simple integration procedure. Does anyone have any idea what I need to do here.
I'm working on Php and using JQuery for javascripting.
Thanks for the response - however my query was different in this respect that my application is such that we would have users signing up and they would come and pint point and create new locations on the map so basically its not one user - all the coordinates would be entered by the users in a 'click your place on the map' kind of way and we would like to be able to overlay all those details upon the map as well as categorise like lets say - show all places on the map where theres a birthday party, or show all internet cafes on the map - i.e. all these details are entered by users.
Maybe I'm missing something here - but I'm looking to make a simplified watered down version of wikimapia here.

If you want to integrate with Google Maps, I think the best place to get started is the source: http://code.google.com/apis/maps/, specifically the documentation and API reference. Get yourself a key, drop one of the examples into your page and start tweaking.
For your points, you'll basically store coordinate information (lat/long), plus whatever information you want to display. You can even have custom map tiles (the pictures of the world), or custom map overlay tiles (transparent additions to the displayed world). It really is a quite flexible API for mapping things.
When you run into a specific issue, ask.

Related

Use own map like Google map. Collect and process data when visitors click spots on map

I am doing a website project related with travel. I think a long time, searching on the web for a long time. However I still have no idea how to get started. I really need help.
A brief description of my travel project first.
I need to use my own map. It can be zoomed in or zoomed out like Google Map. On the map there are many scenery spots, like spot A, spot B, spot C, etc....
When visitors open the map, click on the spots, for example, spot Y, spot A, spot M, etc.... I need to get which spots they clicked on, group all data, and finally write the data into MySQL database.
Here's what I find up to now:
I find many jQuery plugins and tools, like OpenLayers, mapTiler, mapBox, etc.. They all use Google Map, Open Street Map, and other maps, but not allow to use own map.
I also find Gmap Image Cutter which can cut my large map into tiles and display on the web. However the map cannot be clicked on get the data as required.
My questions:
I can master PHP and jQuery.
Could someone give me some idea how to get started?
Which tool or plugins can best accomplish my projects?
Thanks
The Google Maps JavaScript API provides an OverlayView class for creating your own custom overlays.
Link to doc: https://developers.google.com/maps/documentation/javascript/customoverlays#subclass
Link to example: https://developers.google.com/maps/documentation/javascript/examples/overlay-hideshow
And last, but not least, Google Maps can be embedded into your website: https://developers.google.com/maps/documentation/embed/

How does one add banner advertisement like facebook?

What I am trying to do is give companies an option to show their ads on my website, like how Facebook does. I have a user based website, so there are many different pages.
If I have to guess, it would go something like this.
Step 1. Company creates an Ad(with different payment options).
Step 2. The Ad is added to a mysql table.
Step 3. The Ads are shown across the website, depending on the algorithm.
Now I would need to know a more detail way of doing it. Are there any good resources I can study?
Well, you have multiple options. The easiest is to just use an existing ad-company like Google AdWords. Just just create an account there, embed their code in your site and you're finished.
The point is that creating your own ad-engine brings several problems:
You have to write the engine, including payment options, click tracking etc
and care about legal problems and contracts (a company may sue you for not displaying ads enough, caused by bug or misinterpretation etc)
Also you need to find someone who advertises at your site
AdBlocker
It's not impossible and embedding a static image won't bring to much problems, but for totally automating the engine you'll have to worry about all those problems, especially the legal ones. If you still want do this, look at 4chan's AdEngine:
Let the advertiser upload an image and store it on your server, save the click or view count left in the db.
When a site with ads is loaded, query the db for ads where count_left > 0 (order by random is an option, as it usually balances at many queries) and display the corresponding image. If your site has different categories, you may want to add a tag-clause or something. Also, set the view count down by one. If you intend to use click count, let the img's link point on your website and subtract the clickcount, but watch out that it isn't called multiple times by a single client to damage your customers (per-session or per-ip lock).
Hope this helps; I'd recommend you AdWords as it saves a lot of trouble and work.

Website google maps zipcode search

First off, I'm a beginning programmer.
In the past we have used "WordPress" for all of our web displays but have moved to a program called "Netsuite" because of business reasons.
We have implemented Google maps before with our "WordPress" website with no issues but for some reason we just aren't getting it to work right within "Netsuite".
WordPress was a lot easier to manage and design for a beginner but "Netsuite" has shown to be a total different beast.
We want it to where someone can put in a zip code and Google maps returns all available stores in the radius selected by the customer. At the moment it does not do anything.
Here's the code that has been used in the "Item/Category" portion of Netsuite = https://system.netsuite.com/core/media/media.nl?id=68100&c=474317&h=6cc7936ec76825098acc&mv=ht7pyjtk&_xt=.txt&whence=
Please any help is grateful.
You can do the call inside NetSuite using a Suitelet - this can be called from the UI. Use nlapiRequestURL to get the JSON data and process it as you do on your file there.
Also, it's not best practice to disclose your company number c=xxxxxxx on the URL.

Retailers search with google maps API

I need to build a postcode checker where the user will put in a postcode and it they will be presented with a google map with their 3 nearest retailers. It will also need to zoom in to the point where it shows all the 3 results, unless there are only 1 or 2 results.
I have been given an excel document with the following information:
Company
Address line 1
Address Line2
Postcode
URL
Contact telephone number
If the user is then presented with a retailer on the map, they can then click on the icon, which will display a tooltip with the relevant information. Company name, url etc.
I’ve used the google maps API a couple of times but not done anything as advanced as this. I need to know how google maps will read the data in the excel document, will I need to convert it into an XML document, or would it need to be added into the database?
Is the postcode enough for google maps to go off of? Or would I need to add the longitude and latitude?
I guess I would need google maps to workout which postcodes are closest to the ones that user has inputted to the search box, then to present the closest three.
It’s being built into a DRUPAL based site, and would be good if the results could be CMSable so the client can go in at any time and add new retailers.
Like I said it's not something i've built before, so really just looking for advice.
Thanks!
I have done this several times and im not claiming the following manner is the way to go.
I usually let the customer fill in the addresses in the CMS, and use an function to determine the long/lat based on the addresses to save the lat/long and the full adres.
After that i use jquery at the front to loop through the lat/longs to place markers on the map, by using an setBounds function which google map recognizes you can center the results. (Like you said zoom on the markers).
While looping through the markers you can append text to the markers.
The above is step 1.
Step 2:
You have to rebuild the map after you enter postcodes, for this i use ajax. I fire my info to an page which again converts my potscode to lat/long and based on the lat/long i can do an select on the database and return the events to my map. After that Step 1 goes in action with new data.
Note: You have to gather some information which you can find on stackoverflow on how to combine these actions.
Turns out Google have a tutorial on how to do something similar, documentation can be found here - https://developers.google.com/maps/articles/phpsqlsearch_v3

how can google find me if I am inside a mysql table?

I am creating a classifieds website.
Im storing all ads in mysql database, in different tables.
Is it possible to find these ads somehow, from googles search engine?
Is it possible to create meta information about each ad so that google finds them?
How does major companies do this?
I have thought about auto-generating a html-page for each ad inserted, but 500thousand auto-generated html pages doesn't really sound that good of a solution!
Any thoughts and idéas?
UPDATE:
Here is my basic website so far:
(ALL PHP BASED)
I have a search engine which searches database for records.
After finding and displaying search results, you can click on a result ('ad') and then PHP fetches info from the database and displays it, simple!
In the 'put ad' section of my site, you can put your own ad into a mysql database.
I need to know how I should make google find ads in my website also, as I dont think google-crawler can search my database just because users can.
Please explain your answers more thoroughly so that I understand fully how this works!
Thank you
Google doesn't find database records. Google finds web pages. If you want your classifieds to be found then they'll need to be on a Web page of some kind. You can help this process by giving Google a site map/index of all your classifieds.
I suggest you take a look at Google Basics and Creating and submitting SitemapsPrint
. Basically the idea is to spoon feed Google every URL you want Google to find. So if your reference your classifieds this way:
http://www.mysite.com/classified?id=1234
then you create a list of every URL required to find every classified and yes this might be hundreds of thousands or even millions.
The above assumes a single classified per page. You can of course put 5, 10, 50 or 100 on a single page and then create a smaller set of URLs for Google to crawl.
Whatever you do however remember this: your sitemap should reflect how your site is used. Every URL Google finds (or you give it) will appear in the index. So don't give Google a URL that a user couldn't reach by using the site normally or that you don't want a user to use.
So while 50 classifieds per page might mean less requests from Google, if that's not how you want users to use your site (or a view you want to provide) then you'll have to do it some other way.
Just remember: Google indexes Web pages not data.
How would you normally access these classifieds? You're not just keeping them locked up in the database, are you?
Google sees your website like any other visitor would see your website. If you have a normal database-driven site, there's some unique URL for each classified where it it displayed. If there's a link to it somewhere, Google will find it.
If you want Google to index your site, you need to put all your pages on the web and link between them.
You do not have to auto-generate a static HTML page for everything, all pages can be dynamically created (JSP, ASP, PHP, what have you), but they need to be accessible for a web crawler.
Google can find you no matter where you try to hide. Even if you can somehow fit yourself into a mysql table. Because they're Google. :-D
Seriously, though, they use a bot to periodically spider your site so you mostly just need to make the data in your database available as web pages on your site, and make your site bot-friendly (use an appropriate robots.txt file, provide a search engine-friendly site map, etc.) You need to make sure they can find your site, so make sure it's linked to by other sites -- preferably sites with lots of traffic.
If your site only displays specific results in response to search terms you'll have a harder time. You may want to make full lists of the records available for people without search terms (paged appropriately if you have lots of data).
First Create a PHP file that pulls the index plus human readable reference for all records.
That is your main page broken out into categories (like in the case of Craigslist.com - by Country and State).
Then each category link feeds back to the php script the selected value regardless of level(s) finally reaching the ad itself.
So, If a category is selected which contains more categories (like states contain cities) Then display the next list of categories. Else display the list of ads for that city.
This will give Google.com a way to index a site (aka mysql db) dynamically with out creating static content for the millions (billions or trillions) of records involved.
This is Just an idea of how to get Google.com to index a database.

Categories