Map polygon coordinates on image - php

For a client I need to create a map (= image) with different polygon markers on it. It's an image of a small area with houses on it. My client wants to edit this themselves, so there has to be a way to map the polygons (4+ points) in a sort off visual editor (Google like 'My Maps').
I've searched for a couple off days on Google and on here, but I can not find any answer if this is even possible.
So my #1 question is, is this even possible or should I tell the client that its impossible to do something like this?
If question #1 == possible: question #2 is:
Does someone have some code, any tutorial or documentation to get me started? Prefferably complient with Typo3, not a must, but I should be able to parse the coordinates to PHP to save in MySQL.
Thanks in advance,
Jeroen

I'll suggest 2 solutions to solve this:
If you're using templavoila, then you may create an FCE(Flexible
Content Element) and implement image-map via typoscript as given in this
link:
https://sankartypo3.wordpress.com/2012/06/28/typoscript-for-image-map/.
The rest need to be handled using javascript.
Use MW Imagemap extension: http://typo3.org/extensions/repository/view/mwimagemap

For image maps, the extension "imagemap_wizard" has proven very useful to me.

I am the programmer of MW Imagemap and I can tell you that MW Imagemap has definitely not migrated to imagemap_wizard.

Related

Add windy.js on leaflet map as a layer

i want to add wind data on my leaflet map as a layer
wind data like this https://danwild.github.io/leaflet-velocity/
I've been working on something similar. I found a pretty good looking
and intuitive method being used to represent vector information. Have
a look at the following examples:
http://earth.nullschool.net/
http://hint.fm/wind/
http://air.nullschool.net/
http://googlemapsmania.blogspot.com/2014/07/the-growth-of-slippy-wind-map.html
In my case, I still need to find a suitable format for the wind/ocean
data I want to plot on my Leaflet map. It's certainly not a quick fix,
but man, it looks great!
Maybe this can help you too. I hope to be able to post a working
solution soon.
This plugin takes input data in form of speed in knots (nautical miles
(1.852 km) per hour) and direction in degrees. It then generates the
wind barbs and outputs an icon. This icon can easily be added to a
Leaflet marker.
You can download it here:
https://github.com/JoranBeaufort/Leaflet.windbarb And you can see a
live example here: http://www.geonet.ch/leaflet-windbarb/

google maps, google places and save marker to a database

First of all I would like to tell you that I am not sure if I use the terms correctly so please excuse me for any misunderstandings. I will try to clear everything.
What I want to do is to let the users on my website to select their favorite bar or restaurant and add it to their profile.
It should be more or less like maps.google.com but in a smaller dimensions let's say 400x400. The users will be able to search for a place and once they find it they will be able to save it to their profile.
I am confused though because Google offers the Google Maps and the Google Places. I do not see any tutorials around regarding Google Places..
The question is.. Can I do my small project by using google maps or I really need to use google places?
Is there any tutorial/link which shows how to store on my database the current map location?
Thanks in advance!
Ok after some more searching I found my answer which was pretty simple.
It looks like I can get the lat and lng from place.geometry.location .
The rest about storing it to the database is easy!
Thanks anyone who at least read my post!
Cheers!

Generate countries map based on geoip data

I have searched a lot on this topic, and have found no answers.
I have my own statistics package where I'm saving the geoip data of my users (along with a bunch of other data). I'm using the maxmind geoip library to get this information.
So, in my backend I'm visualizing this data as text that have basically two columns, one for the country name and another for the number of visits from the country.
I'd like to generate a map with this data.
something like a world map with the countries I have visits from highlighted.
Heat mapping would be nice, but not required.
I dont really care if it's generated with php (GD image library) or jquery, since I'm already using both those technologies for the statistics backend. But I'd REALLY like to do this without google analytics or their graphing APIs.
I will try to suppose. The way I would try do it ...
Get FullHD (or HighRes world map)
Coordinates I'd keep in WGS84 standard (float values, otherwise it is easy to convert)
I would try to approach real coordinates to the scale of image, but before this ...
The major part in this work is Math. I'm actually not a mathematician, but I know that it should be applied here and why.
Main goal here is to project coordinates on a flat surface, bec. WGS84 uses oblate spheroid as a reference surface (with radius = 6378137 m; flattering = 1/298.257223563), so it is not ideal circumference and it should be taken into account. + image should be GEO binded somehow (you should know coordinates of corner angles of this image #least. it is the easiest case if so).
Calculations for this case are not very massive, everything leads to the elementary plane geometry.
Here is the library that could help you working with geospatial data http://www.gdal.org/.
My advice to you, to consult some specialists in this field if you know nothing about it (maybe SatCom spec. or MobCom spec. in some university/academy) (or try Google if you are familiar enough with math and GEO) and to ask for a math model for projection of GPS coordinates to the flat surface and you will definitely get the answer.
If you don't need very high accuracy, try it yourself maybe you'll have luck.
You can try yourself in MatLab (more applicable in this case) or Mathcad if you know math enough and try yourself to position few points on the raster.
If you will find the answer in the nearest future, I would be glad if you post it here or share with me your solution for the particular case.
i need to finally answer my own question here. for anyone else who stumbles across this:
i have been using the d3js library with the topojson extension.
https://github.com/mbostock/topojson

Getting information from Gmaps like grassland, street, water etc

I'm thinking about a project, where I need such informations as described in the title. Does the Google Maps API provide something like this, or does anyone know how to get these informations?
Project will be done in PHP, HTML and Javascript.
AFAIK Google doesn't provide this information via the API. The only thing I can think of is getting the image, and then detecting the colour. A map of colour hex values against point type might give you what you need.
However, this may well break the Terms and Conditions, depending on what you're doing.

How can I create a list catalouge page for my website, without shopping cart/detailed product page functions

I want to make Newegg's like catalouge functionality for my little website. I want mine to be sligthly different(greatly simplified) though. I haven't done anything so advanced(atleast in my books) before, and wanted to know if it's possible to do. I want to use PHP and JS. The new records will be added manually through using either phpMyAdmin or pehaps I will install and use either SQLyog, HeidiSQL or Navicat for such purposes. Could someone point me to the right resources to get this kind of job done as fast as possible and properly?
What I had in mind was:
For example the cell which contains the thumbimage, all the mini information about the product and the big price tag will not have a separate, more detailed page. Everything user will need to know will be inside that product cell.
Right under the thumbnail image there will be numbers(1 2 3 4 5 6), and when you hover over them, under the cursor, a big version of one of the all available images will appear.
Lastly, it should have the page generation(don't know what you call it). For example there's more than 20 product entries on the page, then the server should create a new page(First 1 >2< Last) to hold the older records.
Oh and there won't be any shopping cart functionality. You can't really "order" these kinds of products, you just find something you like and call me up about it.
TIA
I'm sure there are dozens of books on this subject. I'm attempting a short reply, however:
This sounds like something that could profit from:
a MCV-framework like CakePHP (or Django, Ruby on Rails etc), which could handle database-logic (including pagination, which is the word you're looking for), and
a JavaScript library like JQuery to handle Ajax, JavaScript and other UI-related stuff.
++?
For the page numbers, I recently had to do this. The technique is called pagination, and this thread helped me out immensely: PHP Formula For a Series of Numbers (Mathy Problem)
The thumbnail effect you want to include would need to be done in javascript. I'd recommend learning jQuery, as it is pretty easy to use for this sort of thing.
This is a hard question to answer because you haven't given much indication as to your skill level, or progress towards accomplishing your goal. Assuming we're starting at 0, there is probably more to discuss than this thread can contain. :\
UPDATE
To learn PHP's database functions, I would lean on W3School's PHP/MySQL tutorial for a quick summary, referring to the php manual's mysql documentation for details and code examples when W3schools isn't enough. This should at least get you the markup you will need to work with.
For the thumbnails, I would reiterate my recommendation for jQuery, specifically attaching a .hover() event to the image numbers (this is equivalent to the onmouseover and onmouseout events in JS) that uses the .fadeIn() and .fadeOut() animations to show and hide your full size images. Hope that helps.

Categories