bjornd / jvectormap Goto Github PK
View Code? Open in Web Editor NEWHome Page: jvectormap.com
License: GNU Affero General Public License v3.0
Home Page: jvectormap.com
License: GNU Affero General Public License v3.0
hi, is there a way to overlay the OpenLayers exmple: http://www.openlayers.org/dev/examples/mouse-position.html
for the mouse control, so that on click on the map, we can get both the latitude and longitude of the mouse pointer?
i would like to use your map, as a visual for users to add their geo location, but i a unsure how to proceed.
any advice much appreciated.
The attribute fields in the map data pulled from www.naturalearthdata.com seems to be encoded in iso-8859-1. This caused problems when attempting to convert maps for countries with non-ascii characters. I'm not sure if this issue is due to my specific development environment or not. My solution was to add .decode('iso-8859-1') to strings pulled from the attribute tables.
ex:
code = feature.GetFieldAsString(self.country_code_index).decode('iso-8859-1')
First of all, thank you for your hard work in creating this project.
When following the example on jvectormap website, I got this error in both Firefox and Chrome (latest):
this.markers is undefined
This is my code, very simple:
$('#my_map').vectorMap({
map: 'world_en',
values: gdpData,
markers: [], // If I didn't add empty array markers, initialization fails.
scaleColors: ['#C8EEFF', '#0071A4'],
normalizeFunction: 'polynomial',
hoverOpacity: 0.7,
hoverColor: false
});
As you can see in the snippet, I had to add markers as empty array to work around the bug.
Perhaps var defaultParams
need to contains markers?
When I load the jVectorMap in Webkit, I get an error like this:
event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
Is there an alternative to event.layerX/etc that would avoid this warning (and future deprecation)?
Is there any way to have the map zoom in on a specific area by default? I want to load the full world map with only markers on the US, so users can zoom out to the whole world after it loads.
in applyTransform()
var maxTransX, maxTransY, minTransX, maxTransY;
maxTransY is defined twice.
jVectorMap should provide improved API for marker management (add, remove).
jVectorMap should have an option to add interactive markers on maps. Coordinates could be provided as lat/lng or in map's pixels.
Selected state should be managed using API
Maybe I'm wrong, but doesn't the 'en' in the name of the map stand for "English", which means that the language of the map should be English? Actually it's german.
Here are the translations (hope they're all correct):
Niedersachsen = Lower Saxony
Schleswig-Holstein = Schleswig-Holstein
Mecklenburg-Vorpommern = Mecklenburg-Vorpommern
Bremen = Bremen
Sachsen-Anhalt = Saxony-Anhalt
Brandenburg = Brandenburg
Berlin = Berlin
Thüringen = Thuringia
Sachsen = Saxony
Nordrhein-Westfalen = North Rhine-Westphalia
Rheinland-Pfalz = Rhineland-Palatinate
Hessen = Hesse
Bayern = Bavaria
Baden-Württemberg = Baden-Württemberg
Saarland = Saarland
Hamburg = Hamburg
How can i set a color country on click event ?
[code]
div class="country">
a href="" rel="DE">Germany
...
/div>
[/code]
and then Germany come in green on the map.
Can i do that ?
Dear sir ;
based in your website i understood the following
1-use converter.py paython file
2-and run this command
python
path/to/converter.py
path/to/geo-data.shp
path/to/resulting-map.js
--width 900
--country_name_index 4
--where "ISO = 'USA'"
--codes_file path/to/codes-en.tsv
--insets '[{"codes": ["US-AK"], "width": 200, "left": 10, "top": 370}, {"codes": ["US-HI"], "width": 100, "left": 220, "top": 400}]'
--minimal_area 4000000
--buffer_distance -3000
--simplify_tolerance 1000
--longtitude0 10w
--name us
but i still need to show me USA GIS format which used by you ,if you can also send me New york GIS File
Map could be zoomed on mouse scroll.
Styles should be grouped in three groups: default, hovered, selected.
It would be wonderful if jVectorMap supported some of the features for navigation on tablets, including:
Just a thought: Perhaps eg jQuery Mobile http://jquerymobile.com/ would help.
singapore is missing from the map.
If I add a jvectormap to the DOM, mouseover it, and then remove it, it leaves behind the label it used for the hover text.
It creates a new label for each jvectormap created and doesn't remove any of them.
API should provide methods for selecting/deselecting of the regions and subscribing for events representing such user actions. So the regions will behave like radio buttons. For turning on of such behavior special should be provided. Special styles could be set for selected regions.
In order to get the example to work, I had to add a script block:
<script>
$(function(){
$('#world-map').vectorMap();
});
</script>
As well as id="world-map" to the div element.
It would be great if you could publish some of the extra input files needed to generate the world/usa map. What format should the 'codes.tsv' file be in for example.
Best Regards,
Eric
I'm trying to use the converter using the 110m map data from Natural Earth data and the following command:
python
converter.py
result.js
ne_110m_admin_0_countries.shp
result.js
--width 900
--country_name_index 4
--minimal_area 4000
--buffer_distance -3000
--simplify_tolerance 1000
--longtitude 10
--name world
Upon completion, the only country in the result.js file is ZWE (Zimbabwe). I'm trying to create a world map that includes Antarctica so I'm using the provided tool to attempt to create it. I can't for the life of me figure out what I'm doing wrong.
ValueError: No Shapely geometry can be created from null value (India map with buffer distance -1500)
Could you list which python packages I need to install to run it?
argparse and something that has osgeo?
Love jVectorMap, thanks for the great work.
I recently added it to our kiva.org lender pages, e.g., http://www.kiva.org/lender/penguinsforthewin (at the bottom of the page)
However, some of our lenders noticed some missing countries.
I could produce a patch for adding them in the listing, but for the actual shapes on the map, not sure what your process would be for going about that?
User should be able to focus on certain region or just place on the map
I've generated a few maps from d-maps.com and wikipedia, through Adobe AI, and converted to the correct JS format. Rendering is fine in Chrome/Firefox and IE9, but when I toggle IE to one of the older rendering modes, the maps become totally distorted. Your maps seem fine, however. Example is here:
http://alpha.digital.library.unt.edu/explore/locations/
maps directory:http://alpha.digital.library.unt.edu/media/aubrey_public/scripts/svg/
Any ideas would be appreciated. Great work btw.
W
Options for controlling style of the regions border should be available. Style consists of border width, color, opacity.
Used this command line
python converter.py 50m_admin_1_states_provinces_shp.shp usa.js --width 900 --country_name_index 5 \ --where "ISO = 'USA'" --codes_file codes.tsv --minimal_area 400000 --buffer_distance -3000 \ --simplify_tolerance 1000 --longtitude0 10w --name us
An generated usa.js
as
$.fn.vectorMap('addMap', 'us_en',{"paths": {"US-NY": {"path": "M845.0...
However, generated maps have pathes
instead of paths
$.fn.vectorMap('addMap', 'usa_en', {"width":959,"height":593,"pathes":{"hi":{"p...
and generated map doesn't show unless it is corrected by hand.
Any changes of values might be made with animation
The one similar to used on GeoMusic.
Library JS code should be split to multiple files, one file per class.
Parameter could be provided to set the initial focus
(since jQuery 1.7) Please use .on() instead of .bind() and .delegate() ;)
See: http://api.jquery.com/delegate/ and http://api.jquery.com/bind/
If you want backward compatibility, you can ignore this issue :)
Thanks
Here: http://jvectormap.com/documentation/javascript-api/
you have an example-function with
if (code == 'ca') {
event.preventDefault();
}
The code isn't
'ca'
it's
'CA'
When a mouse is hovered over a zone when a page loads and colours are assigned with something like $("#map").vectorMap('set', 'colors', colors);
, the country that was under the mouse at the time of loading does not have the color updated properly.
Build system should be used to merge several files into one, minimize it, replace script links in the tests directory, update version number.
jVectorMap world map is looking great from a european perspective, but countries in other continents expect the world map to be centered on their continent.
Do you think that it could be possible to offset the map "on the fly" to present a different perspective based on user's preference?
Thanks
Philippe
for chicago
country_name_index = 5,
country_code_index =6,
what the index for germany and frensh
Region name should be available in the callback.
onRegionClick event shouldn't be fired when map is dragged
I would like to use the tooltip qTip2 http://craigsworks.com/projects/qtip2/ in place of the standard tooltip, but unfortunately it does not seem to work with the event handling for jVectorMap.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.