Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenLayers vs Google Maps? [closed]

People also ask

Is OpenStreetMap better than Google?

OSM gives better performance in various urban centres as compared to Google Maps. Google Maps are the best for online purposes. OpenStreetMap allows the users to download the maps that can be used offline also for either finding a route or identifying a location.

Is Google Maps open source?

And those changes could directly affect the budget that most businesses and retailers have for investing in their web services. Added to this increase, Google Maps API also had some limitations in customization, and it is not an open-source option, which can affect developers' work with this product.

Is there a professional version of Google Maps?

Google Earth Pro on desktop is free for users with advanced feature needs. Import and export GIS data, and go back in time with historical imagery. Available on PC, Mac, or Linux.

Is Google Maps free?

Google Maps is not free anymore, and all the maps will now receive a message that is “For development purposes only.” After the changes, you have to pay for every single view on your map from now on. Starting from July 2018, Google Maps, Routes, and Places require billing information, such as an associated credit card.


These are a really great questions! I'm a professional OpenLayers developer and fan, so I'll address your questions from that perspective.

Why would I use OpenLayers instead of Google Maps?

  • Flexiblity: You are not tied to any particular map provider or technology. You can change anytime and not have to rewrite your entire code. Google, Yahoo, Microsoft, WMS, ArcGIS Server, MapServer, etc. are all supported out of the box.
  • Vector Support: Better support for points, polylines, and polygons.
  • Control: You have the ability to add any new features that you may need. I've personally written three plugins for OpenLayers, two of which are or will be part of the source.
  • Debugging: Much easier to debug when you can step through the source code!

I would not worry at all about the long-term viability of the project. It is the premier open source client-side mapping library.

Are there any common pitfalls / problems I may encounter?

  • The biggest pitfall I've run into is working with the Web Mercator (Google) projection. It can be a pain to display vector data that is in a common and real projection like WGS 84 into an OpenLayers map using Google, Yahoo, and Microsoft base maps. The examples are your friend.

JavaScript Framework Compatibility

  • I use the jQuery framework for all of my work, and the only problem I've had is referencing jQuery after OpenLayers. Other than that, it's been smooth sailing.
  • Performance is great! The only issues will be with your map server or adding too many vectors to your map.

Are there maps available for many places?

  • Like I said, you can use basemaps from just about any source for anywhere in the world.

Is there any kind of API to display roads?

  • I'd check out CloudMade! The have converted the OpenStreetMap project into a map tile service and allow custom styling. I believe that you can style one-way streets (per your example) a particular way. The CloudMade Developer Zone.

Do you know any good tutorial to OpenLayers?

  • I don't know any tutorials, but there are a ton of examples in OpenLayers Examples

I hope this is useful. And I'm around Stack Overflow if you have any questions!


It's not necessarily a question of OpenLayers OR Google Maps. You can after all use Google Maps for your map background in OpenLayers. Some more specific answers:

Why OpenLayers?

  • OpenLayers can combine maps from different sources (Google Maps background, WMS overlays, vector data from KML or GML files or WFS etc)
  • You can style OpenLayers much more thanyou can Google Maps
  • Open source, you can check the source code when debugging
  • If you need high precision in the maps, use OpenLayers with a suitable map server backend rather than Google Maps to get a better map projection (Google Maps assumes that the earth is a perfect sphere)

Pitfalls

  • If you want to use vector (WFS) data from another server you need a proxy, due to cross site scripting limitations

Performance

  • Depends mainly on the speed of the map backend
  • Displaying many vector features (limit is browser dependent, but say > 200 on one view) takes time, but that is more a browser thing than a problem with OpenLayers

JavaScript frameworks

  • Have a look at GeoExt, which is ExtJS + OpenLayers, for example

Available maps

  • OpenLayers doesn't come with a map backend. You can use Google Maps, Yahoo Maps, MS Virtual Earth etc, or any WMS and WFS service tou have access to

I haven't seen much of a presence from OpenLayers users on SO but they're out there. The OpenLayers mailing lists are pretty active (I'm on Users and Dev and see anywhere from 50-100 emails a day discussing various things. You can search the lists from those links too.).

I can't answer all your questions but one thing I'll put out there is that OpenLayers and google maps aren't mutually exclusive. OpenLayers is a javascript library and you can use it to interact with google maps. Check out this example: OpenLayers using google maps. And here's the main OpenLayers examples page.


It really depends on what you want to use the map for. To simply plot points on a map, Google Maps will be fine. The map layers for Google Maps are also quite detailed. OpenLayers on the other hand offers far more functionality and is very extensible.

OpenLayers have lots of examples to get you started.

As for maps, OpenLayers is only an API so you need to supply it will map layers. The Google Maps API will be limited to the map layers supplied by google. With OpenLayer you can display pretty much any publicly available map service (WMS, WFS, TMS, WMS-C). A very good example is openstreetmap.org - (global streets map collected by the community). OSM can be added to openlayers as a TMS layer. Check out this example for instructions.


One point that hasn't been fully made here is that using OpenLayers avoids various restrictions Google places on the terms of service for its map APIs, including:

  • You can't legally use a Google map solely in a section of your site that requires payment to access, or for a private site that the public can't sign up for (e.g. a corporate intranet). (IANAL, but see Terms of Service, 9.1 and the FAQ)

  • You can't legally (or practically) use the Google API for offline applications (i.e. where the tiles are served from your own machine). Even if there weren't legal restrictions, Google makes this technically very difficult, while OpenLayers makes it easy.

  • Google reserves the right to shut down access to the API if you're showing a map with content it finds objectionable. The example given in the FAQ is a map of illegal drugs, which gives a good sense of the gray areas this restriction might cover.

See this FAQ and the Terms of Service for more details.

All that said, as a long-time Google Maps developer who recently started using OpenLayers, I feel that Google Maps has better documentation, a larger user community, and a clearer and more stable API than OpenLayers. So you have to make a trade-off somewhere.


I agree with all answers, but there is one very important point that nobody mentions. OpenLayers and Google Maps have different targets.

OpenLayer is an excellent framework to display geodata, but Google Maps is a pool of services that include a framework to display geodata among other services.

So, Google Maps expose a lot services and features that OpenLayes do not have. Some examples of Google Maps features and services are region localization, sensor detection (for device with GPS) and user localization, geocoding and reverse geocoding, street view, etc.