Offline maps with markers - c#

I have a requirement to create a web based application, which is hosted on a intranet server(no internet access). This application will be used to keep track of various status over in the various geographical location, the locations are currently spanned within Asia.
I have read up on google map api, and it seems that it is against their policy to use their map offline. On the other hand, the custom markers is something that I am interested in. I am considering to make use of the marker concept to show the status of the area.
Hence sample example of the status can be denoted by having red as error, green as working properly, and this will be updated every 1 hour.
Any bros have done similar concept and will be willing to guide me? The offline maps is preferred to be free, however if a paid version proves to be useful, it can be considered.

Seems like you could use a combination of MapServer as mapping server and openstreetmap as data source (maps for asia are available, but it depends on the level of zoom, precision and update you are willing to work with) and OpenLayers to load, display and render your markers and data.
Links :
MapServer :http://mapserver.org/index.html
OpenStreetMap : http://www.openstreetmap.org/
OpenLayers : http://openlayers.org/
Notice : you can find .shp versions of openstreetmap for offline viewing and usage, free of charges, here : http://downloads.cloudmade.com/ , and here : http://download.geofabrik.de/osm/
And here is a MapServer Tutorial for C# mapscript (ASP .NET) : http://www.paolocorti.net/2006/09/20/mapserver-tutorial-for-c-mapscript-asp-net/

Google Maps/Earth will only allow you to store 2Gb of map data locally. The API will not let you store any at all. There is no way to use the maps offline. However you can try downloading images from NASA World Wind: http://worldwind.arc.nasa.gov/java/ it is opensource.

Related

How should I store images for my website/app?

My team and I (all students, this is a college project) are creating a software, that's basically 2 frontends (a website and an app) connected to a backend through an API. We have the entity user in this software, and one of its properties its image since we expect to have a lot of users, We don't think storing the images directly on the database it's the best thing.
So in this kind of cases what should we do ? What's the best practice ? (all the components are going to be deployed so local storing it's not really an option).
(We had in mind to get some 3rd party service where we could upload the images and just store the link in the DB, but is this possible? is this fine?).
You can consider using cloud storage like
Amazon S3 (https://aws.amazon.com/s3/)
Google Cloud Bucket (https://cloud.google.com/storage/docs/creating-buckets)
Microsoft Azure Storage (https://learn.microsoft.com/en-us/azure/storage/common/storage-introduction)
They have some free of charge for experiments/learnings but you also need to be aware of charge fees after some certain usages limits. They're using cloud computing, so you don't need to worry about the performance.
Another choice that you can build your own image server and serve images directly to your website. The benefits could be
Having the same connection directly to your website via domains (faster than cloud sometimes)
You can flexibly control your image sizes/types according to your image requests. For example, you can convert your images to WebP or compress them to fit users' local devices
Of course, with this way, you need to have knowledge about building an image server.
there are many different cloud storage services that you can use to host images for your project. most popular of them is imgbb & imgur . I've been using them for a long time and they work great. Both have api's which are very simple to implement. If its your first time using them, you might want to watch a tutorial on youtube . Hopefully this helped you.

How to get a JSON file (or something similar) with lightning data from http://en.blitzortung.org?

I am currently working on my school project - Android app that informs you about strong lightning strikes near your house in real time.
There are some websites like blitzortung.org or lightningmaps.org (or other), any ideas how can I get nice output file from one of these sites, so that I can obtain geographical data, determine whether it is near your house or not, and send a push notification for user? Displaying the strikes on the map are not needed.
I am using an Android Studio, Visual Studio 2015 as well as MS SQL database.
Thanks
You can get complete source code for this from following URL
https://github.com/wuan/bo-android
It's using data from lightningmaps.org
You can give a try to Open Weather or check this answer.
For Push you can use FCM. Just google "How to implement GCM in android?" you will whole lot of help.
According to blitzortung forum:
Please remember that Blitzortung data may not be used for commercial
purposes. General operator data access info: login to your main
Blitzortung Org account, and click the 'compendium' link under
'project area'. If you haven't already, you might also see
http://www.lightningmaps.org/doc/intro

Track embedded charts via Google Analytics

I've got a site which produces charts such as the one below
I'd like to encourage visitors to embed the generated graphic on their own sites and blogs. Is it possible to include views for that chart in google Analytics? I want to be able to see when a site embeds the image so that it's tracked in the analytics reports.
I'd envision some API that I can call from the server-side method which generates the PNG, but haven't been able to find anything specific.
Thanks!
This is indeed possible, have a look at the Google Analytics for Mobile Websites documentation. This details how to build a request to google analytics on the server, with quite a few different code samples (C# included).
While this documentation revolves around tracking page views, this concept could be extended to other types of activity you can record in google analytics, such as Events. In your specific situation I think I would want to setup the view of the chart as an Event, as this will not 'mess up' your true traffic (though you could use an advanced segment to exclude the chart traffic if you chose to register them as page views).
The documentation for event tracking is available here. Looking through it should give you a good idea of how you could express viewing your charts. Once you got an idea of how you wanted to track the event in GA, write the javascript and then view the URL (beacon) it generates to send the information to google. You'll be able to use that as a template to send event information from the server.
In regards to actually serving the image, you have a lot of options. If you app is written in MVC, look at the FileResult class (and the asssociated File() method available on the Controller class). If you working in a Webforms app, you will be using a Response.WriteFile() or something to that affect. This wrox article has an example of the idea behind this. The example is for creating a no leaching / hotlinking image handler, but the concept of writing an image to the HttpReponse is the same.

C# - Xbox Live Stat Grabber

I'm working on an xbl stat grabber. I have a problem I dont understand how to get the "gamer card"
Heres an example : http://www.youtube.com/watch?v=6HA-uz_v6A0&feature=related
I already have the avatar but I don't get how you can grab the stats and recent games...
You need access to the Xbox Live API, I think you have to apply to Microsoft to get on their 'Community Developer' programme, although it's a bit hazy on the site as to whether they are accepting applications or not.
One kind fellow (who I think is a Microsoft employee) saw that this was a terrible oversight from his employers decided to offer as web service that plugged into the Xbox Live network so you can pull statistics down, you can find info about it and a website here: -
http://duncanmackenzie.net/Blog/put-up-a-rest-api-for-xbox-gamertag-data
It's very comprehensive and should give you all the data you need (Gamerscore, current status, last game played etc)
EDIT: Extra stuff that might help
I'm not too familiar with C# but the process of using the service would be to do the following in your application: -
Construct your URL with a/your gamertag as the argument
Use some URL/Networking API (C#/.NET must have something like this somewhere) to load the URL and retrieve the contents. This should return you a big string containing a bunch of XML
Parse the XML into your application using some sort of XML parsing API (again, I'd imagine C#/.NET has these things built into the framework)
From the looks of the program, the gamercard info looks as if it is just an embedding based upon the gamer tag. You can find info on embedding your Xbox Live gamercard here.
The video author said the Halo stat information is coming courtesy of a site called HaloCharts.com. I don't know if he is embedding the information, perhaps reading an RSS feed, or if he is extracting data from the HTML.

What is a good api for mapping gps coordinates in c#?

I have a project that has a list of gps coordinates. I would like to find a way to make a simple map of those coordinates (possibly just one at a time). The map should have basic street info.
This part of our project is pretty simple so I don't think it needs to be an exceptionally feature rich product. This also means it shouldn't be really expensive.
What is a good product to achieve this?
edit: This is a desktop app where internet connectivity will probably not be available.
Google Maps is great for this.
If this is a desktop app with internet access you could still host an IE control and show it there.
EDIT: If this is a desktop app without internet access you'll have to buy something like Microsoft Streets & Trips. I don't know if it has reusable controls. You probably have to buy something more expensive to get that. Applications of this nature often fall under the category "GIS". Try searching Google for that.
Sharpmap is open source project written in C# and released under LGPL. To quote first line from page:
SharpMap is an easy-to-use mapping library for use in web and desktop applications.
I'd go with this solution
Map Rendering: SharpMap
Geometry operations: NetTopologySuite
Map data store: shapefiles in your file system or PostGis over PostgreSQL
Map data itself: the easiest way may be extracting from OpenStreetMaps data. Here, for example you can download shapefiles for your desired location
Everyting is open source (more or less, check the licenses) and works fine on windows.
Hope it helps
ESRI has an API. They have javascript, silverlight,wpf, and flash. they may have more. ESRI is pretty much the standard in mapping.

Categories