webgl earth API basemap control in javascript - javascript

Can someone show me the javascript code required to create a layer control to switch basemaps for the webgl earth API, just like at http://www.webglearth.com (the dropdown list)

Ok I have found a suitable solution, 'cesiumjs', it is javascript based, uses webgl and is open source with very good tutorials and documentation. This project seems excellent and just what I need. Here's a link to the layer control documentation.
https://cesiumjs.org/Cesium/Build/Documentation/BaseLayerPicker.html

Related

Finding the direction/bearing of the user and changes in it in Mapbox gl js

I am trying to find the bearing of the user in mapbox gl js and detect any change in it. In other words the direction which the user is facing in mapbox gl js and also if he chenges his direction. But I couldn't find much on this topic apart from this with some of its links not working and other being cordova specific solutions.
I am looking for a approach involving android webview and js for my solution. There are very few examples that I have been able to find regarding this.
Can anyone help me out here with anything on this please?
Edit
I am trying to find user's bearing, without using markers on the screen.
The Geolocation API is the standard web API for enabling users to provide their location to web applications. Mapbox GL JS's GeolocateControl is a wrapper around the browser's Geolocation API. This API does not have support for providing a user's bearing. Since there is no standard API across browsers for providing user bearing information, Mapbox GL JS does not natively expose a way to retrieve it.
If you are building for mobile, native SDKs such as the Mapbox Maps SDK for Android provide far more granularity for accessing current user location and bearing than web APIs.

Which library to create data-visualization at a in-city level?

Hi all I'm a newbie in data-visualization. I am looking for a graphics library in JavaScript that supports data-visualization at an city level, I have found some (like D3js) but all seem to only support the creation of data at a country level and not city level (like the scale of Google map city zoom's level).
Maplace would be a great library but I am looking for something closer to common JS.
Would be great if anyone's got a hint, thanks!
If you mean BY "In-city" like geo-visualization there are plenty of options:
Cesium.js
Three.js
Leaflet.js
d3.js
raphael.js
try to search more on google but those are commonly used combinedly or individually.
A good data visualization means a good story telling

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.

Upgrading to v3 from v2 of google maps API, suggestions

I have full fledged integration of google maps version 2 in my web application, with features like get directions, cluster markers, tabbed info window, context menu(right click). The implementation has very poor design which is causing some problem, So now I need to revamp the core implementation to better design. I was thinking of upgrading to version 3 of google maps API. Please suggest, if that's a good thing to do and my all features will be running fine(or I will get replacement for all the features mentioned) in less time. Or should I stick to the version 2 of the google maps API?
I recommend you upgrade to v3. I upgraded my site a few months ago (and blogged about the experience). A few things to keep in mind:
No more API key.
The marker and info window API has changed, for the better.
No more AJAX helper stuff. If you are using GXMLHttp, you will need to swap over to a new AJAX wrapper (Jquery, mootools etc).
Check your lat/lngs are in the right order. GPoint takes x and y (longitude and latitude). v3 has a latlng object, so your params might be backwards.
Styled maps - You will be able to customize your color scheme in v3.
Don't think you can turn on the Google earth plugin in a single line of code like you could in v2 (not 100% on this, so please correct me if I am wrong).
Once you are done, you will be happy to make the change. Pages load faster, zooming is smoother (polyines scale as you zoom instead of disappearing) and the mobile experience is much better.

Choosing between YUI Charts or Google Visualization API

I'm a bit stuck with which charting library I will use in my project. Im stuck with this two (but also open for other suggestions)
For YUI Charts :
Pro :
- Very robust and configurable
Cons :
- Uses flash 9 >, which might potentially be inaccessible for users without up to date flash version
- Does not support export to image (for flash versions < 10 only)
For Google Visualization API
pros:
- small file size for the libraries,
- can be exported to static image charts (via separate API call)
Cons
- limited configuration options
So there, please help me decide. YUI charts has the edge over configuration options but Google Visualization API has the edge in terms of accessibility as it uses SVG to render the grapsh instead of Flash. For users that are hand-cuffed by corporate IT prohibitions , they cant just upgrade their Flash version and the page will not work.
Thanks!
I would choose Google's API as it requires only a javascript interpreter or internet access (to Google).
The fewer dependencies, the better. Not to mention there is quite an array of tools for manipulating SVG images.
If you really cannot make do without certain features in YUI or cannot find simpler ways to express your charts, then choose YUI.
You might also want to take a peek at http://www.simile-widgets.org/ It might be overkill / bad fit for your needs, but it is positively sexy.
If you don't want flash for drawing charts in your application it is better to choose
Google Visualization API...
The Google Visualization JavaScript API lets you access structured data and visualize that data using JavaScript in your web pages. The Google Visualization API also enables creation of gadgets.

Categories