Coder Social home page Coder Social logo

jhere's Introduction

#jHERE

Maps are cool, but map APIs are complicated. jHERE solves this problem by offering a simple but powerful map API in the form of a jQuery (or Zepto.JS) plugin.

With jHERE, you can easily add interactive maps to your website. In only 4KB, you get a powerful map API, highly customizable markers, event handling and info bubbles. Bonus features are KML support and data visualization via heatmaps.

Screenshot

Add jHERE to your pages

Adding jHERE to a web page or web application is very easy. jHERE supports both jQuery as well as Zepto.JS, so first of all include one of these libraries.

<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>

or

<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto.min.js"></script>

In case you are using Zepto, you will need to include the Zepto adapter, that includes a couple of little things that are not implemented in Zepto and I used in my plugin ($.Deferred and $.data).

<script type="text/javascript" src="js/zepto.adapter.js">
<!--Only when using Zepto-->
</script>

In case you are using Tire, then include the Tire adapter (adds $.Deferred, $.data, $.proxy, $.inArray and $.Event to Tire):

<script type="text/javascript" src="js/tire.adapter.js">
<!--Only when using Tire-->
</script>

Finally include the plugin.

<script type="text/javascript" src="js/jhere.js"></script>

And done. Execute your code on window load.

<script>
	$(window).on('load', function(){
		$('#map').jHERE({
			enable: ['behavior'],
    		center: [40.664167, -73.838611],
	        zoom: 8
		})
	});
</script>

That's it. All the documentation is available at jhere.net/docs.html.

Extensions

Please refer to EXTENSIONS.md for information about the extensions for jHERE.

Playground

Because @thingsinjars is awesome jHERE has a playground, where you can go and experiment with the API, make cool maps, save the result as a Gist and share it with the world.

Contribute

Feel free to submit pull requests and report the issues you may find when using the plugin.

Code Style

I am not a code style super-geek, but here are the things I like and I don't like:

  1. ☼ Like: semicolons at the end of the line.
  2. ☁ Don't like: tabs, use 4 spaces instead. Not 1, not 2, 4.
  3. ☼ Like: single quotes for strings.
  4. ☁ Don't like: trailing whitespaces, messed up indentation.
  5. ☼ Like: meaningful variable names. Don't steal the job to the minificator. Also I want to keep the size of the plugin small, so do facilitate the minificator's job by caching long namespaces and functions that are invoked often.
  6. ☁ Don't like: globals.
  7. ☼ Like: well documented API. If you add functionalities, take the time to write the documentation using // comments directly in the source code. Docco will do the rest.

Comments

I normally like single line comments, i.e.

//My comment goes here

However I am using Docco to automatically generate documentation for the API, so // is reserved for documentation, as single line comments are parsed by the tool. Anything that developers using the plugin should not see in the API docs will have to be commented with /* */.

Before submitting a pull request

If you changed anything in jhere.js before pushing please run a

make test

If something fails, please fix the problem.

If you changed anything else (e.g. extensions, adapters) please run

make dist

before submitting the pull request.

Supporters

jHERE is kindly supported by:

BrowserStack logo

BrowserStack: Live, Web-Based Browser Testing on all desktop and mobile browsers. I use BrowserStack to make sure jHERE runs on all the supported browsers.

Digital Ocean logo

Digital Ocean: Simple Cloud Hosting, Built for Developers. Soon jhere.net and the playground will be hosted on Digital Ocean.

jhere's People

Contributors

axeffwettercom avatar hannta avatar lucastorri avatar mmarcon avatar thingsinjars avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jhere's Issues

Disable zoom in/out

Hi, I am interested if there is any option to disable user zoom on map? Sometimes when scrolling, the scroll picks the map, and instead of scrolling the website, it zooms the map.

Thanks

adding via to route

Hi,

since passing via's to route is not implemented yet, I'd like to do so.

What do you think is better implemented?

A: $map.jHERE('route', from, to, viaArray, {...}); //best in case of context
B: $map.jHERE('route', from, to, {...}, viaArray); //best for existing apps using jhere
C: $map.jHERE('route', from, to, {via: [], ...}); //or just extend the options obj

that's how it is now:
$map.jHERE('route', from, to, {});

Error catching incorrect components

If a new jHERE is created with incorrect components, it copes by ignoring the incorrect component - most of the time. If the enable parameter is set to 'isNs', 'objects', 'panning' or 'zoom', it'll throw an error and fail.

It's not likely that anyone would try to enable anything called 'isNs' or 'objects' but it's quite likely that a developer would try to enable 'zoom' or 'panning' on their map (they're easier to remember than 'behaviour'). so it might be an idea to catch them.

The problem occurs because these objects are included in _ns.map.component but aren't components themselves.

New map types

There are a couple more map types available.

  • NORMAL_COMMUNITY
  • SATELLITE_PLAIN
  • SATELLITE_COMMUNITY
  • TRAFFIC

These could either all be offered or at least the NORMAL_COMMUNITY and TRAFFIC types. Personally, I'd make the community layer the default.

center by route

Hi,

is it possible to center a calculated route within it's bounding box?

center by location name

It's possible to use center with the name of the place instead coords? Like:

$(window).on('load', function(){
    $('#map').jHERE({
        center: 'São Paulo, SP, Brazil',
        zoom: 8
    })
});

Regards!

Notification of incompatible jQuery

If the dev tries to use jQuery<1.7, it'll throw a non-obvious error in the console (Object [object Object] has no method 'on'). Should probably add a note in there.

Map Status Getters

$('#mapInstance').jHERE('center')

$('#mapInstance').jHERE('boundingBox')

... and so on.

Maps don't load with the downloaded version

Hi,
I have a rather big issue with your work. As I implemented it in my current page with your instruction you gave, I couldn't get the Maps to load. So I started your jhere-master/web/index.html and these maps wouldn't load either. I thought already that they maybe would only load if the page is online, so I uploaded it, but the maps still were missing on the webpage.
Maybe I am not seeing the wood for the trees but I can't find a solution.

Kind Regards,

P. K.

Update HeatMap...

How I can update points in Heatmap?
I can add, but need delete the last points before add the new values.

Setting Marker Fill Color has no effect in Internet Explorer 11

Hi,

If you set fill colour like

$.each(mapData, function(count, pin) {
target.jHERE('marker', { latitude: pin.latitude, longitude: pin.longitude }, {
text: pin.count,
textColor: '#333333',
fill: pin.fillColour,
stroke: '#333333',
click: function() { markerClick(pin); }
});
});

The markers are rendered in black, however in FF and Chrome this works. It does however honour any changes to textColor. I've not determined yet if this is a problem with HERE or jHERE but that my next port of call.

Has anyone else seen this type of issue ?

Great big 'Fork me' button on jhere.net

There's only a single link on the about page pointing to this project on GitHub (and a couple pointing to extensions).

Needs a Great Big Button.

Probably Lime Green.

Exposed reference to the 'shapeContainer' object

The shapes in the shape plugin are all added to the internal 'shapeContainer' object. It'd be handy to either:

  • have an easy access to this container or
  • pass in a container to be used instead

Otherwise you have to root around inside the 'originalMap' call to grab hold of it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.