How to integrate Geoserver into an application to serve points as layers - javascript

I am currently developing an application and it has a map portion where we have to load more than 10,000 points on a map. We are using Google Map Javascript API to display all these points as markers. What we have experienced is that it takes almost forever to get all of those points on the map and then again it mighty load on our server so most times we get a time-out.
We have thought of using Geoserver. Our approach is to connect/get a Geoserver plugin for MongoDB (that what we use in storing all the points) and then specify our data-source on Geoserver so that it can create a WMS layer for all the points we intend to load/display on a map.
What we have not figured out is how to Integrate Geoserver into our current solution
We have searched for possible implementations of a similar solution but found nothing that tells on how to integrate Geoserver into an application.
Please help if you do have a idea. Thanks

Related

google maps offline: not tiles but javascript

I have an HTML (phonegap) application that uses Google Maps API to display a map with markers. I want this app to be used offline. I know that Google Maps tiles can't be used offline (because of its license). However, what I want to do is use the map interface without the tiles.
When online -> tiles and markers displayed.
When offline -> only markers displayed.
However, the js loading of Google maps is complex, and I haven't managed to cache it.
Thanks.
Caching google maps javascript is not allowed, that's because their payment system is based on how many times their javascript API are loaded by the users. One page refresh is equal to one google maps API call, and depending what kind of contract you made you just lost -1 from the total amount of API requests you have purchased.
How is Google Maps API for Business usage tracked and reported?
A single load of the Google Maps JavaScript API into a page. The
JavaScript API is reloaded every time a page that uses the API is
reloaded. User interactions with the map (eg. panning, zooming,
changing map types) do not generate more page views. Note however that
a page view is generated if the API is loaded into the page even if
the API is not then used to display a map.
See https://developers.google.com/maps/documentation/business/faq#pageview
You could, of course contact google and try to ask some tailored business solution for your needs. I am not 100% sure what kind of things they offer if you contact them directly. But although, your request is somewhat impossible to fill since those UI generation codes also resides inside that google maps API javascript which you need.
So I would suggest that if you only need google maps interface when offline, take a moment and implement something similar with HTML/CSS/ (and some JS).. markers you could draw on canvas or use normal img's and positioning. If you need to implement dragging and zooming - it would be little bit more difficult but not impossible with canvas or some other techniques. But that being said it would just be easier to keep app online, we all have internet :) ? Making 1on1 matching dummy offline UI against google maps would be really painful process, when we consider the fact that google maps UI also changes overtime, like in their upcoming versions.
You could use OpenStreetMaps instead, it can be used offline: http://wiki.openstreetmap.org/wiki/Offline_Openstreetmap

Google Maps api custom tiles for fictional video game world

I want to use the Google Maps v3 api to generate an interactive Google Map interface that uses custom tiles for a map from a video game. The app needs to be able to zoom-in out and display the proper tiles for each zoom level as well.
I'm looking for some resources or a tutorial on how to accomplish this. The Google Maps v3 API appears to only discuss using custom tiles that lay on top of the normal Google Maps tiles. That wouldn't make sense in my application since my map is for a fictional world and wouldn't line up with anything in the real world maps. Perhaps I'm just not seeing what I need in the API guide...
Check out the ImageMapType class in the reference. There's a nifty example showing Moon tiles.
One of my favourite applications is The Internet map, the developer wrote a pretty sweet article on how it was developed.
You need to either cut up your custom game map image into the appropriate file/directory structure that makes integration into Maps API easy (here's an example using Photoshop and some example HTML/JS code). Or use a more friendly tool like TileMill, but this expects data in a standard spatial data format and you probably don't have your game map stored in such a format. If you can go that route, they also provide a Node.js-based server called TileServe that makes integration a cinch.
If you are expecting a boatload of traffic, then maybe look at Google Maps Engine to host your custom game map image directly in Google's infrastructure.

What is the best way to update thousands of placemarks dynamically in Google Earth?

Im using the google earth v1 javascript API to update hundreds of objects moving around in "real-time". I keep track of new, modified, and deleted entities to minimize looping in my javascript while updating placemarks, but still the biggest bottleneck is making the calls to the google earth api. Has anyone else tackled this problem? I've read a bit about dynamically streaming from a KML file on a server, but I need access to the placemark object updates in my javascript code.
There is a v3 of the Google Maps Javascript API, but the Google Earth API is at v1. It's unclear from your question if you are using both API's, and if so, how you are interacting with the Earth API.
If you provide some code showing how you are doing the updates it would be easier to offer advice on how to optimize.
That said it sounds like using straight KML with incremental Updates is the way to go for your use case, and you can still access individual placemarks using the getElementByUrl() method
To put a bow on this question. Using dynamic KML files is one way to do this if you dont need to do anything complicated with the data other than display it to the user. Because I need to do work on the data inside the webclient, I ended up using json to transfer the data and then using google.earth.executeBatch to execute my google earth api calls in the most efficient manner.
Have you looked at using Google Fusion Tables? It doesn't use the GE plug-in so....

how does the google maps identifies the roads(paths)?

when i went through the source code of the google maps page i've realized that the whole map is formed by small tiles of images. But how does the javascript identifies the roads on the google maps to show the way from ourlocation to destination??
I couldn't tell you HOW it works, it is a very complex application but all the work is done on the server and the reason the page shows the map as images is purely down to the limited ways in which a browser can display content.
Google have several layers with information about streets, roads, etc... when you use google maps only show a "graphical representation" of their data in bitmap format, but they need a "vectorial" layer that we don't see it.
Calculate routing is a very complex infraestructure problem in GIS server, for example, with Geoserver and PostGIS you can use Dijkstra Routing with Pgdijkstra.
It's very complex question, for a short answer.

how to add a wms layer to a bing map using javascript?

how do I add a wms layer to a bing map using javascript? anyone know any good examples?
Typically I've used a proxy service that translates the quad key to the proper coordinates of the wms. A good start for writing such a proxy service in C# as a web handler can be found here: http://www.viawindowslive.com/Articles/VirtualEarth/AccessingWMSfromVirtualEarth.aspx
The problem lies in the way that bings maps requires you to specify a tile url. If you're not locked into bing maps, this sort of thing is much easier with Google Maps version 2.0 or Open layers as the above poster suggested.
if you have to use WMS for the tile server, then I would seriously look at OpenLayers.
This is excellent at mixing different toolkits and formats. Eg. putting KML overlays over WMS, or (as in your case) WMS over Bing Maps.
If you have your own choice of tile server and you have rasters, then I would use MapCruncher instead and load it natively in Bing Maps.

Categories